diff options
author | miod <> | 2015-07-19 05:42:55 +0000 |
---|---|---|
committer | miod <> | 2015-07-19 05:42:55 +0000 |
commit | e2fdff6ec8caaf7f2ab38d837f605b9724bc5279 (patch) | |
tree | 50a9d501470e88dcc8bed9bf14a1c0a28f099e3b /src/lib/libcrypto/x509 | |
parent | bac793e50611d30da720c67ccfadbbf60bb3e8aa (diff) | |
download | openbsd-e2fdff6ec8caaf7f2ab38d837f605b9724bc5279.tar.gz openbsd-e2fdff6ec8caaf7f2ab38d837f605b9724bc5279.tar.bz2 openbsd-e2fdff6ec8caaf7f2ab38d837f605b9724bc5279.zip |
Now that it is safe to invoke X509_STORE_CTX_cleanup() if X509_STORE_CTX_init()
fails, check its return value and correctly mop up after ourselves.
ok beck@ doug@
Diffstat (limited to 'src/lib/libcrypto/x509')
-rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index bc5905784d..f2dc356dc8 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.43 2015/07/19 01:44:16 doug Exp $ */ | 1 | /* $OpenBSD: x509_vfy.c,v 1.44 2015/07/19 05:42:55 miod 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 | * |
@@ -1091,8 +1091,10 @@ check_crl_path(X509_STORE_CTX *ctx, X509 *x) | |||
1091 | /* Don't allow recursive CRL path validation */ | 1091 | /* Don't allow recursive CRL path validation */ |
1092 | if (ctx->parent) | 1092 | if (ctx->parent) |
1093 | return 0; | 1093 | return 0; |
1094 | if (!X509_STORE_CTX_init(&crl_ctx, ctx->ctx, x, ctx->untrusted)) | 1094 | if (!X509_STORE_CTX_init(&crl_ctx, ctx->ctx, x, ctx->untrusted)) { |
1095 | return -1; | 1095 | ret = -1; |
1096 | goto err; | ||
1097 | } | ||
1096 | 1098 | ||
1097 | crl_ctx.crls = ctx->crls; | 1099 | crl_ctx.crls = ctx->crls; |
1098 | /* Copy verify params across */ | 1100 | /* Copy verify params across */ |