Skip to content

Commit

Permalink
opensslcoexist fixes: add WOLFSSL_EVP_MD_FLAG_XOF, and use WC_MD4_BLO…
Browse files Browse the repository at this point in the history
…CK_SIZE, not MD4_BLOCK_SIZE.
  • Loading branch information
douzzer committed Jan 25, 2025
1 parent e6b87c2 commit f7abd7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions wolfcrypt/src/evp.c
Original file line number Diff line number Diff line change
Expand Up @@ -10986,7 +10986,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type)
#if defined(WOLFSSL_SHA3) && defined(WOLFSSL_SHAKE256)
case WC_HASH_TYPE_SHAKE256:
#endif
return EVP_MD_FLAG_XOF;
return WOLFSSL_EVP_MD_FLAG_XOF;
default:
return 0;
}
Expand Down Expand Up @@ -11062,7 +11062,7 @@ int wolfSSL_EVP_MD_block_size(const WOLFSSL_EVP_MD* type)
#endif
#ifndef NO_MD4
if (XSTRCMP(type, WC_SN_md4) == 0) {
return MD4_BLOCK_SIZE;
return WC_MD4_BLOCK_SIZE;
} else
#endif
#ifndef NO_MD5
Expand Down Expand Up @@ -11137,7 +11137,7 @@ int wolfSSL_EVP_MD_size(const WOLFSSL_EVP_MD* type)
#endif
#ifndef NO_MD4
if (XSTRCMP(type, WC_SN_md4) == 0) {
return MD4_DIGEST_SIZE;
return WC_MD4_DIGEST_SIZE;
} else
#endif
#ifndef NO_MD5
Expand Down
3 changes: 2 additions & 1 deletion wolfssl/openssl/evp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,7 @@ WOLFSSL_API int wolfSSL_EVP_SignInit_ex(WOLFSSL_EVP_MD_CTX* ctx,
#define WOLFSSL_EVP_CTRL_CCM_SET_TAG WOLFSSL_EVP_CTRL_AEAD_SET_TAG
#define WOLFSSL_EVP_CTRL_CCM_SET_L 0x14
#define WOLFSSL_EVP_CTRL_CCM_SET_MSGLEN 0x15
#define WOLFSSL_EVP_MD_FLAG_XOF 0x2

#define WOLFSSL_NO_PADDING_BLOCK_SIZE 1

Expand Down Expand Up @@ -1262,7 +1263,7 @@ WOLFSSL_API int wolfSSL_EVP_SignInit_ex(WOLFSSL_EVP_MD_CTX* ctx,
#define EVP_MD_CTX_set_flags(ctx, flags) WC_DO_NOTHING
#endif

#define EVP_MD_FLAG_XOF 0x2
#define EVP_MD_FLAG_XOF WOLFSSL_EVP_MD_FLAG_XOF

#define EVP_Digest wolfSSL_EVP_Digest
#define EVP_DigestInit wolfSSL_EVP_DigestInit
Expand Down

0 comments on commit f7abd7c

Please sign in to comment.