Skip to content

Commit f786a3b

Browse files
committed
fixup! Make crypto.c compile/link with OpenSSL 3
Fix MD5 primitive initialization to avoid SIGBUS/SIGSEGV.
1 parent c1981ea commit f786a3b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crypto.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ hmac_md5(unsigned char *text, int text_len, unsigned char *key, int key_len,
240240
unsigned char* digest)
241241
{
242242
#ifdef IS_OPENSSL3
243-
EVP_MD *md;
243+
const EVP_MD *md;
244244
EVP_MD_CTX *context;
245245
#else
246246
MD5_CTX context;
@@ -257,6 +257,9 @@ hmac_md5(unsigned char *text, int text_len, unsigned char *key, int key_len,
257257
#ifdef IS_OPENSSL3
258258
context = EVP_MD_CTX_new();
259259
assert(context != NULL);
260+
261+
md = EVP_md5();
262+
assert(md != NULL);
260263
#endif
261264

262265
/* if key is longer than 64 bytes reset it to key=MD5(key) */

0 commit comments

Comments
 (0)