Skip to content

Commit

Permalink
X509_STORE_CTX_purpose_inherit(): replace magic constant '0' by 'X509…
Browse files Browse the repository at this point in the history
…_TRUST_DEFAULT'
  • Loading branch information
DDvO committed Dec 7, 2024
1 parent 5cbb75e commit 199ab0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crypto/x509/x509_vfy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2286,10 +2286,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);
Expand All @@ -2299,7 +2299,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;
}
Expand Down

0 comments on commit 199ab0e

Please sign in to comment.