/** @file\r
Common interfaces to call Security library.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
@param[in] AlgorithmId The Alogrithem identification defined in RFC.\r
@param[in] Key Pointer to the buffer containing encrypting key.\r
- @param[in} KeyBits The length of the key in bits.\r
+ @param[in] KeyBits The length of the key in bits.\r
@param[in] Ivec Point to the buffer containning the Initializeion\r
Vector (IV) data.\r
@param[in] InData Point to the buffer containing the data to be\r
\r
@param[in] AlgorithmId The Alogrithem identification defined in RFC.\r
@param[in] Key Pointer to the buffer containing encrypting key.\r
- @param[in} KeyBits The length of the key in bits.\r
+ @param[in] KeyBits The length of the key in bits.\r
@param[in] Ivec Point to the buffer containning the Initializeion\r
Vector (IV) data.\r
@param[in] InData Point to the buffer containing the data to be\r
- Decrypted.\r
+ decrypted.\r
@param[in] InDataLength The length of InData in Bytes.\r
@param[out] OutData Pointer to the buffer that receives the decryption\r
output.\r
UINTN SigSize;\r
\r
SigSize = 0;\r
+ RsaContext = NULL;\r
+\r
//\r
// Retrieve RSA Private Key from password-protected PEM data\r
//\r
\r
@param[in] InCert Pointer to the Certificate which contains the\r
public key.\r
- @param[in] InCertLen The size of Certificate in bytes.\r
+ @param[in] CertLen The size of Certificate in bytes.\r
@param[in] InCa Pointer to the CA certificate\r
@param[in] CaLen The size of CA certificate in bytes.\r
@param[in] InData Pointer to octect message hash to be checked.\r
RsaGetKey (RsaContext, RsaKeyN, NULL, PublicKeyLen);\r
\r
*PublicKey = AllocateZeroPool (*PublicKeyLen);\r
- ASSERT (*PublicKey != NULL);\r
+ if (*PublicKey == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ goto EXIT;\r
+ }\r
\r
if (!RsaGetKey (RsaContext, RsaKeyN, *PublicKey, PublicKeyLen)) {\r
Status = EFI_INVALID_PARAMETER;\r