mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 04:04:39 +02:00
Merge pull request #7895 from embhorn/zd18433
Use verify callback before checking dates
This commit is contained in:
@@ -269,6 +269,10 @@ int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX* ctx)
|
|||||||
ctx->current_cert->derCert->length,
|
ctx->current_cert->derCert->length,
|
||||||
WOLFSSL_FILETYPE_ASN1);
|
WOLFSSL_FILETYPE_ASN1);
|
||||||
SetupStoreCtxError(ctx, ret);
|
SetupStoreCtxError(ctx, ret);
|
||||||
|
#if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
|
||||||
|
if (ctx->store && ctx->store->verify_cb)
|
||||||
|
ret = ctx->store->verify_cb(ret >= 0 ? 1 : 0, ctx) == 1 ? 0 : ret;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NO_ASN_TIME
|
#ifndef NO_ASN_TIME
|
||||||
if (ret != WC_NO_ERR_TRACE(ASN_BEFORE_DATE_E) &&
|
if (ret != WC_NO_ERR_TRACE(ASN_BEFORE_DATE_E) &&
|
||||||
@@ -289,14 +293,14 @@ int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX* ctx)
|
|||||||
ret = ASN_BEFORE_DATE_E;
|
ret = ASN_BEFORE_DATE_E;
|
||||||
}
|
}
|
||||||
SetupStoreCtxError(ctx, ret);
|
SetupStoreCtxError(ctx, ret);
|
||||||
|
#if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
|
||||||
|
if (ctx->store && ctx->store->verify_cb)
|
||||||
|
ret = ctx->store->verify_cb(ret >= 0 ? 1 : 0,
|
||||||
|
ctx) == 1 ? 0 : -1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
|
|
||||||
if (ctx->store && ctx->store->verify_cb)
|
|
||||||
ret = ctx->store->verify_cb(ret >= 0 ? 1 : 0, ctx) == 1 ? 0 : -1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret >= 0 ? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
|
return ret >= 0 ? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
|
||||||
}
|
}
|
||||||
return WOLFSSL_FATAL_ERROR;
|
return WOLFSSL_FATAL_ERROR;
|
||||||
|
Reference in New Issue
Block a user