From a629b3ccfaa4b559a37d02d2739fe907dd2493a4 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Sat, 7 Dec 2024 19:00:46 +0100 Subject: [PATCH] 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) --- crypto/x509/x509_vfy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.47.3