From 411bfef50514946fdce750579365de513e6b6582 Mon Sep 17 00:00:00 2001 From: P L Sai Krishna Date: Fri, 3 Apr 2015 19:37:54 +0530 Subject: [PATCH] xilskey_v2_1: Initialised RSAKeyReadback value with zero This patch initialises RSAKeyReadback value with zero's since if RSA key is read with XSK_EFUSEPS_ENABLE_RSA_KEY_HASH as FALSE then it will return zero. Signed-off-by: P L Sai Krishna --- lib/sw_services/xilskey/src/changelog.txt | 1 + lib/sw_services/xilskey/src/include/xilskey_eps.h | 1 + lib/sw_services/xilskey/src/xilskey_eps.c | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/lib/sw_services/xilskey/src/changelog.txt b/lib/sw_services/xilskey/src/changelog.txt index 3342cd72..0599624d 100755 --- a/lib/sw_services/xilskey/src/changelog.txt +++ b/lib/sw_services/xilskey/src/changelog.txt @@ -22,5 +22,6 @@ * 2.00 hk 02/12/14 Changed makefile to remove '-p' option with mkdir. * CR#773090 * 2.1 kvn 04/01/15 Fixed warnings. CR#716453. + * 2.1 sk 04/03/15 Initialized RSAKeyReadback with Zeros CR# 829723. * ********************************************************************************/ diff --git a/lib/sw_services/xilskey/src/include/xilskey_eps.h b/lib/sw_services/xilskey/src/include/xilskey_eps.h index 2266de26..35ac7c93 100644 --- a/lib/sw_services/xilskey/src/include/xilskey_eps.h +++ b/lib/sw_services/xilskey/src/include/xilskey_eps.h @@ -50,6 +50,7 @@ * Change in API: * u32 XilSKey_EfusePs_Read(XilSKey_EPs *PsInstancePtr) * 2.00 hk 23/01/14 Changed PS efuse error codes for voltage out of range +* 2.1 sk 04/03/15 Initialized RSAKeyReadback with Zeros CR# 829723. * * *****************************************************************************/ diff --git a/lib/sw_services/xilskey/src/xilskey_eps.c b/lib/sw_services/xilskey/src/xilskey_eps.c index 702d51a8..d2e17202 100644 --- a/lib/sw_services/xilskey/src/xilskey_eps.c +++ b/lib/sw_services/xilskey/src/xilskey_eps.c @@ -44,6 +44,7 @@ * 1.00a rpoolla 04/26/13 First release * 1.02a hk 10/28/13 Added API to read status register.PR# 735957 * 2.00 hk 23/01/14 Changed PS efuse error codes for voltage out of range. +* 2.1 sk 04/03/15 Initialized RSAKeyReadback with Zeros CR# 829723. * * *****************************************************************************/ @@ -316,6 +317,7 @@ u32 XilSKey_EfusePs_Read(XilSKey_EPs *InstancePtr) u32 Status, RetValue; u32 RefClk; u32 ArmPllFDiv,ArmClkDivisor; + u32 Index; RetValue = XST_SUCCESS; @@ -324,6 +326,14 @@ u32 XilSKey_EfusePs_Read(XilSKey_EPs *InstancePtr) return XSK_EFUSEPS_ERROR_PS_STRUCT_NULL; } + /* Initializing RSAKeyReadback to Zero since when reading + * the key with XSK_EFUSEPS_ENABLE_RSA_KEY_HASH + * as FALSE it will give all zeros. + */ + for(Index = 0; Index < XSK_EFUSEPS_RSA_KEY_HASH_LEN_IN_BYTES; Index++) { + InstancePtr->RsaKeyReadback[Index] = 0; + } + /** * Extract PLL FDIV value from ARM PLL Control Register */