]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wolfSSL: Add crypto logging macros
authorJuliusz Sosinowicz <juliusz@wolfssl.com>
Wed, 8 Mar 2023 17:18:43 +0000 (18:18 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 4 Nov 2023 16:18:25 +0000 (18:18 +0200)
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
src/crypto/crypto_wolfssl.c

index 1ef6a1e9b4305ce7ab8f0797649213716c50277d..977cb8033b98fb457aa197f4239b9cdb03bc3714 100644 (file)
 #endif /* CONFIG_FIPS */
 
 
+#define LOG_WOLF_ERROR_VA(msg, ...) \
+       wpa_printf(MSG_ERROR, "wolfSSL: %s:%d " msg, \
+                  __func__, __LINE__, __VA_ARGS__)
+
+#define LOG_WOLF_ERROR(msg) \
+       LOG_WOLF_ERROR_VA("%s", (msg))
+
+#define LOG_WOLF_ERROR_FUNC(func, err) \
+       LOG_WOLF_ERROR_VA(#func " failed with err: %d %s", \
+                         (err), wc_GetErrorString(err))
+
+#define LOG_WOLF_ERROR_FUNC_NULL(func) \
+       LOG_WOLF_ERROR(#func " failed with NULL return")
+
+#define LOG_INVALID_PARAMETERS() \
+       LOG_WOLF_ERROR("invalid input parameters")
+
+
 #ifndef CONFIG_FIPS
 
 int md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)