Skip to content

Commit 66074e2

Browse files
committed
x509_str: align WOLFSSL_X509_V_ERR_INVALID_CA with OpenSSL value
WOLFSSL_X509_V_ERR_INVALID_CA was 24 while X509_V_ERR_INVALID_CA from the OpenSSL-compat header is 79. In OPENSSL_COEXIST builds the literal X509_V_ERR_INVALID_CA macro is suppressed to avoid clashing with real OpenSSL, so referencing it from src/x509_str.c failed to compile. Move WOLFSSL_X509_V_ERR_INVALID_CA to 79 so the wolfSSL native code matches the OpenSSL value, bump WC_OSSL_V509_V_ERR_MAX to 80, and use the WOLFSSL_-prefixed constant in wolfSSL_X509_verify_cert. Extend error_test()'s missing-value table to cover the new gaps (24 and 65-78). Also skip test_tls13_ticket_peer_cert_reverify under WOLFSSL_NO_DEF_TICKET_ENC_CB, since without a ticket encryption callback the server never emits a NewSessionTicket and the test's resumption step cannot run.
1 parent 1778081 commit 66074e2

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/x509_str.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX* ctx)
710710
* but the leaf signature must still be verified against the
711711
* issuer below — never skip X509StoreVerifyCert. */
712712
if (!issuer->isCa) {
713-
SetupStoreCtxError_ex(ctx, X509_V_ERR_INVALID_CA,
713+
SetupStoreCtxError_ex(ctx, WOLFSSL_X509_V_ERR_INVALID_CA,
714714
(ctx->chain) ? (int)(ctx->chain->num + 1) : 1);
715715
#if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
716716
if (ctx->store->verify_cb) {

tests/api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28238,9 +28238,11 @@ static int error_test(void)
2823828238
{11, 11},
2823928239
{17, 15},
2824028240
{19, 19},
28241+
{24, 24},
2824128242
{27, 26 },
2824228243
{61, 30},
2824328244
{63, 63},
28245+
{78, 65},
2824428246
#endif
2824528247
{ -9, WC_SPAN1_FIRST_E + 1 },
2824628248
{ -300, -300 },

tests/api/test_tls13.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5276,7 +5276,7 @@ int test_tls13_ticket_peer_cert_reverify(void)
52765276
defined(WOLFSSL_TLS13) && defined(HAVE_SESSION_TICKET) && \
52775277
defined(OPENSSL_ALL) && defined(KEEP_PEER_CERT) && \
52785278
!defined(NO_CERT_IN_TICKET) && !defined(WOLFSSL_NO_TLS12) && \
5279-
!defined(NO_RSA)
5279+
!defined(NO_RSA) && !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB)
52805280
struct test_memio_ctx test_ctx;
52815281
WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;
52825282
WOLFSSL *ssl_c = NULL, *ssl_s = NULL;

wolfssl/ssl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2684,13 +2684,13 @@ enum {
26842684
WOLFSSL_X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21,
26852685
WOLFSSL_X509_V_ERR_CERT_CHAIN_TOO_LONG = 22,
26862686
WOLFSSL_X509_V_ERR_CERT_REVOKED = 23,
2687-
WOLFSSL_X509_V_ERR_INVALID_CA = 24,
26882687
WOLFSSL_X509_V_ERR_PATH_LENGTH_EXCEEDED = 25,
26892688
WOLFSSL_X509_V_ERR_CERT_REJECTED = 28,
26902689
WOLFSSL_X509_V_ERR_SUBJECT_ISSUER_MISMATCH = 29,
2691-
WOLFSSL_X509_V_ERR_HOSTNAME_MISMATCH = 62,
2692-
WOLFSSL_X509_V_ERR_IP_ADDRESS_MISMATCH = 64,
2693-
WC_OSSL_V509_V_ERR_MAX = 65,
2690+
WOLFSSL_X509_V_ERR_HOSTNAME_MISMATCH = 62,
2691+
WOLFSSL_X509_V_ERR_IP_ADDRESS_MISMATCH = 64,
2692+
WOLFSSL_X509_V_ERR_INVALID_CA = 79,
2693+
WC_OSSL_V509_V_ERR_MAX = 80,
26942694

26952695
#ifdef HAVE_OCSP
26962696
/* OCSP Flags */

0 commit comments

Comments
 (0)