CryptoPkg/TlsLib: Add some parameter check and clarification.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
This commit is contained in:
Jiaxin Wu 2017-12-21 13:08:31 +08:00
parent 3c06e6a9e2
commit 9c14f76bae
2 changed files with 13 additions and 1 deletions

View File

@ -523,6 +523,8 @@ TlsSetCertRevocationList (
This function returns the protocol version used by the specified TLS
connection.
If Tls is NULL, then ASSERT().
@param[in] Tls Pointer to the TLS object.
@return The protocol version of the specified TLS connection.
@ -540,6 +542,8 @@ TlsGetVersion (
This function returns the connection end (as client or as server) used by
the specified TLS connection.
If Tls is NULL, then ASSERT().
@param[in] Tls Pointer to the TLS object.
@return The connection end used by the specified TLS connection.
@ -601,6 +605,8 @@ TlsGetCurrentCompressionId (
This function returns the peer verification mode currently set in the
specified TLS connection.
If Tls is NULL, then ASSERT().
@param[in] Tls Pointer to the TLS object.
@return The verification mode set in the specified TLS connection.

View File

@ -642,6 +642,8 @@ TlsSetCertRevocationList (
This function returns the protocol version used by the specified TLS
connection.
If Tls is NULL, then ASSERT().
@param[in] Tls Pointer to the TLS object.
@return The protocol version of the specified TLS connection.
@ -668,6 +670,8 @@ TlsGetVersion (
This function returns the connection end (as client or as server) used by
the specified TLS connection.
If Tls is NULL, then ASSERT().
@param[in] Tls Pointer to the TLS object.
@return The connection end used by the specified TLS connection.
@ -761,6 +765,8 @@ TlsGetCurrentCompressionId (
This function returns the peer verification mode currently set in the
specified TLS connection.
If Tls is NULL, then ASSERT().
@param[in] Tls Pointer to the TLS object.
@return The verification mode set in the specified TLS connection.
@ -984,7 +990,7 @@ TlsGetHostPublicCert (
Cert = NULL;
TlsConn = (TLS_CONNECTION *) Tls;
if (TlsConn == NULL || TlsConn->Ssl == NULL || DataSize == NULL) {
if (TlsConn == NULL || TlsConn->Ssl == NULL || DataSize == NULL || (*DataSize != 0 && Data == NULL)) {
return EFI_INVALID_PARAMETER;
}