mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
condense to one switch statement for testing of message digests
This commit is contained in:
24
src/ssl.c
24
src/ssl.c
@@ -13311,14 +13311,14 @@ int wolfSSL_RSA_sign(int type, const unsigned char* m,
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case NID_md2: break;
|
||||
case NID_md5: break;
|
||||
case NID_sha1: break;
|
||||
case NID_sha256: break;
|
||||
case NID_sha384: break;
|
||||
case NID_sha512: break;
|
||||
case NID_md2: type = MD2h; break;
|
||||
case NID_md5: type = MD5h; break;
|
||||
case NID_sha1: type = SHAh; break;
|
||||
case NID_sha256: type = SHA256h; break;
|
||||
case NID_sha384: type = SHA384h; break;
|
||||
case NID_sha512: type = SHA512h; break;
|
||||
default:
|
||||
WOLFSSL_MSG("This NID_ is not yet implemented");
|
||||
WOLFSSL_MSG("This NID (md type) is not yet implemented");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -13364,16 +13364,6 @@ int wolfSSL_RSA_sign(int type, const unsigned char* m,
|
||||
|
||||
if (rng) {
|
||||
|
||||
switch (type) {
|
||||
case NID_md2: type = MD2h; break;
|
||||
case NID_md5: type = MD5h; break;
|
||||
case NID_sha1: type = SHAh; break;
|
||||
case NID_sha256: type = SHA256h; break;
|
||||
case NID_sha384: type = SHA384h; break;
|
||||
case NID_sha512: type = SHA512h; break;
|
||||
/* no default, already checked if NID is supported */
|
||||
}
|
||||
|
||||
signSz = wc_EncodeSignature(encodedSig, m, mLen, type);
|
||||
if (signSz == 0) {
|
||||
WOLFSSL_MSG("Bad Encode Signature");
|
||||
|
Reference in New Issue
Block a user