1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/esp32_sdk/patches/0033-wpa_supplicant-add-prefix-wpa_-to-sha512_init.patch
2023-11-29 19:18:51 +01:00

63 lines
2.6 KiB
Diff

From 241861e24ad628946e3257317549a70c6f90aeec Mon Sep 17 00:00:00 2001
From: Gunar Schorcht <gunar@schorcht.net>
Date: Tue, 10 Oct 2023 17:54:52 +0200
Subject: [PATCH 33/33] wpa_supplicant: add prefix wpa_ to sha512_init
Prefix `_wpa` added to `sha512_init` function of `wpa_suppplicant` to avoid name conflicts with RIOT modules `crypto` and `hashes`.
---
components/wpa_supplicant/src/crypto/crypto_internal.c | 2 +-
components/wpa_supplicant/src/crypto/sha512-internal.c | 4 ++--
components/wpa_supplicant/src/crypto/sha512_i.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/components/wpa_supplicant/src/crypto/crypto_internal.c b/components/wpa_supplicant/src/crypto/crypto_internal.c
index d1426a8feb7..7ff588cbb40 100644
--- a/components/wpa_supplicant/src/crypto/crypto_internal.c
+++ b/components/wpa_supplicant/src/crypto/crypto_internal.c
@@ -67,7 +67,7 @@ struct crypto_hash * crypto_hash_init(enum crypto_hash_alg alg, const u8 *key,
#endif /* CONFIG_INTERNAL_SHA384 */
#ifdef CONFIG_INTERNAL_SHA512
case CRYPTO_HASH_ALG_SHA512:
- sha512_init(&ctx->u.sha512);
+ wpa_sha512_init(&ctx->u.sha512);
break;
#endif /* CONFIG_INTERNAL_SHA512 */
case CRYPTO_HASH_ALG_HMAC_MD5:
diff --git a/components/wpa_supplicant/src/crypto/sha512-internal.c b/components/wpa_supplicant/src/crypto/sha512-internal.c
index c0263941c12..1e816867faf 100644
--- a/components/wpa_supplicant/src/crypto/sha512-internal.c
+++ b/components/wpa_supplicant/src/crypto/sha512-internal.c
@@ -27,7 +27,7 @@ int sha512_vector(size_t num_elem, const u8 *addr[], const size_t *len,
struct sha512_state ctx;
size_t i;
- sha512_init(&ctx);
+ wpa_sha512_init(&ctx);
for (i = 0; i < num_elem; i++)
if (sha512_process(&ctx, addr[i], len[i]))
return -1;
@@ -161,7 +161,7 @@ static int sha512_compress(struct sha512_state *md, unsigned char *buf)
@param md The hash state you wish to initialize
@return CRYPT_OK if successful
*/
-void sha512_init(struct sha512_state *md)
+void wpa_sha512_init(struct sha512_state *md)
{
md->curlen = 0;
md->length = 0;
diff --git a/components/wpa_supplicant/src/crypto/sha512_i.h b/components/wpa_supplicant/src/crypto/sha512_i.h
index 108958911ef..e451e48fcfd 100644
--- a/components/wpa_supplicant/src/crypto/sha512_i.h
+++ b/components/wpa_supplicant/src/crypto/sha512_i.h
@@ -17,7 +17,7 @@ struct sha512_state {
u8 buf[SHA512_BLOCK_SIZE];
};
-void sha512_init(struct sha512_state *md);
+void wpa_sha512_init(struct sha512_state *md);
int sha512_process(struct sha512_state *md, const unsigned char *in,
unsigned long inlen);
int sha512_done(struct sha512_state *md, unsigned char *out);
--
2.34.1