summary refs log tree commit diff stats
path: root/src/common/util.c
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2022-08-28 17:59:42 +0100
committerPatrick <tingping@tingping.se>2022-08-29 13:50:03 -0500
commit46c9df18639ff0ee343d4c8ad48e845795b6ac1c (patch)
treebbc0637192b68b9370d8775cf3cddf7bf53a30da /src/common/util.c
parent20c50fd7ef6e027c0e84a5dac48b95e229f36134 (diff)
Fix various compiler warnings.
fish.c: -Wincompatible-pointer-types
fkeys.c: -Wmisleading-indentation
proto-irc.c: -Wincompatible-pointer-types
util.c: -Wdeprecated-declarations
xtext.c: -Wmaybe-uninitialized
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c
index fa0783d4..f06074fc 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1375,11 +1375,16 @@ str_sha256hash (char *string)
 	int i;
 	unsigned char hash[SHA256_DIGEST_LENGTH];
 	char buf[SHA256_DIGEST_LENGTH * 2 + 1];		/* 64 digit hash + '\0' */
+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+	SHA256 (string, strlen (string), hash);
+#else
 	SHA256_CTX sha256;
 
 	SHA256_Init (&sha256);
 	SHA256_Update (&sha256, string, strlen (string));
 	SHA256_Final (hash, &sha256);
+#endif
 
 	for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
 	{