diff options
author | tb <> | 2024-01-07 16:22:46 +0000 |
---|---|---|
committer | tb <> | 2024-01-07 16:22:46 +0000 |
commit | 05357e00b2ba263fc1a39a08826e3ff098a36e00 (patch) | |
tree | 76026662202a1cbdec38cd684ec3bd7394b03ae2 | |
parent | e585d87ddb7f7d7ff614655f1da0f86cbb51671a (diff) | |
download | openbsd-05357e00b2ba263fc1a39a08826e3ff098a36e00.tar.gz openbsd-05357e00b2ba263fc1a39a08826e3ff098a36e00.tar.bz2 openbsd-05357e00b2ba263fc1a39a08826e3ff098a36e00.zip |
purpose/trust: Improve comments about COUNT/MAX confusion
-rw-r--r-- | src/lib/libcrypto/x509/x509_purp.c | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_trs.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509/x509_purp.c b/src/lib/libcrypto/x509/x509_purp.c index dbae7bcb7c..35f20e2bc3 100644 --- a/src/lib/libcrypto/x509/x509_purp.c +++ b/src/lib/libcrypto/x509/x509_purp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_purp.c,v 1.34 2024/01/06 17:17:08 tb Exp $ */ | 1 | /* $OpenBSD: x509_purp.c,v 1.35 2024/01/07 16:22:46 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 2001. | 3 | * project 2001. |
4 | */ | 4 | */ |
@@ -232,7 +232,10 @@ LCRYPTO_ALIAS(X509_PURPOSE_get_by_sname); | |||
232 | int | 232 | int |
233 | X509_PURPOSE_get_by_id(int purpose) | 233 | X509_PURPOSE_get_by_id(int purpose) |
234 | { | 234 | { |
235 | /* X509_PURPOSE_MIN == 1, so the bounds are correct. */ | 235 | /* |
236 | * Ensure the purpose identifier is between MIN and MAX inclusive. | ||
237 | * If so, translate it to an index into the xstandard[] table. | ||
238 | */ | ||
236 | if (purpose < X509_PURPOSE_MIN || purpose > X509_PURPOSE_MAX) | 239 | if (purpose < X509_PURPOSE_MIN || purpose > X509_PURPOSE_MAX) |
237 | return -1; | 240 | return -1; |
238 | 241 | ||
diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c index e3a20e22b0..6e98eb2785 100644 --- a/src/lib/libcrypto/x509/x509_trs.c +++ b/src/lib/libcrypto/x509/x509_trs.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_trs.c,v 1.33 2024/01/07 14:50:45 tb Exp $ */ | 1 | /* $OpenBSD: x509_trs.c,v 1.34 2024/01/07 16:22:46 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 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -191,7 +191,10 @@ LCRYPTO_ALIAS(X509_TRUST_get0); | |||
191 | int | 191 | int |
192 | X509_TRUST_get_by_id(int id) | 192 | X509_TRUST_get_by_id(int id) |
193 | { | 193 | { |
194 | /* X509_TRUST_MIN == 1, so the bounds are correct. */ | 194 | /* |
195 | * Ensure the trust identifier is between MIN and MAX inclusive. | ||
196 | * If so, translate it into an index into the trstandard[] table. | ||
197 | */ | ||
195 | if (id < X509_TRUST_MIN && id > X509_TRUST_MAX) | 198 | if (id < X509_TRUST_MIN && id > X509_TRUST_MAX) |
196 | return -1; | 199 | return -1; |
197 | 200 | ||