projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix EVP_DigestInit_ex with NULL digest
[openssl.git]
/
crypto
/
evp
/
digest.c
diff --git
a/crypto/evp/digest.c
b/crypto/evp/digest.c
index bd7760d0c977a9ea55fd64b5df1ebe7883d6250c..f2643f32486ad2637d6f328cb860f380f2dff1f5 100644
(file)
--- a/
crypto/evp/digest.c
+++ b/
crypto/evp/digest.c
@@
-203,9
+203,12
@@
int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
ctx->engine = impl;
} else
ctx->engine = NULL;
ctx->engine = impl;
} else
ctx->engine = NULL;
- } else if (!ctx->digest) {
- EVPerr(EVP_F_EVP_DIGESTINIT_EX, EVP_R_NO_DIGEST_SET);
- return 0;
+ } else {
+ if (!ctx->digest) {
+ EVPerr(EVP_F_EVP_DIGESTINIT_EX, EVP_R_NO_DIGEST_SET);
+ return 0;
+ }
+ type = ctx->digest;
}
#endif
if (ctx->digest != type) {
}
#endif
if (ctx->digest != type) {