/** @file\r
PEM (Privacy Enhanced Mail) Format Handler Wrapper Implementation over OpenSSL.\r
\r
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
RSA private key component. Use RsaFree() function to free the\r
resource.\r
\r
- If PemData is NULL, then ASSERT().\r
- If RsaContext is NULL, then ASSERT().\r
+ If PemData is NULL, then return FALSE.\r
+ If RsaContext is NULL, then return FALSE.\r
\r
@retval TRUE RSA Private Key was retrieved successfully.\r
@retval FALSE Invalid PEM key data or incorrect password.\r
BIO *PemBio;\r
\r
//\r
- // ASSERT if PemData is NULL or RsaContext is NULL.\r
+ // Check input parameters.\r
//\r
- ASSERT (PemData != NULL);\r
- ASSERT (RsaContext != NULL);\r
- ASSERT (PemSize <= INT_MAX);\r
+ if (PemData == NULL || RsaContext == NULL || PemSize > INT_MAX) {\r
+ return FALSE;\r
+ }\r
\r
Status = FALSE;\r
PemBio = NULL;\r