diff options
author | 2017-04-28 22:46:40 +0000 | |
---|---|---|
committer | 2017-04-28 22:46:40 +0000 | |
commit | 0a005823a4567ef0752140d8fe858ff08cd589b3 (patch) | |
tree | f3f330ffdd35a123bdc77b171859ec7e59b451a4 /lib/libcrypto/x509/x509_vfy.c | |
parent | *** empty log message *** (diff) | |
download | wireguard-openbsd-0a005823a4567ef0752140d8fe858ff08cd589b3.tar.xz wireguard-openbsd-0a005823a4567ef0752140d8fe858ff08cd589b3.zip |
revert previous accidental commit
Diffstat (limited to 'lib/libcrypto/x509/x509_vfy.c')
-rw-r--r-- | lib/libcrypto/x509/x509_vfy.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libcrypto/x509/x509_vfy.c b/lib/libcrypto/x509/x509_vfy.c index 09d33d4cf1a..8c2f5b66db8 100644 --- a/lib/libcrypto/x509/x509_vfy.c +++ b/lib/libcrypto/x509/x509_vfy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vfy.c,v 1.62 2017/04/28 22:38:51 beck Exp $ */ +/* $OpenBSD: x509_vfy.c,v 1.63 2017/04/28 22:46:40 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -541,7 +541,15 @@ X509_verify_cert(X509_STORE_CTX *ctx) /* Safety net, error returns must set ctx->error */ if (ok <= 0 && ctx->error == X509_V_OK) ctx->error = X509_V_ERR_UNSPECIFIED; - return ok; + + /* + * Safety net, if user provided verify callback indicates sucess + * make sure they have set error to X509_V_OK + */ + if (ctx->verify_cb != null_callback && ok == 1) + ctx->error = X509_V_OK; + + return(ctx->error == X509_V_OK); } /* Given a STACK_OF(X509) find the issuer of cert (if any) |