Ensure configured before assuming message digest is supported

This commit is contained in:
kaleb-himes
2015-12-21 23:03:45 -07:00
parent d395c5aba3
commit 0cb2374c69

View File

@ -13311,14 +13311,26 @@ int wolfSSL_RSA_sign(int type, const unsigned char* m,
}
switch (type) {
#ifndef WOLFSSL_MD2
case NID_md2: type = MD2h; break;
#endif
#ifndef NO_MD5
case NID_md5: type = MD5h; break;
#endif
#ifndef NO_SHA
case NID_sha1: type = SHAh; break;
#endif
#ifndef NO_SHA256
case NID_sha256: type = SHA256h; break;
#endif
#ifdef WOLFSSL_SHA384
case NID_sha384: type = SHA384h; break;
#endif
#ifdef WOLFSSL_SHA512
case NID_sha512: type = SHA512h; break;
#endif
default:
WOLFSSL_MSG("This NID (md type) is not yet implemented");
WOLFSSL_MSG("This NID (md type) not configured or not implemented");
return 0;
}