From bb7d0dd6c3c2a902ae544f78f1cc6952723a1a19 Mon Sep 17 00:00:00 2001 From: "sangwan.kwon" Date: Thu, 14 Sep 2017 07:29:21 -0400 Subject: Replace SHA1 to SHA256 on PUK generating logic Change-Id: If7b368edbcc382587de28fdef13aabb184a2d076 Signed-off-by: sangwan.kwon --- include/SecCryptoSvc.h | 2 +- srcs/SecCryptoSvc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SecCryptoSvc.h b/include/SecCryptoSvc.h index 4d5e572..00d3c04 100644 --- a/include/SecCryptoSvc.h +++ b/include/SecCryptoSvc.h @@ -90,7 +90,7 @@ typedef enum //#define SHA1_DIGEST_VALUE_LEN 20 #define SHA256_DIGEST_VALUE_LEN 32 //#define KDF_KEYLEN 16 -#define HASH_LEN 20 +#define HASH_LEN SHA256_DIGEST_VALUE_LEN //#define SEC_KEYMGR_FEK_SIZE 16 #define CS_ERROR_NONE 0 diff --git a/srcs/SecCryptoSvc.c b/srcs/SecCryptoSvc.c index da23ed1..c839efe 100644 --- a/srcs/SecCryptoSvc.c +++ b/srcs/SecCryptoSvc.c @@ -138,7 +138,7 @@ bool SecFrameGeneratePlatformUniqueKey(unsigned int uLen, unsigned char *pCek) remain = uLen; for (i = 0; i < uLen; i += HASH_LEN) { - result = SHA1(Key, nTempLen, hashedValue); + result = SHA256(Key, nTempLen, hashedValue); nHashLen = HASH_LEN; if (!result) { -- cgit v1.2.3