PBKDF2 Key Derivation Function Wrapper Implementation over OpenSSL.\r
\r
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
if ((Password == NULL) || (Salt == NULL) || (OutKey == NULL)) {\r
return FALSE;\r
}\r
+\r
if ((PasswordLength == 0) || (PasswordLength > INT_MAX) ||\r
(SaltLength == 0) || (SaltLength > INT_MAX) ||\r
(KeyLength == 0) || (KeyLength > INT_MAX) ||\r
- (IterationCount < 1) || (IterationCount > INT_MAX)) {\r
+ (IterationCount < 1) || (IterationCount > INT_MAX))\r
+ {\r
return FALSE;\r
}\r
+\r
//\r
// Make sure the digest algorithm is supported.\r
//\r
switch (DigestSize) {\r
- case SHA1_DIGEST_SIZE:\r
- HashAlg = EVP_sha1();\r
- break;\r
- case SHA256_DIGEST_SIZE:\r
- HashAlg = EVP_sha256();\r
- break;\r
- default:\r
- return FALSE;\r
- break;\r
+ case SHA1_DIGEST_SIZE:\r
+ HashAlg = EVP_sha1 ();\r
+ break;\r
+ case SHA256_DIGEST_SIZE:\r
+ HashAlg = EVP_sha256 ();\r
+ break;\r
+ default:\r
+ return FALSE;\r
+ break;\r
}\r
\r
//\r