]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Application/Cryptest/Cryptest.c
CryptoPkg: Add PKCS5 PBKDF2 interface for password derivation.
[mirror_edk2.git] / CryptoPkg / Application / Cryptest / Cryptest.c
1 /** @file
2 Application for Cryptographic Primitives Validation.
3
4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "Cryptest.h"
16
17 /**
18 Entry Point of Cryptographic Validation Utility.
19
20 @param ImageHandle The image handle of the UEFI Application.
21 @param SystemTable A pointer to the EFI System Table.
22
23 @retval EFI_SUCCESS The entry point is executed successfully.
24 @retval other Some error occurs when executing this entry point.
25
26 **/
27 EFI_STATUS
28 EFIAPI
29 CryptestMain (
30 IN EFI_HANDLE ImageHandle,
31 IN EFI_SYSTEM_TABLE *SystemTable
32 )
33 {
34 EFI_STATUS Status;
35
36 Print (L"\nUEFI-OpenSSL Wrapper Cryptosystem Testing: \n");
37 Print (L"-------------------------------------------- \n");
38
39 RandomSeed (NULL, 0);
40
41 Status = ValidateCryptDigest ();
42 if (EFI_ERROR (Status)) {
43 return Status;
44 }
45
46 Status = ValidateCryptHmac ();
47 if (EFI_ERROR (Status)) {
48 return Status;
49 }
50
51 Status = ValidateCryptBlockCipher ();
52 if (EFI_ERROR (Status)) {
53 return Status;
54 }
55
56 Status = ValidateCryptRsa ();
57 if (EFI_ERROR (Status)) {
58 return Status;
59 }
60
61 Status = ValidateCryptRsa2 ();
62 if (EFI_ERROR (Status)) {
63 return Status;
64 }
65
66 Status = ValidateCryptPkcs5Pbkdf2 ();
67 if (EFI_ERROR (Status)) {
68 return Status;
69 }
70
71 Status = ValidateCryptPkcs7 ();
72 if (EFI_ERROR (Status)) {
73 return Status;
74 }
75
76 Status = ValidateAuthenticode ();
77 if (EFI_ERROR (Status)) {
78 return Status;
79 }
80
81 Status = ValidateTSCounterSignature ();
82 if (EFI_ERROR (Status)) {
83 return Status;
84 }
85
86 Status = ValidateCryptDh ();
87 if (EFI_ERROR (Status)) {
88 return Status;
89 }
90
91 Status = ValidateCryptPrng ();
92 if (EFI_ERROR (Status)) {
93 return Status;
94 }
95
96 return EFI_SUCCESS;
97 }