projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check for a failure return from EVP_MD_CTX_new() in OCSP_basic_sign().
[openssl.git]
/
crypto
/
ocsp
/
ocsp_srv.c
diff --git
a/crypto/ocsp/ocsp_srv.c
b/crypto/ocsp/ocsp_srv.c
index 9c7c81a1b010d03946682bca2edbfc589d852de0..6bd6f7b6d8928330605ca14615869c106ae8053b 100644
(file)
--- a/
crypto/ocsp/ocsp_srv.c
+++ b/
crypto/ocsp/ocsp_srv.c
@@
-237,9
+237,12
@@
int OCSP_basic_sign(OCSP_BASICRESP *brsp,
EVP_PKEY_CTX *pkctx = NULL;
int i;
EVP_PKEY_CTX *pkctx = NULL;
int i;
+ if (ctx == NULL)
+ return 0;
+
if (!EVP_DigestSignInit(ctx, &pkctx, dgst, NULL, key)) {
EVP_MD_CTX_free(ctx);
if (!EVP_DigestSignInit(ctx, &pkctx, dgst, NULL, key)) {
EVP_MD_CTX_free(ctx);
- return
1
;
+ return
0
;
}
i = OCSP_basic_sign_ctx(brsp, signer, ctx, certs, flags);
EVP_MD_CTX_free(ctx);
}
i = OCSP_basic_sign_ctx(brsp, signer, ctx, certs, flags);
EVP_MD_CTX_free(ctx);