From: Dr. David von Oheimb Date: Sat, 7 Dec 2024 18:00:46 +0000 (+0100) Subject: X509_STORE_CTX_purpose_inherit(): replace magic constant '0' by 'X509_TRUST_DEFAULT' X-Git-Tag: 4.0-PRE-CLANG-FORMAT-WEBKIT~550 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a629b3ccfaa4b559a37d02d2739fe907dd2493a4;p=thirdparty%2Fopenssl.git X509_STORE_CTX_purpose_inherit(): replace magic constant '0' by 'X509_TRUST_DEFAULT' Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18764) --- diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index 9af893610f7..83c32915c0b 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -2648,10 +2648,10 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, ptmp = X509_PURPOSE_get0(idx); } /* If trust not set then get from purpose default */ - if (trust == 0) + if (trust == X509_TRUST_DEFAULT) trust = ptmp->trust; } - if (trust != 0) { + if (trust != X509_TRUST_DEFAULT) { idx = X509_TRUST_get_by_id(trust); if (idx == -1) { ERR_raise(ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID); @@ -2661,7 +2661,7 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, if (ctx->param->purpose == 0 && purpose != 0) ctx->param->purpose = purpose; - if (ctx->param->trust == 0 && trust != 0) + if (ctx->param->trust == X509_TRUST_DEFAULT && trust != X509_TRUST_DEFAULT) ctx->param->trust = trust; return 1; }