This patch adds some comments for API usage clarification, and
adds one object initialization in X509ConstructCertificateStack
implementation to fix possible memory release issue.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ting Ye <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17671
6f19259b-4bc3-4df7-8a09-
765794883524
\r
/**\r
Validates key components of RSA context.\r
+ NOTE: This function performs integrity checks on all the RSA key material, so\r
+ the RSA key structure must contain all the private key data.\r
\r
This function validates key compoents of RSA context in following aspects:\r
- Whether p is a prime\r
If X509Stack is NULL, then return FALSE.\r
If this interface is not supported, then return FALSE.\r
\r
- @param[in, out] X509Stack On input, pointer to an existing X509 stack object.\r
+ @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.\r
On output, pointer to the X509 stack object with new\r
inserted X509 certificate.\r
@param ... A list of DER-encoded single certificate data followed\r
}\r
\r
/**\r
- Validates key components of RSA context.\r
+ Validates key components of RSA context. \r
+ NOTE: This function performs integrity checks on all the RSA key material, so\r
+ the RSA key structure must contain all the private key data.\r
\r
This function validates key compoents of RSA context in following aspects:\r
- Whether p is a prime\r
\r
If X509Stack is NULL, then return FALSE.\r
\r
- @param[in, out] X509Stack On input, pointer to an existing X509 stack object.\r
+ @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.\r
On output, pointer to the X509 stack object with new\r
inserted X509 certificate.\r
@param ... A list of DER-encoded single certificate data followed\r
//\r
// Construct X509 Object from the given DER-encoded certificate data.\r
//\r
+ X509Cert = NULL;\r
Status = X509ConstructCertificate (\r
(CONST UINT8 *) Cert,\r
CertSize,\r
\r
Return FALSE to indicate this interface is not supported.\r
\r
- @param[in, out] X509Stack On input, pointer to an existing X509 stack object.\r
+ @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.\r
On output, pointer to the X509 stack object with new\r
inserted X509 certificate.\r
@param ... A list of DER-encoded single certificate data followed\r
\r
Return FALSE to indicate this interface is not supported.\r
\r
- @param[in, out] X509Stack On input, pointer to an existing X509 stack object.\r
+ @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.\r
On output, pointer to the X509 stack object with new\r
inserted X509 certificate.\r
@param ... A list of DER-encoded single certificate data followed\r