]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/RuntimeDxeIpfCryptLib.c
CryptoPkg/TlsLib: rewrite TlsSetCipherList()
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLibRuntimeCryptProtocol / RuntimeDxeIpfCryptLib.c
index 2a1da855c66178d8d1134e3b539a7d1145ea70a8..9babc7e95252b00af965d70577625a297ae3f79a 100644 (file)
@@ -217,6 +217,29 @@ Sha256Init (
 }\r
 \r
 \r
+/**\r
+  Makes a copy of an existing SHA-256 context.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[in]  Sha256Context     Pointer to SHA-256 context being copied.\r
+  @param[out] NewSha256Context  Pointer to new SHA-256 context.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+Sha256Duplicate (\r
+  IN   CONST VOID  *Sha256Context,\r
+  OUT  VOID        *NewSha256Context\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+\r
 /**\r
   Performs SHA-256 digest on a data buffer of the specified length. This function can\r
   be called multiple times to compute the digest of long or discontinuous data streams.\r
@@ -277,9 +300,9 @@ Sha256Final (
 }\r
 \r
 /**\r
-  Allocates and Initializes one RSA Context for subsequent use.\r
+  Allocates and initializes one RSA context for subsequent use.\r
 \r
-  @return  Pointer to the RSA Context that has been initialized.\r
+  @return  Pointer to the RSA context that has been initialized.\r
            If the allocations fails, RsaNew() returns NULL.\r
 \r
 **/\r
@@ -297,7 +320,7 @@ RsaNew (
 }\r
 \r
 /**\r
-  Release the specified RSA Context.\r
+  Release the specified RSA context.\r
 \r
   @param[in]  RsaContext  Pointer to the RSA context to be released.\r
 \r
@@ -316,35 +339,41 @@ RsaFree (
 }\r
 \r
 /**\r
-  Sets the tag-designated RSA key component into the established RSA context from\r
-  the user-specified nonnegative integer (octet string format represented in RSA\r
-  PKCS#1).\r
+  Sets the tag-designated key component into the established RSA context.\r
+\r
+  This function sets the tag-designated RSA key component into the established\r
+  RSA context from the user-specified non-negative integer (octet string format\r
+  represented in RSA PKCS#1).\r
+  If BigNumber is NULL, then the specified key component in RSA context is cleared.\r
 \r
   If RsaContext is NULL, then return FALSE.\r
 \r
   @param[in, out]  RsaContext  Pointer to RSA context being set.\r
   @param[in]       KeyTag      Tag of RSA key component being set.\r
   @param[in]       BigNumber   Pointer to octet integer buffer.\r
-  @param[in]       BnLength    Length of big number buffer in bytes.\r
+                               If NULL, then the specified key component in RSA\r
+                               context is cleared.\r
+  @param[in]       BnSize      Size of big number buffer in bytes.\r
+                               If BigNumber is NULL, then it is ignored.\r
 \r
-  @return  TRUE   RSA key component was set successfully.\r
-  @return  FALSE  Invalid RSA key component tag.\r
+  @retval  TRUE   RSA key component was set successfully.\r
+  @retval  FALSE  Invalid RSA key component tag.\r
 \r
 **/\r
 BOOLEAN\r
 EFIAPI\r
 RsaSetKey (\r
-  IN OUT VOID         *RsaContext,\r
-  IN     RSA_KEY_TAG  KeyTag,\r
-  IN     CONST UINT8  *BigNumber,\r
-  IN     UINTN        BnLength\r
+  IN OUT  VOID         *RsaContext,\r
+  IN      RSA_KEY_TAG  KeyTag,\r
+  IN      CONST UINT8  *BigNumber,\r
+  IN      UINTN        BnSize\r
   )\r
 {\r
   if (!InternalIsCryptServiveAvailable ()) {\r
     return FALSE;\r
   }\r
 \r
-  return mCryptProtocol->RsaSetKey (RsaContext, KeyTag, BigNumber, BnLength);\r
+  return mCryptProtocol->RsaSetKey (RsaContext, KeyTag, BigNumber, BnSize);\r
 }\r
 \r
 /**\r
@@ -354,16 +383,16 @@ RsaSetKey (
   If RsaContext is NULL, then return FALSE.\r
   If MessageHash is NULL, then return FALSE.\r
   If Signature is NULL, then return FALSE.\r
-  If HashLength is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.\r
+  If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.\r
 \r
   @param[in]  RsaContext   Pointer to RSA context for signature verification.\r
   @param[in]  MessageHash  Pointer to octet message hash to be checked.\r
-  @param[in]  HashLength   Length of the message hash in bytes.\r
+  @param[in]  HashSize     Size of the message hash in bytes.\r
   @param[in]  Signature    Pointer to RSA PKCS1-v1_5 signature to be verified.\r
-  @param[in]  SigLength    Length of signature in bytes.\r
+  @param[in]  SigSize      Size of signature in bytes.\r
 \r
-  @return  TRUE   Valid signature encoded in PKCS1-v1_5.\r
-  @return  FALSE  Invalid signature or invalid RSA context.\r
+  @retval  TRUE   Valid signature encoded in PKCS1-v1_5.\r
+  @retval  FALSE  Invalid signature or invalid RSA context.\r
 \r
 **/\r
 BOOLEAN\r
@@ -371,9 +400,9 @@ EFIAPI
 RsaPkcs1Verify (\r
   IN  VOID         *RsaContext,\r
   IN  CONST UINT8  *MessageHash,\r
-  IN  UINTN        HashLength,\r
-  IN  UINT8        *Signature,\r
-  IN  UINTN        SigLength\r
+  IN  UINTN        HashSize,\r
+  IN  CONST UINT8  *Signature,\r
+  IN  UINTN        SigSize\r
   )\r
 {\r
   if (!InternalIsCryptServiveAvailable ()) {\r
@@ -383,8 +412,8 @@ RsaPkcs1Verify (
   return mCryptProtocol->RsaPkcs1Verify (\r
                            RsaContext,\r
                            MessageHash,\r
-                           HashLength,\r
+                           HashSize,\r
                            Signature,\r
-                           SigLength\r
+                           SigSize\r
                            );\r
 }\r