]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptRsaExtNull.c
Add interfaces to several library instances of BaseCryptLib.
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLibRuntimeCryptProtocol / Pk / CryptRsaExtNull.c
diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptRsaExtNull.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptRsaExtNull.c
new file mode 100644 (file)
index 0000000..e44cdde
--- /dev/null
@@ -0,0 +1,125 @@
+/** @file\r
+  RSA Asymmetric Cipher Wrapper Implementation over OpenSSL.\r
+\r
+  This file does not provide real capabilities for following APIs in RSA handling:\r
+  1) RsaGetKey\r
+  2) RsaGenerateKey\r
+  3) RsaCheckKey\r
+  4) RsaPkcs1Sign\r
+\r
+Copyright (c) 2009 - 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
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "InternalCryptLib.h"\r
+\r
+/**\r
+  Gets the tag-designated RSA key component from the established RSA context.\r
+\r
+  Return FALSE to indicate this interface is not supported.\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[out]      BigNumber   Pointer to octet integer buffer.\r
+  @param[in, out]  BnSize      On input, the size of big number buffer in bytes.\r
+                               On output, the size of data returned in big number buffer in bytes.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+RsaGetKey (\r
+  IN OUT  VOID         *RsaContext,\r
+  IN      RSA_KEY_TAG  KeyTag,\r
+  OUT     UINT8        *BigNumber,\r
+  IN OUT  UINTN        *BnSize\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Generates RSA key components.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[in, out]  RsaContext           Pointer to RSA context being set.\r
+  @param[in]       ModulusLength        Length of RSA modulus N in bits.\r
+  @param[in]       PublicExponent       Pointer to RSA public exponent.\r
+  @param[in]       PublicExponentSize   Size of RSA public exponent buffer in bytes. \r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+RsaGenerateKey (\r
+  IN OUT  VOID         *RsaContext,\r
+  IN      UINTN        ModulusLength,\r
+  IN      CONST UINT8  *PublicExponent,\r
+  IN      UINTN        PublicExponentSize\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Validates key components of RSA context.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[in]  RsaContext  Pointer to RSA context to check.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+RsaCheckKey (\r
+  IN  VOID  *RsaContext\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Carries out the RSA-SSA signature generation with EMSA-PKCS1-v1_5 encoding scheme.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[in]       RsaContext   Pointer to RSA context for signature generation.\r
+  @param[in]       MessageHash  Pointer to octet message hash to be signed.\r
+  @param[in]       HashSize     Size of the message hash in bytes.\r
+  @param[out]      Signature    Pointer to buffer to receive RSA PKCS1-v1_5 signature.\r
+  @param[in, out]  SigSize      On input, the size of Signature buffer in bytes.\r
+                                On output, the size of data returned in Signature buffer in bytes.\r
+\r
+  @retval FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+RsaPkcs1Sign (\r
+  IN      VOID         *RsaContext,\r
+  IN      CONST UINT8  *MessageHash,\r
+  IN      UINTN        HashSize,\r
+  OUT     UINT8        *Signature,\r
+  IN OUT  UINTN        *SigSize\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+\r