Commit | Line | Data |
---|---|---|
532616bb | 1 | /** @file\r |
2 | X.509 Certificate Handler Wrapper Implementation which does not provide\r | |
3 | real capabilities.\r | |
4 | \r | |
12d95665 | 5 | Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>\r |
532616bb | 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 | \r | |
18 | /**\r | |
19 | Construct a X509 object from DER-encoded certificate data.\r | |
20 | \r | |
21 | Return FALSE to indicate this interface is not supported.\r | |
22 | \r | |
23 | @param[in] Cert Pointer to the DER-encoded certificate data.\r | |
24 | @param[in] CertSize The size of certificate data in bytes.\r | |
25 | @param[out] SingleX509Cert The generated X509 object.\r | |
26 | \r | |
27 | @retval FALSE This interface is not supported.\r | |
28 | \r | |
29 | **/\r | |
30 | BOOLEAN\r | |
31 | EFIAPI\r | |
32 | X509ConstructCertificate (\r | |
33 | IN CONST UINT8 *Cert,\r | |
34 | IN UINTN CertSize,\r | |
35 | OUT UINT8 **SingleX509Cert\r | |
36 | )\r | |
37 | {\r | |
38 | ASSERT (FALSE);\r | |
39 | return FALSE;\r | |
40 | }\r | |
41 | \r | |
42 | /**\r | |
43 | Construct a X509 stack object from a list of DER-encoded certificate data.\r | |
44 | \r | |
45 | Return FALSE to indicate this interface is not supported.\r | |
46 | \r | |
952bd229 | 47 | @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.\r |
532616bb | 48 | On output, pointer to the X509 stack object with new\r |
49 | inserted X509 certificate.\r | |
50 | @param ... A list of DER-encoded single certificate data followed\r | |
51 | by certificate size. A NULL terminates the list. The\r | |
52 | pairs are the arguments to X509ConstructCertificate().\r | |
53 | \r | |
54 | @retval FALSE This interface is not supported.\r | |
55 | \r | |
56 | **/\r | |
57 | BOOLEAN\r | |
58 | EFIAPI\r | |
59 | X509ConstructCertificateStack (\r | |
60 | IN OUT UINT8 **X509Stack,\r | |
61 | ... \r | |
62 | )\r | |
63 | {\r | |
64 | ASSERT (FALSE);\r | |
65 | return FALSE;\r | |
66 | }\r | |
67 | \r | |
68 | /**\r | |
69 | Release the specified X509 object.\r | |
70 | \r | |
71 | If the interface is not supported, then ASSERT().\r | |
72 | \r | |
73 | @param[in] X509Cert Pointer to the X509 object to be released.\r | |
74 | \r | |
75 | **/\r | |
76 | VOID\r | |
77 | EFIAPI\r | |
78 | X509Free (\r | |
79 | IN VOID *X509Cert\r | |
80 | )\r | |
81 | { \r | |
82 | ASSERT (FALSE);\r | |
83 | }\r | |
84 | \r | |
85 | /**\r | |
86 | Release the specified X509 stack object.\r | |
87 | \r | |
88 | If the interface is not supported, then ASSERT().\r | |
89 | \r | |
90 | @param[in] X509Stack Pointer to the X509 stack object to be released.\r | |
91 | \r | |
92 | **/\r | |
93 | VOID\r | |
94 | EFIAPI\r | |
95 | X509StackFree (\r | |
96 | IN VOID *X509Stack\r | |
97 | )\r | |
98 | {\r | |
99 | ASSERT (FALSE);\r | |
100 | }\r | |
101 | \r | |
102 | /**\r | |
103 | Retrieve the subject bytes from one X.509 certificate.\r | |
104 | \r | |
105 | Return FALSE to indicate this interface is not supported.\r | |
106 | \r | |
107 | @param[in] Cert Pointer to the DER-encoded X509 certificate.\r | |
108 | @param[in] CertSize Size of the X509 certificate in bytes.\r | |
109 | @param[out] CertSubject Pointer to the retrieved certificate subject bytes.\r | |
110 | @param[in, out] SubjectSize The size in bytes of the CertSubject buffer on input,\r | |
111 | and the size of buffer returned CertSubject on output.\r | |
112 | \r | |
113 | \r | |
114 | @retval FALSE This interface is not supported.\r | |
115 | \r | |
116 | **/\r | |
117 | BOOLEAN\r | |
118 | EFIAPI\r | |
119 | X509GetSubjectName (\r | |
120 | IN CONST UINT8 *Cert,\r | |
121 | IN UINTN CertSize,\r | |
122 | OUT UINT8 *CertSubject,\r | |
123 | IN OUT UINTN *SubjectSize\r | |
124 | )\r | |
125 | {\r | |
126 | ASSERT (FALSE);\r | |
127 | return FALSE;\r | |
128 | }\r | |
129 | \r | |
130 | /**\r | |
131 | Retrieve the RSA Public Key from one DER-encoded X509 certificate.\r | |
132 | \r | |
133 | Return FALSE to indicate this interface is not supported.\r | |
134 | \r | |
135 | @param[in] Cert Pointer to the DER-encoded X509 certificate.\r | |
136 | @param[in] CertSize Size of the X509 certificate in bytes.\r | |
137 | @param[out] RsaContext Pointer to new-generated RSA context which contain the retrieved\r | |
138 | RSA public key component. Use RsaFree() function to free the\r | |
139 | resource.\r | |
140 | \r | |
141 | @retval FALSE This interface is not supported.\r | |
142 | \r | |
143 | **/\r | |
144 | BOOLEAN\r | |
145 | EFIAPI\r | |
146 | RsaGetPublicKeyFromX509 (\r | |
147 | IN CONST UINT8 *Cert,\r | |
148 | IN UINTN CertSize,\r | |
149 | OUT VOID **RsaContext\r | |
150 | )\r | |
151 | {\r | |
152 | ASSERT (FALSE);\r | |
153 | return FALSE;\r | |
154 | }\r | |
155 | \r | |
156 | /**\r | |
157 | Verify one X509 certificate was issued by the trusted CA.\r | |
158 | \r | |
159 | Return FALSE to indicate this interface is not supported.\r | |
160 | \r | |
161 | @param[in] Cert Pointer to the DER-encoded X509 certificate to be verified.\r | |
162 | @param[in] CertSize Size of the X509 certificate in bytes.\r | |
163 | @param[in] CACert Pointer to the DER-encoded trusted CA certificate.\r | |
164 | @param[in] CACertSize Size of the CA Certificate in bytes.\r | |
165 | \r | |
166 | @retval FALSE This interface is not supported.\r | |
167 | \r | |
168 | **/\r | |
169 | BOOLEAN\r | |
170 | EFIAPI\r | |
171 | X509VerifyCert (\r | |
172 | IN CONST UINT8 *Cert,\r | |
173 | IN UINTN CertSize,\r | |
174 | IN CONST UINT8 *CACert,\r | |
175 | IN UINTN CACertSize\r | |
176 | )\r | |
177 | {\r | |
178 | ASSERT (FALSE);\r | |
179 | return FALSE;\r | |
180 | }\r | |
12d95665 LQ |
181 | \r |
182 | /**\r | |
183 | Retrieve the TBSCertificate from one given X.509 certificate.\r | |
184 | \r | |
185 | Return FALSE to indicate this interface is not supported.\r | |
186 | \r | |
187 | @param[in] Cert Pointer to the given DER-encoded X509 certificate.\r | |
188 | @param[in] CertSize Size of the X509 certificate in bytes.\r | |
189 | @param[out] TBSCert DER-Encoded To-Be-Signed certificate.\r | |
190 | @param[out] TBSCertSize Size of the TBS certificate in bytes.\r | |
191 | \r | |
192 | @retval FALSE This interface is not supported.\r | |
193 | \r | |
194 | **/\r | |
195 | BOOLEAN\r | |
196 | EFIAPI\r | |
197 | X509GetTBSCert (\r | |
198 | IN CONST UINT8 *Cert,\r | |
199 | IN UINTN CertSize,\r | |
200 | OUT UINT8 **TBSCert,\r | |
201 | OUT UINTN *TBSCertSize\r | |
202 | )\r | |
203 | {\r | |
204 | ASSERT (FALSE);\r | |
205 | return FALSE;\r | |
206 | }\r |