hopefully this actually fixes building with openssl < 3.0

Sun, 01 Jun 2025 21:50:24 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 01 Jun 2025 21:50:24 +0200
changeset 604
886658ba8f25
parent 603
5879ecf25aa9
child 605
07074daff678

hopefully this actually fixes building with openssl < 3.0

src/server/util/hashing.c file | annotate | diff | comparison | revisions
src/server/util/hashing.h file | annotate | diff | comparison | revisions
--- a/src/server/util/hashing.c	Sun Jun 01 21:48:22 2025 +0200
+++ b/src/server/util/hashing.c	Sun Jun 01 21:50:24 2025 +0200
@@ -71,12 +71,12 @@
 #if OPENSSL_VERSION_NUMBER < 0x30000000L
 
 void ws_sha1_init(WS_SHA1_CTX *ctx) {
-    SHA256_Init(ctx);
+    SHA_Init(ctx);
     return 0;
 }
 
 void ws_sha1_update(WS_SHA1_CTX *ctx, const void *data, size_t length) {
-    SHA256_Update(ctx, data, length);
+    SHA_Update(ctx, data, length);
 }
 
 void ws_sha1_final(char *md, WS_SHA1_CTX *ctx) {
--- a/src/server/util/hashing.h	Sun Jun 01 21:48:22 2025 +0200
+++ b/src/server/util/hashing.h	Sun Jun 01 21:50:24 2025 +0200
@@ -84,7 +84,7 @@
 #define WS_USE_OPENSSL
 
 #if OPENSSL_VERSION_NUMBER < 0x30000000L
-#define WS_SHA1_CTX             SHA1_CTX
+#define WS_SHA1_CTX             SHA_CTX
 #define WS_SHA256_CTX           SHA256_CTX
 #define WS_SHA512_CTX           SHA512_CTX
 #else

mercurial