mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-03-07 00:44:03 +01:00
align compatibility layer sha256 and sha224 structs
This commit is contained in:
12
src/ssl.c
12
src/ssl.c
@@ -11703,37 +11703,37 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
|
||||
|
||||
if (XSTRNCMP(type, "SHA256", 6) == 0) {
|
||||
ctx->macType = SHA256;
|
||||
wolfSSL_SHA256_Init((SHA256_CTX*)&ctx->hash);
|
||||
wolfSSL_SHA256_Init(&(ctx->hash.sha256));
|
||||
}
|
||||
#ifdef WOLFSSL_SHA224
|
||||
else if (XSTRNCMP(type, "SHA224", 6) == 0) {
|
||||
ctx->macType = SHA224;
|
||||
wolfSSL_SHA224_Init((SHA224_CTX*)&ctx->hash);
|
||||
wolfSSL_SHA224_Init(&(ctx->hash.sha224));
|
||||
}
|
||||
#endif
|
||||
#ifdef WOLFSSL_SHA384
|
||||
else if (XSTRNCMP(type, "SHA384", 6) == 0) {
|
||||
ctx->macType = SHA384;
|
||||
wolfSSL_SHA384_Init((SHA384_CTX*)&ctx->hash);
|
||||
wolfSSL_SHA384_Init(&(ctx->hash.sha384));
|
||||
}
|
||||
#endif
|
||||
#ifdef WOLFSSL_SHA512
|
||||
else if (XSTRNCMP(type, "SHA512", 6) == 0) {
|
||||
ctx->macType = SHA512;
|
||||
wolfSSL_SHA512_Init((SHA512_CTX*)&ctx->hash);
|
||||
wolfSSL_SHA512_Init(&(ctx->hash.sha512));
|
||||
}
|
||||
#endif
|
||||
#ifndef NO_MD5
|
||||
else if (XSTRNCMP(type, "MD5", 3) == 0) {
|
||||
ctx->macType = MD5;
|
||||
wolfSSL_MD5_Init((MD5_CTX*)&ctx->hash);
|
||||
wolfSSL_MD5_Init(&(ctx->hash.md5));
|
||||
}
|
||||
#endif
|
||||
#ifndef NO_SHA
|
||||
/* has to be last since would pick or 224, 256, 384, or 512 too */
|
||||
else if (XSTRNCMP(type, "SHA", 3) == 0) {
|
||||
ctx->macType = SHA;
|
||||
wolfSSL_SHA_Init((SHA_CTX*)&ctx->hash);
|
||||
wolfSSL_SHA_Init(&(ctx->hash.sha));
|
||||
}
|
||||
#endif /* NO_SHA */
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user