CryptPkcs5Pbkdf2Null.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /** @file
  2. PBKDF2 Key Derivation Function Wrapper Implementation which does not provide real
  3. capabilities.
  4. Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #include "InternalCryptLib.h"
  8. #include <openssl/evp.h>
  9. #include <openssl/hmac.h>
  10. /**
  11. Derives a key from a password using a salt and iteration count, based on PKCS#5 v2.0
  12. password based encryption key derivation function PBKDF2, as specified in RFC 2898.
  13. Return FALSE to indicate this interface is not supported.
  14. @param[in] PasswordLength Length of input password in bytes.
  15. @param[in] Password Pointer to the array for the password.
  16. @param[in] SaltLength Size of the Salt in bytes.
  17. @param[in] Salt Pointer to the Salt.
  18. @param[in] IterationCount Number of iterations to perform. Its value should be
  19. greater than or equal to 1.
  20. @param[in] DigestSize Size of the message digest to be used (eg. SHA256_DIGEST_SIZE).
  21. NOTE: DigestSize will be used to determine the hash algorithm.
  22. Only SHA1_DIGEST_SIZE or SHA256_DIGEST_SIZE is supported.
  23. @param[in] KeyLength Size of the derived key buffer in bytes.
  24. @param[out] OutKey Pointer to the output derived key buffer.
  25. @retval FALSE This interface is not supported.
  26. **/
  27. BOOLEAN
  28. EFIAPI
  29. Pkcs5HashPassword (
  30. IN UINTN PasswordLength,
  31. IN CONST CHAR8 *Password,
  32. IN UINTN SaltLength,
  33. IN CONST UINT8 *Salt,
  34. IN UINTN IterationCount,
  35. IN UINTN DigestSize,
  36. IN UINTN KeyLength,
  37. OUT UINT8 *OutKey
  38. )
  39. {
  40. ASSERT (FALSE);
  41. return FALSE;
  42. }