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