teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
Blob Blame History Raw
From f7b73ede98fe971ba28def1af4f3e4ab1fc20c6c Mon Sep 17 00:00:00 2001
From: Grigori Goronzy <greg@chown.ath.cx>
Date: Sat, 12 Mar 2022 00:51:21 +0100
Subject: [PATCH] hmac/sha256: move size define to sha256.h

(cherry picked from commit e560cf4f71bf237019d982603af3d6be86394788)

Related: #2087652
---
 src/basic/hmac.h         | 2 +-
 src/fundamental/sha256.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/basic/hmac.h b/src/basic/hmac.h
index a5682c439f..e58c1838a3 100644
--- a/src/basic/hmac.h
+++ b/src/basic/hmac.h
@@ -4,7 +4,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 
-#define SHA256_DIGEST_SIZE 32
+#include "sha256.h"
 
 /* Unoptimized implementation based on FIPS 198. 'res' has to be allocated by
  * the caller. Prefer external OpenSSL functions, and use this only when
diff --git a/src/fundamental/sha256.h b/src/fundamental/sha256.h
index abc4167628..e53197f2ef 100644
--- a/src/fundamental/sha256.h
+++ b/src/fundamental/sha256.h
@@ -8,6 +8,8 @@
 
 #include "types-fundamental.h"
 
+#define SHA256_DIGEST_SIZE 32
+
 struct sha256_ctx {
         uint32_t H[8];