]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/TlsLib/TlsConfig.c
CryptoPkg/TlsLib: Add some parameter check and clarification.
[mirror_edk2.git] / CryptoPkg / Library / TlsLib / TlsConfig.c
index 4c88229b8921492a55623393390cd4290d5c0544..2ffe58ad29a23f4389e80a01591db1c669278668 100644 (file)
@@ -642,6 +642,8 @@ TlsSetCertRevocationList (
   This function returns the protocol version used by the specified TLS\r
   connection.\r
 \r
+  If Tls is NULL, then ASSERT().\r
+\r
   @param[in]  Tls    Pointer to the TLS object.\r
 \r
   @return  The protocol version of the specified TLS connection.\r
@@ -668,6 +670,8 @@ TlsGetVersion (
   This function returns the connection end (as client or as server) used by\r
   the specified TLS connection.\r
 \r
+  If Tls is NULL, then ASSERT().\r
+\r
   @param[in]  Tls    Pointer to the TLS object.\r
 \r
   @return  The connection end used by the specified TLS connection.\r
@@ -761,6 +765,8 @@ TlsGetCurrentCompressionId (
   This function returns the peer verification mode currently set in the\r
   specified TLS connection.\r
 \r
+  If Tls is NULL, then ASSERT().\r
+\r
   @param[in]  Tls    Pointer to the TLS object.\r
 \r
   @return  The verification mode set in the specified TLS connection.\r
@@ -984,7 +990,7 @@ TlsGetHostPublicCert (
   Cert    = NULL;\r
   TlsConn = (TLS_CONNECTION *) Tls;\r
 \r
-  if (TlsConn == NULL || TlsConn->Ssl == NULL || DataSize == NULL) {\r
+  if (TlsConn == NULL || TlsConn->Ssl == NULL || DataSize == NULL || (*DataSize != 0 && Data == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r