Handle NULL parameter in some EVP utility functions.
This commit is contained in:
parent
0aa08a2e34
commit
18096abb29
@ -255,11 +255,15 @@ int EVP_MD_pkey_type(const EVP_MD *md)
|
|||||||
|
|
||||||
int EVP_MD_size(const EVP_MD *md)
|
int EVP_MD_size(const EVP_MD *md)
|
||||||
{
|
{
|
||||||
|
if (!md)
|
||||||
|
return -1;
|
||||||
return md->md_size;
|
return md->md_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
|
const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
|
||||||
{
|
{
|
||||||
|
if (!ctx)
|
||||||
|
return NULL;
|
||||||
return ctx->digest;
|
return ctx->digest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user