diff options
author | tb <> | 2024-01-08 09:51:09 +0000 |
---|---|---|
committer | tb <> | 2024-01-08 09:51:09 +0000 |
commit | a8d2df2a35f302fe7d928b1f670b5ad61213b2f9 (patch) | |
tree | cb1ec8ecb53fbf48ea916febdb4bf688b00367dd | |
parent | b5f80d33f4a3127ef91b7e10df8afd95f23e5f26 (diff) | |
download | openbsd-a8d2df2a35f302fe7d928b1f670b5ad61213b2f9.tar.gz openbsd-a8d2df2a35f302fe7d928b1f670b5ad61213b2f9.tar.bz2 openbsd-a8d2df2a35f302fe7d928b1f670b5ad61213b2f9.zip |
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
-rw-r--r-- | src/lib/libcrypto/x509/x509_vpm.c | 19 |
1 files 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 @@ | |||
1 | /* $OpenBSD: x509_vpm.c,v 1.41 2023/12/14 12:02:10 tb Exp $ */ | 1 | /* $OpenBSD: x509_vpm.c,v 1.42 2024/01/08 09:51:09 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2004. | 3 | * project 2004. |
4 | */ | 4 | */ |
@@ -61,6 +61,7 @@ | |||
61 | 61 | ||
62 | #include <openssl/buffer.h> | 62 | #include <openssl/buffer.h> |
63 | #include <openssl/crypto.h> | 63 | #include <openssl/crypto.h> |
64 | #include <openssl/err.h> | ||
64 | #include <openssl/lhash.h> | 65 | #include <openssl/lhash.h> |
65 | #include <openssl/stack.h> | 66 | #include <openssl/stack.h> |
66 | #include <openssl/x509.h> | 67 | #include <openssl/x509.h> |
@@ -408,14 +409,26 @@ LCRYPTO_ALIAS(X509_VERIFY_PARAM_get_flags); | |||
408 | int | 409 | int |
409 | X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose) | 410 | X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose) |
410 | { | 411 | { |
411 | return X509_PURPOSE_set(¶m->purpose, purpose); | 412 | if (purpose < X509_PURPOSE_MIN || purpose > X509_PURPOSE_MAX) { |
413 | X509V3error(X509V3_R_INVALID_PURPOSE); | ||
414 | return 0; | ||
415 | } | ||
416 | |||
417 | param->purpose = purpose; | ||
418 | return 1; | ||
412 | } | 419 | } |
413 | LCRYPTO_ALIAS(X509_VERIFY_PARAM_set_purpose); | 420 | LCRYPTO_ALIAS(X509_VERIFY_PARAM_set_purpose); |
414 | 421 | ||
415 | int | 422 | int |
416 | X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust) | 423 | X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust) |
417 | { | 424 | { |
418 | return X509_TRUST_set(¶m->trust, trust); | 425 | if (trust < X509_TRUST_MIN || trust > X509_TRUST_MAX) { |
426 | X509error(X509_R_INVALID_TRUST); | ||
427 | return 0; | ||
428 | } | ||
429 | |||
430 | param->trust = trust; | ||
431 | return 1; | ||
419 | } | 432 | } |
420 | LCRYPTO_ALIAS(X509_VERIFY_PARAM_set_trust); | 433 | LCRYPTO_ALIAS(X509_VERIFY_PARAM_set_trust); |
421 | 434 | ||