summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2023-06-10 11:01:32 +0200
committerTomas Mraz <tomas@openssl.org>2023-06-12 08:26:20 +0200
commit959c150a1dcc4535c2d94ac6f3310566723911f1 (patch)
tree1ef950d5f062567dea051ee834312d535e1051d5
parente3b01eb6b25e76d4832d81023d056948edc2cb36 (diff)
Fix incorrect ERR_raise() calls
A few ERR_raise() calls in v3_purp.c use the wrong library. For example, in OpenSSL 3.1.1 we get 00000000:error:0580009E:x509 certificate routines:ossl_x509v3_cache_extensions:reason(158):crypto/x509/v3_purp.c:635: instead of 00000000:error:1100009E:X509 V3 routines:ossl_x509v3_cache_extensions:invalid certificate:crypto/x509/v3_purp.c:635: Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21168)
-rw-r--r--crypto/x509/v3_purp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/x509/v3_purp.c b/crypto/x509/v3_purp.c
index 9db8a977cf..800cbbcd51 100644
--- a/crypto/x509/v3_purp.c
+++ b/crypto/x509/v3_purp.c
@@ -441,7 +441,7 @@ int ossl_x509v3_cache_extensions(X509 *x)
* in case ctx->param->flags & X509_V_FLAG_X509_STRICT
*/
if (bs->pathlen->type == V_ASN1_NEG_INTEGER) {
- ERR_raise(ERR_LIB_X509, X509V3_R_NEGATIVE_PATHLEN);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_NEGATIVE_PATHLEN);
x->ex_flags |= EXFLAG_INVALID;
} else {
x->ex_pathlen = ASN1_INTEGER_get(bs->pathlen);
@@ -482,7 +482,7 @@ int ossl_x509v3_cache_extensions(X509 *x)
ASN1_BIT_STRING_free(usage);
/* Check for empty key usage according to RFC 5280 section 4.2.1.3 */
if (x->ex_kusage == 0) {
- ERR_raise(ERR_LIB_X509, X509V3_R_EMPTY_KEY_USAGE);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_EMPTY_KEY_USAGE);
x->ex_flags |= EXFLAG_INVALID;
}
} else if (i != -1) {
@@ -634,7 +634,7 @@ int ossl_x509v3_cache_extensions(X509 *x)
return 1;
}
CRYPTO_THREAD_unlock(x->lock);
- ERR_raise(ERR_LIB_X509, X509V3_R_INVALID_CERTIFICATE);
+ ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_CERTIFICATE);
return 0;
}