summaryrefslogtreecommitdiffstats
path: root/CryptoPkg/Library/BaseCryptLib/Pem
diff options
context:
space:
mode:
authorsfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>2012-03-19 05:52:16 +0000
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>2012-03-19 05:52:16 +0000
commit16d2c32c4dff7fd8b0ee19e3ba908c0121f6636e (patch)
tree08699467fc6247e7375faf2c419cfd882398ab63 /CryptoPkg/Library/BaseCryptLib/Pem
parentbd0de3963b8e09ccded4b6922d5e6f0146a2f63f (diff)
downloadedk2-16d2c32c4dff7fd8b0ee19e3ba908c0121f6636e.tar.gz
edk2-16d2c32c4dff7fd8b0ee19e3ba908c0121f6636e.tar.bz2
edk2-16d2c32c4dff7fd8b0ee19e3ba908c0121f6636e.zip
1. Remove conducting ASSERT in BaseCryptLib.
Signed-off-by: sfu5 Reviewed-by: qianouyang Reviewed-by: gdong1 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13110 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'CryptoPkg/Library/BaseCryptLib/Pem')
-rw-r--r--CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c b/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c
index 0b37adc33e..2c3a97b2c0 100644
--- a/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c
+++ b/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c
@@ -1,7 +1,7 @@
/** @file
PEM (Privacy Enhanced Mail) Format Handler Wrapper Implementation over OpenSSL.
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -60,8 +60,8 @@ PasswordCallback (
RSA private key component. Use RsaFree() function to free the
resource.
- If PemData is NULL, then ASSERT().
- If RsaContext is NULL, then ASSERT().
+ If PemData is NULL, then return FALSE.
+ If RsaContext is NULL, then return FALSE.
@retval TRUE RSA Private Key was retrieved successfully.
@retval FALSE Invalid PEM key data or incorrect password.
@@ -80,11 +80,11 @@ RsaGetPrivateKeyFromPem (
BIO *PemBio;
//
- // ASSERT if PemData is NULL or RsaContext is NULL.
+ // Check input parameters.
//
- ASSERT (PemData != NULL);
- ASSERT (RsaContext != NULL);
- ASSERT (PemSize <= INT_MAX);
+ if (PemData == NULL || RsaContext == NULL || PemSize > INT_MAX) {
+ return FALSE;
+ }
Status = FALSE;
PemBio = NULL;