wolfSSL_EVP_CipherInit_ex handle ENGINE argument and add a sanity check

This commit is contained in:
Jacob Barthelmeh
2016-12-10 12:57:03 -07:00
parent 1326fe1b0d
commit 4f317a9a1d
3 changed files with 18 additions and 1 deletions

View File

@@ -11677,6 +11677,11 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
const WOLFSSL_EVP_MD* type)
{
WOLFSSL_ENTER("EVP_DigestInit");
if (ctx == NULL || type == NULL) {
return BAD_FUNC_ARG;
}
if (XSTRNCMP(type, "SHA256", 6) == 0) {
ctx->macType = SHA256;
wolfSSL_SHA256_Init((SHA256_CTX*)&ctx->hash);