From a8d2df2a35f302fe7d928b1f670b5ad61213b2f9 Mon Sep 17 00:00:00 2001 From: tb <> Date: Mon, 8 Jan 2024 09:51:09 +0000 Subject: Inline X509_{TRUST,PUPROSE}_set() in their only callers They are now unused and will join the exodus to the attic in the next bump. ok jsing --- src/lib/libcrypto/x509/x509_vpm.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/lib/libcrypto/x509/x509_vpm.c b/src/lib/libcrypto/x509/x509_vpm.c index 662e3179a6..a3fa84448e 100644 --- a/src/lib/libcrypto/x509/x509_vpm.c +++ b/src/lib/libcrypto/x509/x509_vpm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vpm.c,v 1.41 2023/12/14 12:02:10 tb Exp $ */ +/* $OpenBSD: x509_vpm.c,v 1.42 2024/01/08 09:51:09 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2004. */ @@ -61,6 +61,7 @@ #include #include +#include #include #include #include @@ -408,14 +409,26 @@ LCRYPTO_ALIAS(X509_VERIFY_PARAM_get_flags); int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose) { - return X509_PURPOSE_set(¶m->purpose, purpose); + if (purpose < X509_PURPOSE_MIN || purpose > X509_PURPOSE_MAX) { + X509V3error(X509V3_R_INVALID_PURPOSE); + return 0; + } + + param->purpose = purpose; + return 1; } LCRYPTO_ALIAS(X509_VERIFY_PARAM_set_purpose); int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust) { - return X509_TRUST_set(¶m->trust, trust); + if (trust < X509_TRUST_MIN || trust > X509_TRUST_MAX) { + X509error(X509_R_INVALID_TRUST); + return 0; + } + + param->trust = trust; + return 1; } LCRYPTO_ALIAS(X509_VERIFY_PARAM_set_trust); -- cgit v1.2.3-55-g6feb