diff options
author | beck <> | 2017-04-28 23:12:04 +0000 |
---|---|---|
committer | beck <> | 2017-04-28 23:12:04 +0000 |
commit | 9bbcf957df335a5f15cc50d4817f4bd8363948d6 (patch) | |
tree | e64fb834480eba8d456e54ad925b0afd35bc3b60 | |
parent | ca8d206a9628956eda0f7dde8d4bdae603e5389e (diff) | |
download | openbsd-9bbcf957df335a5f15cc50d4817f4bd8363948d6.tar.gz openbsd-9bbcf957df335a5f15cc50d4817f4bd8363948d6.tar.bz2 openbsd-9bbcf957df335a5f15cc50d4817f4bd8363948d6.zip |
MFC: Revert previous change that forced consistency between return value and
error code, since this breaks the documented API. Under certain circumstances
this will result in incorrect successful certiticate verification (where
a user supplied callback always returns 1, and later code checks the error
code to potentially abort post verification)
-rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index fbed5ec800..d8c09a1277 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vfy.c,v 1.61 2017/02/05 02:33:21 beck Exp $ */ | 1 | /* $OpenBSD: x509_vfy.c,v 1.61.4.1 2017/04/28 23:12:04 beck Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -541,15 +541,7 @@ X509_verify_cert(X509_STORE_CTX *ctx) | |||
541 | /* Safety net, error returns must set ctx->error */ | 541 | /* Safety net, error returns must set ctx->error */ |
542 | if (ok <= 0 && ctx->error == X509_V_OK) | 542 | if (ok <= 0 && ctx->error == X509_V_OK) |
543 | ctx->error = X509_V_ERR_UNSPECIFIED; | 543 | ctx->error = X509_V_ERR_UNSPECIFIED; |
544 | 544 | return ok; | |
545 | /* | ||
546 | * Safety net, if user provided verify callback indicates sucess | ||
547 | * make sure they have set error to X509_V_OK | ||
548 | */ | ||
549 | if (ctx->verify_cb != null_callback && ok == 1) | ||
550 | ctx->error = X509_V_OK; | ||
551 | |||
552 | return(ctx->error == X509_V_OK); | ||
553 | } | 545 | } |
554 | 546 | ||
555 | /* Given a STACK_OF(X509) find the issuer of cert (if any) | 547 | /* Given a STACK_OF(X509) find the issuer of cert (if any) |