CryptRsaExtNull.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /** @file
  2. RSA Asymmetric Cipher Wrapper Implementation over OpenSSL.
  3. This file does not provide real capabilities for following APIs in RSA handling:
  4. 1) RsaGetKey
  5. 2) RsaGenerateKey
  6. 3) RsaCheckKey
  7. 4) RsaPkcs1Sign
  8. Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
  9. SPDX-License-Identifier: BSD-2-Clause-Patent
  10. **/
  11. #include "InternalCryptLib.h"
  12. /**
  13. Gets the tag-designated RSA key component from the established RSA context.
  14. Return FALSE to indicate this interface is not supported.
  15. @param[in, out] RsaContext Pointer to RSA context being set.
  16. @param[in] KeyTag Tag of RSA key component being set.
  17. @param[out] BigNumber Pointer to octet integer buffer.
  18. @param[in, out] BnSize On input, the size of big number buffer in bytes.
  19. On output, the size of data returned in big number buffer in bytes.
  20. @retval FALSE This interface is not supported.
  21. **/
  22. BOOLEAN
  23. EFIAPI
  24. RsaGetKey (
  25. IN OUT VOID *RsaContext,
  26. IN RSA_KEY_TAG KeyTag,
  27. OUT UINT8 *BigNumber,
  28. IN OUT UINTN *BnSize
  29. )
  30. {
  31. ASSERT (FALSE);
  32. return FALSE;
  33. }
  34. /**
  35. Generates RSA key components.
  36. Return FALSE to indicate this interface is not supported.
  37. @param[in, out] RsaContext Pointer to RSA context being set.
  38. @param[in] ModulusLength Length of RSA modulus N in bits.
  39. @param[in] PublicExponent Pointer to RSA public exponent.
  40. @param[in] PublicExponentSize Size of RSA public exponent buffer in bytes.
  41. @retval FALSE This interface is not supported.
  42. **/
  43. BOOLEAN
  44. EFIAPI
  45. RsaGenerateKey (
  46. IN OUT VOID *RsaContext,
  47. IN UINTN ModulusLength,
  48. IN CONST UINT8 *PublicExponent,
  49. IN UINTN PublicExponentSize
  50. )
  51. {
  52. ASSERT (FALSE);
  53. return FALSE;
  54. }
  55. /**
  56. Validates key components of RSA context.
  57. Return FALSE to indicate this interface is not supported.
  58. @param[in] RsaContext Pointer to RSA context to check.
  59. @retval FALSE This interface is not supported.
  60. **/
  61. BOOLEAN
  62. EFIAPI
  63. RsaCheckKey (
  64. IN VOID *RsaContext
  65. )
  66. {
  67. ASSERT (FALSE);
  68. return FALSE;
  69. }
  70. /**
  71. Carries out the RSA-SSA signature generation with EMSA-PKCS1-v1_5 encoding scheme.
  72. Return FALSE to indicate this interface is not supported.
  73. @param[in] RsaContext Pointer to RSA context for signature generation.
  74. @param[in] MessageHash Pointer to octet message hash to be signed.
  75. @param[in] HashSize Size of the message hash in bytes.
  76. @param[out] Signature Pointer to buffer to receive RSA PKCS1-v1_5 signature.
  77. @param[in, out] SigSize On input, the size of Signature buffer in bytes.
  78. On output, the size of data returned in Signature buffer in bytes.
  79. @retval FALSE This interface is not supported.
  80. **/
  81. BOOLEAN
  82. EFIAPI
  83. RsaPkcs1Sign (
  84. IN VOID *RsaContext,
  85. IN CONST UINT8 *MessageHash,
  86. IN UINTN HashSize,
  87. OUT UINT8 *Signature,
  88. IN OUT UINTN *SigSize
  89. )
  90. {
  91. ASSERT (FALSE);
  92. return FALSE;
  93. }