]>
Commit | Line | Data |
---|---|---|
a8f37449 QL |
1 | /** @file\r |
2 | PBKDF2 Key Derivation Function Wrapper Implementation which does not provide real\r | |
3 | capabilities.\r | |
4 | \r | |
5 | Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #include "InternalCryptLib.h"\r | |
17 | #include <openssl/evp.h>\r | |
18 | #include <openssl/hmac.h>\r | |
19 | \r | |
20 | /**\r | |
21 | Derives a key from a password using a salt and iteration count, based on PKCS#5 v2.0\r | |
22 | password based encryption key derivation function PBKDF2, as specified in RFC 2898.\r | |
23 | \r | |
24 | Return FALSE to indicate this interface is not supported.\r | |
25 | \r | |
26 | @param[in] PasswordLength Length of input password in bytes.\r | |
27 | @param[in] Password Pointer to the array for the password.\r | |
28 | @param[in] SaltLength Size of the Salt in bytes.\r | |
29 | @param[in] Salt Pointer to the Salt.\r | |
30 | @param[in] IterationCount Number of iterations to perform. Its value should be\r | |
31 | greater than or equal to 1.\r | |
32 | @param[in] DigestSize Size of the message digest to be used (eg. SHA256_DIGEST_SIZE).\r | |
33 | NOTE: DigestSize will be used to determine the hash algorithm.\r | |
34 | Only SHA1_DIGEST_SIZE or SHA256_DIGEST_SIZE is supported.\r | |
35 | @param[in] KeyLength Size of the derived key buffer in bytes.\r | |
36 | @param[out] OutKey Pointer to the output derived key buffer.\r | |
37 | \r | |
38 | @retval FALSE This interface is not supported.\r | |
39 | \r | |
40 | **/\r | |
41 | BOOLEAN\r | |
42 | EFIAPI\r | |
43 | Pkcs5HashPassword (\r | |
44 | IN UINTN PasswordLength,\r | |
45 | IN CONST CHAR8 *Password,\r | |
46 | IN UINTN SaltLength,\r | |
47 | IN CONST UINT8 *Salt,\r | |
48 | IN UINTN IterationCount,\r | |
49 | IN UINTN DigestSize,\r | |
50 | IN UINTN KeyLength,\r | |
51 | OUT UINT8 *OutKey\r | |
52 | )\r | |
53 | {\r | |
54 | ASSERT (FALSE);\r | |
55 | return FALSE;\r | |
56 | }\r |