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