sw_services:xilsecure: Removing NULL checking asserts on input buffer locations to correct assert failures

Removing NULL checking asserts for the data buffers where 0x00 is a possible
location. This will resolve the assert failures in xilsecure.

Signed-off-by: Bhavik Ameta <bameta@xilinx.com>
Acked-by: Srikanth Vemula <svemula@xilinx.com>
This commit is contained in:
Bhavik Ameta 2015-08-24 19:45:41 +05:30 committed by Nava kishore Manne
parent 48471fbde6
commit 98f41cbf14
3 changed files with 3 additions and 21 deletions

View file

@ -91,7 +91,6 @@ s32 XSecure_AesInitialize(XSecure_Aes *InstancePtr, XCsuDma *CsuDmaPtr,
/* Assert validates the input arguments */
Xil_AssertNonvoid(InstancePtr != NULL);
Xil_AssertNonvoid(CsuDmaPtr != NULL);
Xil_AssertNonvoid(Iv != NULL);
InstancePtr->BaseAddress = XSECURE_CSU_AES_BASE;
InstancePtr->CsuDmaPtr = CsuDmaPtr;
@ -278,8 +277,6 @@ void XSecure_AesEncrypt(XSecure_Aes *InstancePtr, u8 *Dst, const u8 *Src,
{
/* Assert validates the input arguments */
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(Dst != NULL);
Xil_AssertVoid(Src != NULL);
Xil_AssertVoid(Len != (u32)0x0);
u32 SssCfg = 0U;
@ -348,8 +345,6 @@ static u32 XSecure_AesDecryptBlk(XSecure_Aes *InstancePtr, u8 *Dst,
{
/* Assert validates the input arguments */
Xil_AssertNonvoid(InstancePtr != NULL);
Xil_AssertNonvoid(Dst != NULL);
Xil_AssertNonvoid(Src != NULL);
Xil_AssertNonvoid(Tag != NULL);
volatile u32 Status = 0U;
@ -557,8 +552,6 @@ u32 XSecure_AesDecrypt(XSecure_Aes *InstancePtr, u8 *Dst, const u8 *Src,
{
/* Assert validates the input arguments */
Xil_AssertNonvoid(InstancePtr != NULL);
Xil_AssertNonvoid(Dst != NULL);
Xil_AssertNonvoid(Src != NULL);
u32 SssCfg = 0x0U;
volatile u32 Status=0x0U;

View file

@ -138,7 +138,6 @@ static void XSecure_RsaWriteMem(XSecure_Rsa *InstancePtr, u32* WrData,
{
/* Assert validates the input arguments */
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(WrData != NULL);
u32 Index = 0U;
u32 DataOffset = 0U;
@ -211,7 +210,6 @@ static void XSecure_RsaGetData(XSecure_Rsa *InstancePtr, u32 *RdData)
{
/* Assert validates the input arguments */
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(RdData != NULL);
u32 Index = 0U;
u32 DataOffset = 0U;
@ -385,17 +383,11 @@ END:
* Match the decrypted data with expected data
*
* @param Signature is the pointer to RSA signature for data to be
* authenticated
* authenticated
* @param Hash is the pointer to expected hash data
* @param HashLen is the length of Hash used.
*
* @return 0 if RSA match succeeded
* 1 if character 1 of padding does not match
* 2 if character 2 of padding does not match
* 3 if FF padding scheme does not match
* 4 if character after FF padding does not match
* 5 T_padding for given SHA algorithm does not match
* 6 if the output hash does not match
* @return XST_SUCCESS if decryption was successful.
*
* @note None
*

View file

@ -116,7 +116,6 @@ void XSecure_Sha3Padd(XSecure_Sha3 *InstancePtr, u8 *Dst, u32 MsgLen)
{
/* Assert validates the input arguments */
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(Dst != NULL);
memset(Dst, 0, MsgLen);
Dst[0] = 0x1U;
@ -177,7 +176,6 @@ void XSecure_Sha3Update(XSecure_Sha3 *InstancePtr, const u8 *Data,
{
/* Asserts validate the input arguments */
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(Data != NULL);
Xil_AssertVoid(Size != (u32)0x00U);
InstancePtr->Sha3Len += Size;
@ -272,7 +270,7 @@ void XSecure_Sha3Finish(XSecure_Sha3 *InstancePtr, u8 *Hash)
* Calculate SHA-3 Digest on the given input data
*
* @param InstancePtr is a pointer to the XSecure_Sha3 instance.
* @param In is the pointer to the input data for hashing
* @param In is the pointer to the input data for hashing
* @param Size of the input data
* @param Out is the pointer to location where resulting hash will be
* written.
@ -287,7 +285,6 @@ void XSecure_Sha3Digest(XSecure_Sha3 *InstancePtr, const u8 *In, const u32 Size,
{
/* Asserts validate the input arguments */
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(In != NULL);
Xil_AssertVoid(Size != (u32)0x00U);
Xil_AssertVoid(Out != NULL);