summaryrefslogtreecommitdiffstats
path: root/crypto/x509/x509_v3.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/x509/x509_v3.c')
-rw-r--r--crypto/x509/x509_v3.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/x509/x509_v3.c b/crypto/x509/x509_v3.c
index 5721f78510..100b08773c 100644
--- a/crypto/x509/x509_v3.c
+++ b/crypto/x509/x509_v3.c
@@ -63,6 +63,7 @@
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
+#include <openssl/x509v3.h>
int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x)
{
@@ -264,3 +265,24 @@ int X509_EXTENSION_get_critical(X509_EXTENSION *ex)
if (ex == NULL) return(0);
return(ex->critical);
}
+
+/* Initialisation routine: used to initialise the X509 and X509v3 tables */
+
+static int init_done = 0;
+
+void X509_init(void)
+{
+ if(init_done) return;
+ X509V3_add_standard_extensions();
+ X509_PURPOSE_add_standard();
+ X509_TRUST_add_standard();
+ init_done = 1;
+}
+
+void X509_cleanup(void)
+{
+ X509V3_EXT_cleanup();
+ X509_PURPOSE_cleanup();
+ X509_TRUST_cleanup();
+ init_done = 0;
+}