]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLibNull/Pk/CryptPkcs5Pbkdf2Null.c
CryptoPkg: Add Null instance of the BaseCryptLib class
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLibNull / Pk / CryptPkcs5Pbkdf2Null.c
diff --git a/CryptoPkg/Library/BaseCryptLibNull/Pk/CryptPkcs5Pbkdf2Null.c b/CryptoPkg/Library/BaseCryptLibNull/Pk/CryptPkcs5Pbkdf2Null.c
new file mode 100644 (file)
index 0000000..7332db3
--- /dev/null
@@ -0,0 +1,48 @@
+/** @file\r
+  PBKDF2 Key Derivation Function Wrapper Implementation which does not provide real\r
+  capabilities.\r
+\r
+Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#include "InternalCryptLib.h"\r
+\r
+/**\r
+  Derives a key from a password using a salt and iteration count, based on PKCS#5 v2.0\r
+  password based encryption key derivation function PBKDF2, as specified in RFC 2898.\r
+\r
+  Return FALSE to indicate this interface is not supported.\r
+\r
+  @param[in]  PasswordLength  Length of input password in bytes.\r
+  @param[in]  Password        Pointer to the array for the password.\r
+  @param[in]  SaltLength      Size of the Salt in bytes.\r
+  @param[in]  Salt            Pointer to the Salt.\r
+  @param[in]  IterationCount  Number of iterations to perform. Its value should be\r
+                              greater than or equal to 1.\r
+  @param[in]  DigestSize      Size of the message digest to be used (eg. SHA256_DIGEST_SIZE).\r
+                              NOTE: DigestSize will be used to determine the hash algorithm.\r
+                                    Only SHA1_DIGEST_SIZE or SHA256_DIGEST_SIZE is supported.\r
+  @param[in]  KeyLength       Size of the derived key buffer in bytes.\r
+  @param[out] OutKey          Pointer to the output derived key buffer.\r
+\r
+  @retval  FALSE  This interface is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+Pkcs5HashPassword (\r
+  IN  UINTN        PasswordLength,\r
+  IN  CONST CHAR8  *Password,\r
+  IN  UINTN        SaltLength,\r
+  IN  CONST UINT8  *Salt,\r
+  IN  UINTN        IterationCount,\r
+  IN  UINTN        DigestSize,\r
+  IN  UINTN        KeyLength,\r
+  OUT UINT8        *OutKey\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r