Skip to content

Commit f7bfa71

Browse files
ColtonWilleydouzzer
authored andcommitted
Implement support for verify flag X509_V_FLAG_PARTIAL_CHAIN
1 parent 12f4f69 commit f7bfa71

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/x509_str.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,11 @@ int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX* ctx)
403403
* a trusted CA in the CM */
404404
ret = wolfSSL_X509_verify_cert_ex(ctx);
405405
if (ret != WOLFSSL_SUCCESS) {
406+
if ((ctx->store->param->flags & X509_V_FLAG_PARTIAL_CHAIN) &&
407+
(added == 1)) {
408+
wolfSSL_sk_X509_push(ctx->chain, ctx->current_cert);
409+
ret = WOLFSSL_SUCCESS;
410+
}
406411
goto exit;
407412
}
408413

wolfssl/openssl/ssl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY;
643643
#define X509_V_FLAG_CRL_CHECK WOLFSSL_CRL_CHECK
644644
#define X509_V_FLAG_CRL_CHECK_ALL WOLFSSL_CRL_CHECKALL
645645

646-
#define X509_V_FLAG_PARTIAL_CHAIN 0
646+
#define X509_V_FLAG_PARTIAL_CHAIN 0x80000
647647
#define X509_V_FLAG_TRUSTED_FIRST 0
648648

649649
#define X509_V_FLAG_USE_CHECK_TIME WOLFSSL_USE_CHECK_TIME

0 commit comments

Comments
 (0)