iPXE
config_crypto.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License as
4  * published by the Free Software Foundation; either version 2 of the
5  * License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  *
17  * You can also choose to distribute this program under the terms of
18  * the Unmodified Binary Distribution Licence (as given in the file
19  * COPYING.UBDL), provided that you have satisfied its requirements.
20  */
21 
22 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
23 
24 #include <config/crypto.h>
25 
26 /** @file
27  *
28  * Cryptographic configuration
29  *
30  * Cryptographic configuration is slightly messy since we need to drag
31  * in objects based on combinations of build options.
32  */
33 
35 
36 /* RSA */
37 #if defined ( CRYPTO_PUBKEY_RSA )
38 REQUIRE_OBJECT ( oid_rsa );
39 #endif
40 
41 /* MD4 */
42 #if defined ( CRYPTO_DIGEST_MD4 )
44 #endif
45 
46 /* MD5 */
47 #if defined ( CRYPTO_DIGEST_MD5 )
49 #endif
50 
51 /* SHA-1 */
52 #if defined ( CRYPTO_DIGEST_SHA1 )
54 #endif
55 
56 /* SHA-224 */
57 #if defined ( CRYPTO_DIGEST_SHA224 )
59 #endif
60 
61 /* SHA-256 */
62 #if defined ( CRYPTO_DIGEST_SHA256 )
64 #endif
65 
66 /* SHA-384 */
67 #if defined ( CRYPTO_DIGEST_SHA384 )
69 #endif
70 
71 /* SHA-512 */
72 #if defined ( CRYPTO_DIGEST_SHA512 )
74 #endif
75 
76 /* SHA-512/224 */
77 #if defined ( CRYPTO_DIGEST_SHA512_224 )
79 #endif
80 
81 /* SHA-512/256 */
82 #if defined ( CRYPTO_DIGEST_SHA512_256 )
84 #endif
85 
86 /* X25519 */
87 #if defined ( CRYPTO_CURVE_X25519 )
89 #endif
90 
91 /* P-256 */
92 #if defined ( CRYPTO_CURVE_P256 )
93 REQUIRE_OBJECT ( oid_p256 );
94 #endif
95 
96 /* P-384 */
97 #if defined ( CRYPTO_CURVE_P384 )
98 REQUIRE_OBJECT ( oid_p384 );
99 #endif
100 
101 /* AES-CBC */
102 #if defined ( CRYPTO_CIPHER_AES_CBC )
103 REQUIRE_OBJECT ( oid_aes_cbc );
104 #endif
105 
106 /* AES-GCM */
107 #if defined ( CRYPTO_CIPHER_AES_GCM )
108 REQUIRE_OBJECT ( oid_aes_gcm );
109 #endif
110 
111 /* RSA and MD5 */
112 #if defined ( CRYPTO_PUBKEY_RSA ) && defined ( CRYPTO_DIGEST_MD5 )
113 REQUIRE_OBJECT ( rsa_md5 );
114 #endif
115 
116 /* RSA and SHA-1 */
117 #if defined ( CRYPTO_PUBKEY_RSA ) && defined ( CRYPTO_DIGEST_SHA1 )
118 REQUIRE_OBJECT ( rsa_sha1 );
119 #endif
120 
121 /* RSA and SHA-224 */
122 #if defined ( CRYPTO_PUBKEY_RSA ) && defined ( CRYPTO_DIGEST_SHA224 )
123 REQUIRE_OBJECT ( rsa_sha224 );
124 #endif
125 
126 /* RSA and SHA-256 */
127 #if defined ( CRYPTO_PUBKEY_RSA ) && defined ( CRYPTO_DIGEST_SHA256 )
128 REQUIRE_OBJECT ( rsa_sha256 );
129 #endif
130 
131 /* RSA and SHA-384 */
132 #if defined ( CRYPTO_PUBKEY_RSA ) && defined ( CRYPTO_DIGEST_SHA384 )
133 REQUIRE_OBJECT ( rsa_sha384 );
134 #endif
135 
136 /* RSA and SHA-512 */
137 #if defined ( CRYPTO_PUBKEY_RSA ) && defined ( CRYPTO_DIGEST_SHA512 )
138 REQUIRE_OBJECT ( rsa_sha512 );
139 #endif
140 
141 /* RSA, AES-CBC, and SHA-1 */
142 #if defined ( CRYPTO_EXCHANGE_PUBKEY ) && defined ( CRYPTO_PUBKEY_RSA ) && \
143  defined ( CRYPTO_CIPHER_AES_CBC ) && defined ( CRYPTO_DIGEST_SHA1 )
144 REQUIRE_OBJECT ( rsa_aes_cbc_sha1 );
145 #endif
146 
147 /* RSA, AES-CBC, and SHA-256 */
148 #if defined ( CRYPTO_EXCHANGE_PUBKEY ) && defined ( CRYPTO_PUBKEY_RSA ) && \
149  defined ( CRYPTO_CIPHER_AES_CBC ) && defined ( CRYPTO_DIGEST_SHA256 )
150 REQUIRE_OBJECT ( rsa_aes_cbc_sha256 );
151 #endif
152 
153 /* RSA, AES-GCM, and SHA-256 */
154 #if defined ( CRYPTO_EXCHANGE_PUBKEY ) && defined ( CRYPTO_PUBKEY_RSA ) && \
155  defined ( CRYPTO_CIPHER_AES_GCM ) && defined ( CRYPTO_DIGEST_SHA256 )
156 REQUIRE_OBJECT ( rsa_aes_gcm_sha256 );
157 #endif
158 
159 /* RSA, AES-GCM, and SHA-384 */
160 #if defined ( CRYPTO_EXCHANGE_PUBKEY ) && defined ( CRYPTO_PUBKEY_RSA ) && \
161  defined ( CRYPTO_CIPHER_AES_GCM ) && defined ( CRYPTO_DIGEST_SHA384 )
162 REQUIRE_OBJECT ( rsa_aes_gcm_sha384 );
163 #endif
164 
165 /* DHE, RSA, AES-CBC, and SHA-1 */
166 #if defined ( CRYPTO_EXCHANGE_DHE ) && defined ( CRYPTO_PUBKEY_RSA ) && \
167  defined ( CRYPTO_CIPHER_AES_CBC ) && defined ( CRYPTO_DIGEST_SHA1 )
168 REQUIRE_OBJECT ( dhe_rsa_aes_cbc_sha1 );
169 #endif
170 
171 /* DHE, RSA, AES-CBC, and SHA-256 */
172 #if defined ( CRYPTO_EXCHANGE_DHE ) && defined ( CRYPTO_PUBKEY_RSA ) && \
173  defined ( CRYPTO_CIPHER_AES_CBC ) && defined ( CRYPTO_DIGEST_SHA256 )
174 REQUIRE_OBJECT ( dhe_rsa_aes_cbc_sha256 );
175 #endif
176 
177 /* DHE, RSA, AES-GCM, and SHA-256 */
178 #if defined ( CRYPTO_EXCHANGE_DHE ) && defined ( CRYPTO_PUBKEY_RSA ) && \
179  defined ( CRYPTO_CIPHER_AES_GCM ) && defined ( CRYPTO_DIGEST_SHA256 )
180 REQUIRE_OBJECT ( dhe_rsa_aes_gcm_sha256 );
181 #endif
182 
183 /* DHE, RSA, AES-GCM, and SHA-384 */
184 #if defined ( CRYPTO_EXCHANGE_DHE ) && defined ( CRYPTO_PUBKEY_RSA ) && \
185  defined ( CRYPTO_CIPHER_AES_GCM ) && defined ( CRYPTO_DIGEST_SHA384 )
186 REQUIRE_OBJECT ( dhe_rsa_aes_gcm_sha384 );
187 #endif
188 
189 /* ECDHE, RSA, AES-CBC, and SHA-1 */
190 #if defined ( CRYPTO_EXCHANGE_ECDHE ) && defined ( CRYPTO_PUBKEY_RSA ) && \
191  defined ( CRYPTO_CIPHER_AES_CBC ) && defined ( CRYPTO_DIGEST_SHA1 )
192 REQUIRE_OBJECT ( ecdhe_rsa_aes_cbc_sha1 );
193 #endif
194 
195 /* ECDHE, RSA, AES-CBC, and SHA-256 */
196 #if defined ( CRYPTO_EXCHANGE_ECDHE ) && defined ( CRYPTO_PUBKEY_RSA ) && \
197  defined ( CRYPTO_CIPHER_AES_CBC ) && defined ( CRYPTO_DIGEST_SHA256 )
198 REQUIRE_OBJECT ( ecdhe_rsa_aes_cbc_sha256 );
199 #endif
200 
201 /* ECDHE, RSA, AES-CBC, and SHA-384 */
202 #if defined ( CRYPTO_EXCHANGE_ECDHE ) && defined ( CRYPTO_PUBKEY_RSA ) && \
203  defined ( CRYPTO_CIPHER_AES_CBC ) && defined ( CRYPTO_DIGEST_SHA384 )
204 REQUIRE_OBJECT ( ecdhe_rsa_aes_cbc_sha384 );
205 #endif
206 
207 /* ECDHE, RSA, AES-GCM, and SHA-256 */
208 #if defined ( CRYPTO_EXCHANGE_ECDHE ) && defined ( CRYPTO_PUBKEY_RSA ) && \
209  defined ( CRYPTO_CIPHER_AES_GCM ) && defined ( CRYPTO_DIGEST_SHA256 )
210 REQUIRE_OBJECT ( ecdhe_rsa_aes_gcm_sha256 );
211 #endif
212 
213 /* ECDHE, RSA, AES-GCM, and SHA-384 */
214 #if defined ( CRYPTO_EXCHANGE_ECDHE ) && defined ( CRYPTO_PUBKEY_RSA ) && \
215  defined ( CRYPTO_CIPHER_AES_GCM ) && defined ( CRYPTO_DIGEST_SHA384 )
216 REQUIRE_OBJECT ( ecdhe_rsa_aes_gcm_sha384 );
217 #endif
static uint8_t oid_sha1[]
"sha1" object identifier
Definition: oid_sha1.c:30
static uint8_t oid_md4[]
"md4" object identifier
Definition: oid_md4.c:30
static uint8_t oid_sha512[]
"sha512" object identifier
Definition: oid_sha512.c:30
#define REQUIRE_OBJECT(object)
Require an object.
Definition: compiler.h:202
PROVIDE_REQUIRING_SYMBOL()
static uint8_t oid_x25519[]
"x25519" object identifier
Definition: oid_x25519.c:32
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static uint8_t oid_sha224[]
"sha224" object identifier
Definition: oid_sha224.c:30
static uint8_t oid_sha384[]
"sha384" object identifier
Definition: oid_sha384.c:30
static uint8_t oid_sha512_224[]
"sha512_224" object identifier
Cryptographic configuration.
static uint8_t oid_sha256[]
"sha256" object identifier
Definition: oid_sha256.c:30
static uint8_t oid_md5[]
"md5" object identifier
Definition: oid_md5.c:30
static uint8_t oid_sha512_256[]
"sha512_256" object identifier