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