@@ -43,6 +43,7 @@ static int X509StoreAddCa(WOLFSSL_X509_STORE* store,
4343 WOLFSSL_X509 * x509 , int type );
4444#endif
4545
46+ /* Based on OpenSSL default max depth */
4647#ifndef WOLFSSL_X509_STORE_DEFAULT_MAX_DEPTH
4748#define WOLFSSL_X509_STORE_DEFAULT_MAX_DEPTH 100
4849#endif
@@ -264,9 +265,9 @@ static int X509StoreVerifyCert(WOLFSSL_X509_STORE_CTX* ctx)
264265 if (ret != WC_NO_ERR_TRACE (ASN_BEFORE_DATE_E ) &&
265266 ret != WC_NO_ERR_TRACE (ASN_AFTER_DATE_E )) {
266267 /* wolfSSL_CertManagerVerifyBuffer only returns ASN_AFTER_DATE_E or
267- ASN_BEFORE_DATE_E if there are no additional errors found in the
268- cert. Therefore, check if the cert is expired or not yet valid
269- in order to return the correct expected error. */
268+ * ASN_BEFORE_DATE_E if there are no additional errors found in the
269+ * cert. Therefore, check if the cert is expired or not yet valid
270+ * in order to return the correct expected error. */
270271 byte * afterDate = ctx -> current_cert -> notAfter .data ;
271272 byte * beforeDate = ctx -> current_cert -> notBefore .data ;
272273
@@ -333,7 +334,7 @@ int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX* ctx)
333334 ret = wolfSSL_sk_X509_push (certs ,
334335 wolfSSL_sk_X509_value (ctx -> ctxIntermediates , i ));
335336 if (ret <= 0 ) {
336- return WOLFSSL_FAILURE ;
337+ goto exit ;
337338 }
338339
339340 numInterAdd ++ ;
0 commit comments