Introduced x509_crt_init(), x509_crl_init() and x509_csr_init()
diff --git a/library/x509_crt.c b/library/x509_crt.c
index f57fddc..f73724e 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -785,7 +785,7 @@
prev = crt;
crt = crt->next;
- memset( crt, 0, sizeof( x509_cert ) );
+ x509_crt_init( crt );
}
if( ( ret = x509parse_crt_der_core( crt, buf, buflen ) ) != 0 )
@@ -1603,6 +1603,14 @@
}
/*
+ * Initialize a certificate chain
+ */
+void x509_crt_init( x509_cert *crt )
+{
+ memset( crt, 0, sizeof(x509_cert) );
+}
+
+/*
* Unallocate all certificate data
*/
void x509_crt_free( x509_cert *crt )