summaryrefslogtreecommitdiff
path: root/src/lib/libc
diff options
context:
space:
mode:
authorbeck <>2017-04-28 23:03:58 +0000
committerbeck <>2017-04-28 23:03:58 +0000
commit0c57456f9f2117b8c7693bf23610ec60000f181a (patch)
tree02bb5bafaab90ca6699776666acd5125c8b56244 /src/lib/libc
parent1a022d2b7f958fffe8e920e5510d226f01a2b3d0 (diff)
downloadopenbsd-0c57456f9f2117b8c7693bf23610ec60000f181a.tar.gz
openbsd-0c57456f9f2117b8c7693bf23610ec60000f181a.tar.bz2
openbsd-0c57456f9f2117b8c7693bf23610ec60000f181a.zip
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)
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c12
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 8c2f5b66db..0d01301446 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.63 2017/04/28 22:46:40 beck Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.64 2017/04/28 23:03:58 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)