/src/openssl/providers/implementations/encode_decode/encode_key2any.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved. |
3 | | * |
4 | | * Licensed under the Apache License 2.0 (the "License"). You may not use |
5 | | * this file except in compliance with the License. You can obtain a copy |
6 | | * in the file LICENSE in the source distribution or at |
7 | | * https://www.openssl.org/source/license.html |
8 | | */ |
9 | | |
10 | | /* |
11 | | * Low level APIs are deprecated for public use, but still ok for internal use. |
12 | | */ |
13 | | #include "internal/deprecated.h" |
14 | | |
15 | | #include <openssl/byteorder.h> |
16 | | #include <openssl/core.h> |
17 | | #include <openssl/core_dispatch.h> |
18 | | #include <openssl/core_names.h> |
19 | | #include <openssl/crypto.h> |
20 | | #include <openssl/params.h> |
21 | | #include <openssl/asn1.h> |
22 | | #include <openssl/err.h> |
23 | | #include <openssl/pem.h> |
24 | | #include <openssl/x509.h> |
25 | | #include <openssl/pkcs12.h> /* PKCS8_encrypt() */ |
26 | | #include <openssl/dh.h> |
27 | | #include <openssl/dsa.h> |
28 | | #include <openssl/ec.h> |
29 | | #include <openssl/proverr.h> |
30 | | #include "internal/passphrase.h" |
31 | | #include "internal/cryptlib.h" |
32 | | #include "crypto/ecx.h" |
33 | | #include "crypto/ml_kem.h" |
34 | | #include "crypto/rsa.h" |
35 | | #include "crypto/ml_dsa.h" |
36 | | #include "crypto/slh_dsa.h" |
37 | | #include "prov/implementations.h" |
38 | | #include "prov/bio.h" |
39 | | #include "prov/provider_ctx.h" |
40 | | #include "prov/der_rsa.h" |
41 | | #include "endecoder_local.h" |
42 | | #include "ml_dsa_codecs.h" |
43 | | #include "ml_kem_codecs.h" |
44 | | |
45 | | #if defined(OPENSSL_NO_DH) && defined(OPENSSL_NO_DSA) && defined(OPENSSL_NO_EC) |
46 | | # define OPENSSL_NO_KEYPARAMS |
47 | | #endif |
48 | | |
49 | | typedef struct key2any_ctx_st { |
50 | | PROV_CTX *provctx; |
51 | | |
52 | | /* Set to 0 if parameters should not be saved (dsa only) */ |
53 | | int save_parameters; |
54 | | |
55 | | /* Set to 1 if intending to encrypt/decrypt, otherwise 0 */ |
56 | | int cipher_intent; |
57 | | |
58 | | EVP_CIPHER *cipher; |
59 | | |
60 | | struct ossl_passphrase_data_st pwdata; |
61 | | } KEY2ANY_CTX; |
62 | | |
63 | | typedef int check_key_type_fn(const void *key, int nid); |
64 | | typedef int key_to_paramstring_fn(const void *key, int nid, int save, |
65 | | void **str, int *strtype); |
66 | | typedef int key_to_der_fn(BIO *out, const void *key, |
67 | | int key_nid, const char *pemname, |
68 | | key_to_paramstring_fn *p2s, |
69 | | OSSL_i2d_of_void_ctx *k2d, KEY2ANY_CTX *ctx); |
70 | | typedef int write_bio_of_void_fn(BIO *bp, const void *x); |
71 | | |
72 | | |
73 | | /* Free the blob allocated during key_to_paramstring_fn */ |
74 | | static void free_asn1_data(int type, void *data) |
75 | 0 | { |
76 | 0 | switch (type) { |
77 | 0 | case V_ASN1_OBJECT: |
78 | 0 | ASN1_OBJECT_free(data); |
79 | 0 | break; |
80 | 0 | case V_ASN1_SEQUENCE: |
81 | 0 | ASN1_STRING_free(data); |
82 | 0 | break; |
83 | 0 | } |
84 | 0 | } |
85 | | |
86 | | static PKCS8_PRIV_KEY_INFO *key_to_p8info(const void *key, int key_nid, |
87 | | void *params, int params_type, |
88 | | OSSL_i2d_of_void_ctx *k2d, |
89 | | KEY2ANY_CTX *ctx) |
90 | 0 | { |
91 | | /* der, derlen store the key DER output and its length */ |
92 | 0 | unsigned char *der = NULL; |
93 | 0 | int derlen; |
94 | | /* The final PKCS#8 info */ |
95 | 0 | PKCS8_PRIV_KEY_INFO *p8info = NULL; |
96 | |
|
97 | 0 | if ((p8info = PKCS8_PRIV_KEY_INFO_new()) == NULL |
98 | 0 | || (derlen = k2d(key, &der, (void *)ctx)) <= 0 |
99 | 0 | || !PKCS8_pkey_set0(p8info, OBJ_nid2obj(key_nid), 0, |
100 | 0 | params_type, params, der, derlen)) { |
101 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
102 | 0 | PKCS8_PRIV_KEY_INFO_free(p8info); |
103 | 0 | OPENSSL_free(der); |
104 | 0 | p8info = NULL; |
105 | 0 | } |
106 | |
|
107 | 0 | return p8info; |
108 | 0 | } |
109 | | |
110 | | static X509_SIG *p8info_to_encp8(PKCS8_PRIV_KEY_INFO *p8info, |
111 | | KEY2ANY_CTX *ctx) |
112 | 0 | { |
113 | 0 | X509_SIG *p8 = NULL; |
114 | 0 | char kstr[PEM_BUFSIZE]; |
115 | 0 | size_t klen = 0; |
116 | 0 | OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx); |
117 | |
|
118 | 0 | if (ctx->cipher == NULL) |
119 | 0 | return NULL; |
120 | | |
121 | 0 | if (!ossl_pw_get_passphrase(kstr, sizeof(kstr), &klen, NULL, 1, |
122 | 0 | &ctx->pwdata)) { |
123 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PASSPHRASE); |
124 | 0 | return NULL; |
125 | 0 | } |
126 | | /* First argument == -1 means "standard" */ |
127 | 0 | p8 = PKCS8_encrypt_ex(-1, ctx->cipher, kstr, klen, NULL, 0, 0, p8info, libctx, NULL); |
128 | 0 | OPENSSL_cleanse(kstr, klen); |
129 | 0 | return p8; |
130 | 0 | } |
131 | | |
132 | | static X509_SIG *key_to_encp8(const void *key, int key_nid, |
133 | | void *params, int params_type, |
134 | | OSSL_i2d_of_void_ctx *k2d, |
135 | | KEY2ANY_CTX *ctx) |
136 | 0 | { |
137 | 0 | PKCS8_PRIV_KEY_INFO *p8info = |
138 | 0 | key_to_p8info(key, key_nid, params, params_type, k2d, ctx); |
139 | 0 | X509_SIG *p8 = NULL; |
140 | |
|
141 | 0 | if (p8info == NULL) { |
142 | 0 | free_asn1_data(params_type, params); |
143 | 0 | } else { |
144 | 0 | p8 = p8info_to_encp8(p8info, ctx); |
145 | 0 | PKCS8_PRIV_KEY_INFO_free(p8info); |
146 | 0 | } |
147 | 0 | return p8; |
148 | 0 | } |
149 | | |
150 | | static X509_PUBKEY *key_to_pubkey(const void *key, int key_nid, |
151 | | void *params, int params_type, |
152 | | OSSL_i2d_of_void_ctx *k2d, |
153 | | KEY2ANY_CTX *ctx) |
154 | 0 | { |
155 | | /* der, derlen store the key DER output and its length */ |
156 | 0 | unsigned char *der = NULL; |
157 | 0 | int derlen; |
158 | | /* The final X509_PUBKEY */ |
159 | 0 | X509_PUBKEY *xpk = NULL; |
160 | | |
161 | |
|
162 | 0 | if ((xpk = X509_PUBKEY_new()) == NULL |
163 | 0 | || (derlen = k2d(key, &der, (void *)ctx)) <= 0 |
164 | 0 | || !X509_PUBKEY_set0_param(xpk, OBJ_nid2obj(key_nid), |
165 | 0 | params_type, params, der, derlen)) { |
166 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_X509_LIB); |
167 | 0 | X509_PUBKEY_free(xpk); |
168 | 0 | OPENSSL_free(der); |
169 | 0 | xpk = NULL; |
170 | 0 | } |
171 | |
|
172 | 0 | return xpk; |
173 | 0 | } |
174 | | |
175 | | /* |
176 | | * key_to_epki_* produce encoded output with the private key data in a |
177 | | * EncryptedPrivateKeyInfo structure (defined by PKCS#8). They require |
178 | | * that there's an intent to encrypt, anything else is an error. |
179 | | * |
180 | | * key_to_pki_* primarily produce encoded output with the private key data |
181 | | * in a PrivateKeyInfo structure (also defined by PKCS#8). However, if |
182 | | * there is an intent to encrypt the data, the corresponding key_to_epki_* |
183 | | * function is used instead. |
184 | | * |
185 | | * key_to_spki_* produce encoded output with the public key data in an |
186 | | * X.509 SubjectPublicKeyInfo. |
187 | | * |
188 | | * Key parameters don't have any defined envelopment of this kind, but are |
189 | | * included in some manner in the output from the functions described above, |
190 | | * either in the AlgorithmIdentifier's parameter field, or as part of the |
191 | | * key data itself. |
192 | | */ |
193 | | |
194 | | static int key_to_epki_der_priv_bio(BIO *out, const void *key, |
195 | | int key_nid, |
196 | | ossl_unused const char *pemname, |
197 | | key_to_paramstring_fn *p2s, |
198 | | OSSL_i2d_of_void_ctx *k2d, |
199 | | KEY2ANY_CTX *ctx) |
200 | 0 | { |
201 | 0 | int ret = 0; |
202 | 0 | void *str = NULL; |
203 | 0 | int strtype = V_ASN1_UNDEF; |
204 | 0 | X509_SIG *p8; |
205 | |
|
206 | 0 | if (!ctx->cipher_intent) |
207 | 0 | return 0; |
208 | | |
209 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
210 | 0 | &str, &strtype)) |
211 | 0 | return 0; |
212 | | |
213 | 0 | p8 = key_to_encp8(key, key_nid, str, strtype, k2d, ctx); |
214 | 0 | if (p8 != NULL) |
215 | 0 | ret = i2d_PKCS8_bio(out, p8); |
216 | |
|
217 | 0 | X509_SIG_free(p8); |
218 | |
|
219 | 0 | return ret; |
220 | 0 | } |
221 | | |
222 | | static int key_to_epki_pem_priv_bio(BIO *out, const void *key, |
223 | | int key_nid, |
224 | | ossl_unused const char *pemname, |
225 | | key_to_paramstring_fn *p2s, |
226 | | OSSL_i2d_of_void_ctx *k2d, |
227 | | KEY2ANY_CTX *ctx) |
228 | 0 | { |
229 | 0 | int ret = 0; |
230 | 0 | void *str = NULL; |
231 | 0 | int strtype = V_ASN1_UNDEF; |
232 | 0 | X509_SIG *p8; |
233 | |
|
234 | 0 | if (!ctx->cipher_intent) |
235 | 0 | return 0; |
236 | | |
237 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
238 | 0 | &str, &strtype)) |
239 | 0 | return 0; |
240 | | |
241 | 0 | p8 = key_to_encp8(key, key_nid, str, strtype, k2d, ctx); |
242 | 0 | if (p8 != NULL) |
243 | 0 | ret = PEM_write_bio_PKCS8(out, p8); |
244 | |
|
245 | 0 | X509_SIG_free(p8); |
246 | |
|
247 | 0 | return ret; |
248 | 0 | } |
249 | | |
250 | | static int key_to_pki_der_priv_bio(BIO *out, const void *key, |
251 | | int key_nid, |
252 | | ossl_unused const char *pemname, |
253 | | key_to_paramstring_fn *p2s, |
254 | | OSSL_i2d_of_void_ctx *k2d, |
255 | | KEY2ANY_CTX *ctx) |
256 | 0 | { |
257 | 0 | int ret = 0; |
258 | 0 | void *str = NULL; |
259 | 0 | int strtype = V_ASN1_UNDEF; |
260 | 0 | PKCS8_PRIV_KEY_INFO *p8info; |
261 | |
|
262 | 0 | if (ctx->cipher_intent) |
263 | 0 | return key_to_epki_der_priv_bio(out, key, key_nid, pemname, |
264 | 0 | p2s, k2d, ctx); |
265 | | |
266 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
267 | 0 | &str, &strtype)) |
268 | 0 | return 0; |
269 | | |
270 | 0 | p8info = key_to_p8info(key, key_nid, str, strtype, k2d, ctx); |
271 | |
|
272 | 0 | if (p8info != NULL) |
273 | 0 | ret = i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8info); |
274 | 0 | else |
275 | 0 | free_asn1_data(strtype, str); |
276 | |
|
277 | 0 | PKCS8_PRIV_KEY_INFO_free(p8info); |
278 | |
|
279 | 0 | return ret; |
280 | 0 | } |
281 | | |
282 | | static int key_to_pki_pem_priv_bio(BIO *out, const void *key, |
283 | | int key_nid, |
284 | | ossl_unused const char *pemname, |
285 | | key_to_paramstring_fn *p2s, |
286 | | OSSL_i2d_of_void_ctx *k2d, |
287 | | KEY2ANY_CTX *ctx) |
288 | 0 | { |
289 | 0 | int ret = 0; |
290 | 0 | void *str = NULL; |
291 | 0 | int strtype = V_ASN1_UNDEF; |
292 | 0 | PKCS8_PRIV_KEY_INFO *p8info; |
293 | |
|
294 | 0 | if (ctx->cipher_intent) |
295 | 0 | return key_to_epki_pem_priv_bio(out, key, key_nid, pemname, |
296 | 0 | p2s, k2d, ctx); |
297 | | |
298 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
299 | 0 | &str, &strtype)) |
300 | 0 | return 0; |
301 | | |
302 | 0 | p8info = key_to_p8info(key, key_nid, str, strtype, k2d, ctx); |
303 | |
|
304 | 0 | if (p8info != NULL) |
305 | 0 | ret = PEM_write_bio_PKCS8_PRIV_KEY_INFO(out, p8info); |
306 | 0 | else |
307 | 0 | free_asn1_data(strtype, str); |
308 | |
|
309 | 0 | PKCS8_PRIV_KEY_INFO_free(p8info); |
310 | |
|
311 | 0 | return ret; |
312 | 0 | } |
313 | | |
314 | | static int key_to_spki_der_pub_bio(BIO *out, const void *key, |
315 | | int key_nid, |
316 | | ossl_unused const char *pemname, |
317 | | key_to_paramstring_fn *p2s, |
318 | | OSSL_i2d_of_void_ctx *k2d, |
319 | | KEY2ANY_CTX *ctx) |
320 | 0 | { |
321 | 0 | int ret = 0; |
322 | 0 | void *str = NULL; |
323 | 0 | int strtype = V_ASN1_UNDEF; |
324 | 0 | X509_PUBKEY *xpk = NULL; |
325 | |
|
326 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
327 | 0 | &str, &strtype)) |
328 | 0 | return 0; |
329 | | |
330 | 0 | xpk = key_to_pubkey(key, key_nid, str, strtype, k2d, ctx); |
331 | |
|
332 | 0 | if (xpk != NULL) |
333 | 0 | ret = i2d_X509_PUBKEY_bio(out, xpk); |
334 | | |
335 | | /* Also frees |str| */ |
336 | 0 | X509_PUBKEY_free(xpk); |
337 | 0 | return ret; |
338 | 0 | } |
339 | | |
340 | | static int key_to_spki_pem_pub_bio(BIO *out, const void *key, |
341 | | int key_nid, |
342 | | ossl_unused const char *pemname, |
343 | | key_to_paramstring_fn *p2s, |
344 | | OSSL_i2d_of_void_ctx *k2d, |
345 | | KEY2ANY_CTX *ctx) |
346 | 0 | { |
347 | 0 | int ret = 0; |
348 | 0 | void *str = NULL; |
349 | 0 | int strtype = V_ASN1_UNDEF; |
350 | 0 | X509_PUBKEY *xpk = NULL; |
351 | |
|
352 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
353 | 0 | &str, &strtype)) |
354 | 0 | return 0; |
355 | | |
356 | 0 | xpk = key_to_pubkey(key, key_nid, str, strtype, k2d, ctx); |
357 | |
|
358 | 0 | if (xpk != NULL) |
359 | 0 | ret = PEM_write_bio_X509_PUBKEY(out, xpk); |
360 | 0 | else |
361 | 0 | free_asn1_data(strtype, str); |
362 | | |
363 | | /* Also frees |str| */ |
364 | 0 | X509_PUBKEY_free(xpk); |
365 | 0 | return ret; |
366 | 0 | } |
367 | | |
368 | | /* |
369 | | * key_to_type_specific_* produce encoded output with type specific key data, |
370 | | * no envelopment; the same kind of output as the type specific i2d_ and |
371 | | * PEM_write_ functions, which is often a simple SEQUENCE of INTEGER. |
372 | | * |
373 | | * OpenSSL tries to discourage production of new keys in this form, because |
374 | | * of the ambiguity when trying to recognise them, but can't deny that PKCS#1 |
375 | | * et al still are live standards. |
376 | | * |
377 | | * Note that these functions completely ignore p2s, and rather rely entirely |
378 | | * on k2d to do the complete work. |
379 | | */ |
380 | | static int key_to_type_specific_der_bio(BIO *out, const void *key, |
381 | | int key_nid, |
382 | | ossl_unused const char *pemname, |
383 | | key_to_paramstring_fn *p2s, |
384 | | OSSL_i2d_of_void_ctx *k2d, |
385 | | KEY2ANY_CTX *ctx) |
386 | 0 | { |
387 | 0 | unsigned char *der = NULL; |
388 | 0 | int derlen; |
389 | 0 | int ret; |
390 | |
|
391 | 0 | if ((derlen = k2d(key, &der, (void *)ctx)) <= 0) { |
392 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PROV_LIB); |
393 | 0 | return 0; |
394 | 0 | } |
395 | | |
396 | 0 | ret = BIO_write(out, der, derlen); |
397 | 0 | OPENSSL_free(der); |
398 | 0 | return ret > 0; |
399 | 0 | } |
400 | 0 | #define key_to_type_specific_der_priv_bio key_to_type_specific_der_bio |
401 | 0 | #define key_to_type_specific_der_pub_bio key_to_type_specific_der_bio |
402 | 0 | #define key_to_type_specific_der_param_bio key_to_type_specific_der_bio |
403 | | |
404 | | static int key_to_type_specific_pem_bio_cb(BIO *out, const void *key, |
405 | | int key_nid, const char *pemname, |
406 | | key_to_paramstring_fn *p2s, |
407 | | OSSL_i2d_of_void_ctx *k2d, |
408 | | KEY2ANY_CTX *ctx, |
409 | | pem_password_cb *cb, void *cbarg) |
410 | 0 | { |
411 | 0 | return PEM_ASN1_write_bio_ctx(k2d, (void *)ctx, pemname, out, key, |
412 | 0 | ctx->cipher, NULL, 0, cb, cbarg) > 0; |
413 | 0 | } |
414 | | |
415 | | static int key_to_type_specific_pem_priv_bio(BIO *out, const void *key, |
416 | | int key_nid, const char *pemname, |
417 | | key_to_paramstring_fn *p2s, |
418 | | OSSL_i2d_of_void_ctx *k2d, |
419 | | KEY2ANY_CTX *ctx) |
420 | 0 | { |
421 | 0 | return key_to_type_specific_pem_bio_cb(out, key, key_nid, pemname, |
422 | 0 | p2s, k2d, ctx, |
423 | 0 | ossl_pw_pem_password, &ctx->pwdata); |
424 | 0 | } |
425 | | |
426 | | static int key_to_type_specific_pem_pub_bio(BIO *out, const void *key, |
427 | | int key_nid, const char *pemname, |
428 | | key_to_paramstring_fn *p2s, |
429 | | OSSL_i2d_of_void_ctx *k2d, |
430 | | KEY2ANY_CTX *ctx) |
431 | 0 | { |
432 | 0 | return key_to_type_specific_pem_bio_cb(out, key, key_nid, pemname, |
433 | 0 | p2s, k2d, ctx, NULL, NULL); |
434 | 0 | } |
435 | | |
436 | | #ifndef OPENSSL_NO_KEYPARAMS |
437 | | static int key_to_type_specific_pem_param_bio(BIO *out, const void *key, |
438 | | int key_nid, const char *pemname, |
439 | | key_to_paramstring_fn *p2s, |
440 | | OSSL_i2d_of_void_ctx *k2d, |
441 | | KEY2ANY_CTX *ctx) |
442 | 0 | { |
443 | 0 | return key_to_type_specific_pem_bio_cb(out, key, key_nid, pemname, |
444 | 0 | p2s, k2d, ctx, NULL, NULL); |
445 | 0 | } |
446 | | #endif |
447 | | |
448 | | /* ---------------------------------------------------------------------- */ |
449 | | |
450 | | #define k2d_NOCTX(n, f) \ |
451 | | static int \ |
452 | | n##_k2d(const void *key, unsigned char **pder, \ |
453 | | ossl_unused void *ctx) \ |
454 | 0 | { \ |
455 | 0 | return f(key, pder); \ |
456 | 0 | } Unexecuted instantiation: encode_key2any.c:rsa_prv_k2d Unexecuted instantiation: encode_key2any.c:rsa_pub_k2d Unexecuted instantiation: encode_key2any.c:dsa_prv_k2d Unexecuted instantiation: encode_key2any.c:dsa_pub_k2d Unexecuted instantiation: encode_key2any.c:dsa_param_k2d Unexecuted instantiation: encode_key2any.c:ec_prv_k2d Unexecuted instantiation: encode_key2any.c:ec_param_k2d |
457 | | |
458 | | /* ---------------------------------------------------------------------- */ |
459 | | |
460 | | #ifndef OPENSSL_NO_DH |
461 | | static int prepare_dh_params(const void *dh, int nid, int save, |
462 | | void **pstr, int *pstrtype) |
463 | 0 | { |
464 | 0 | ASN1_STRING *params = ASN1_STRING_new(); |
465 | |
|
466 | 0 | if (params == NULL) { |
467 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
468 | 0 | return 0; |
469 | 0 | } |
470 | | |
471 | 0 | if (nid == EVP_PKEY_DHX) |
472 | 0 | params->length = i2d_DHxparams(dh, ¶ms->data); |
473 | 0 | else |
474 | 0 | params->length = i2d_DHparams(dh, ¶ms->data); |
475 | |
|
476 | 0 | if (params->length <= 0) { |
477 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
478 | 0 | ASN1_STRING_free(params); |
479 | 0 | return 0; |
480 | 0 | } |
481 | 0 | params->type = V_ASN1_SEQUENCE; |
482 | |
|
483 | 0 | *pstr = params; |
484 | 0 | *pstrtype = V_ASN1_SEQUENCE; |
485 | 0 | return 1; |
486 | 0 | } |
487 | | |
488 | | static int dh_spki_pub_to_der(const void *dh, unsigned char **pder, |
489 | | ossl_unused void *ctx) |
490 | 0 | { |
491 | 0 | const BIGNUM *bn = NULL; |
492 | 0 | ASN1_INTEGER *pub_key = NULL; |
493 | 0 | int ret; |
494 | |
|
495 | 0 | if ((bn = DH_get0_pub_key(dh)) == NULL) { |
496 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY); |
497 | 0 | return 0; |
498 | 0 | } |
499 | 0 | if ((pub_key = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) { |
500 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_BN_ERROR); |
501 | 0 | return 0; |
502 | 0 | } |
503 | | |
504 | 0 | ret = i2d_ASN1_INTEGER(pub_key, pder); |
505 | |
|
506 | 0 | ASN1_STRING_clear_free(pub_key); |
507 | 0 | return ret; |
508 | 0 | } |
509 | | |
510 | | static int dh_pki_priv_to_der(const void *dh, unsigned char **pder, |
511 | | ossl_unused void *ctx) |
512 | 0 | { |
513 | 0 | const BIGNUM *bn = NULL; |
514 | 0 | ASN1_INTEGER *priv_key = NULL; |
515 | 0 | int ret; |
516 | |
|
517 | 0 | if ((bn = DH_get0_priv_key(dh)) == NULL) { |
518 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY); |
519 | 0 | return 0; |
520 | 0 | } |
521 | 0 | if ((priv_key = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) { |
522 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_BN_ERROR); |
523 | 0 | return 0; |
524 | 0 | } |
525 | | |
526 | 0 | ret = i2d_ASN1_INTEGER(priv_key, pder); |
527 | |
|
528 | 0 | ASN1_STRING_clear_free(priv_key); |
529 | 0 | return ret; |
530 | 0 | } |
531 | | |
532 | 0 | # define dh_epki_priv_to_der dh_pki_priv_to_der |
533 | | |
534 | | static int |
535 | | dh_type_specific_params_to_der(const void *dh, unsigned char **pder, |
536 | | ossl_unused void *ctx) |
537 | 0 | { |
538 | 0 | if (DH_test_flags(dh, DH_FLAG_TYPE_DHX)) |
539 | 0 | return i2d_DHxparams(dh, pder); |
540 | 0 | return i2d_DHparams(dh, pder); |
541 | 0 | } |
542 | | |
543 | | /* |
544 | | * DH doesn't have i2d_DHPrivateKey or i2d_DHPublicKey, so we can't make |
545 | | * corresponding functions here. |
546 | | */ |
547 | | # define dh_type_specific_priv_to_der NULL |
548 | | # define dh_type_specific_pub_to_der NULL |
549 | | |
550 | | static int dh_check_key_type(const void *dh, int expected_type) |
551 | 0 | { |
552 | 0 | int type = |
553 | 0 | DH_test_flags(dh, DH_FLAG_TYPE_DHX) ? EVP_PKEY_DHX : EVP_PKEY_DH; |
554 | |
|
555 | 0 | return type == expected_type; |
556 | 0 | } |
557 | | |
558 | 0 | # define dh_evp_type EVP_PKEY_DH |
559 | 0 | # define dhx_evp_type EVP_PKEY_DHX |
560 | 0 | # define dh_pem_type "DH" |
561 | 0 | # define dhx_pem_type "X9.42 DH" |
562 | | #endif |
563 | | |
564 | | /* ---------------------------------------------------------------------- */ |
565 | | |
566 | | #ifndef OPENSSL_NO_DSA |
567 | | static int encode_dsa_params(const void *dsa, int nid, |
568 | | void **pstr, int *pstrtype) |
569 | 0 | { |
570 | 0 | ASN1_STRING *params = ASN1_STRING_new(); |
571 | |
|
572 | 0 | if (params == NULL) { |
573 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
574 | 0 | return 0; |
575 | 0 | } |
576 | | |
577 | 0 | params->length = i2d_DSAparams(dsa, ¶ms->data); |
578 | |
|
579 | 0 | if (params->length <= 0) { |
580 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
581 | 0 | ASN1_STRING_free(params); |
582 | 0 | return 0; |
583 | 0 | } |
584 | | |
585 | 0 | *pstrtype = V_ASN1_SEQUENCE; |
586 | 0 | *pstr = params; |
587 | 0 | return 1; |
588 | 0 | } |
589 | | |
590 | | static int prepare_dsa_params(const void *dsa, int nid, int save, |
591 | | void **pstr, int *pstrtype) |
592 | 0 | { |
593 | 0 | const BIGNUM *p = DSA_get0_p(dsa); |
594 | 0 | const BIGNUM *q = DSA_get0_q(dsa); |
595 | 0 | const BIGNUM *g = DSA_get0_g(dsa); |
596 | |
|
597 | 0 | if (save && p != NULL && q != NULL && g != NULL) |
598 | 0 | return encode_dsa_params(dsa, nid, pstr, pstrtype); |
599 | | |
600 | 0 | *pstr = NULL; |
601 | 0 | *pstrtype = V_ASN1_UNDEF; |
602 | 0 | return 1; |
603 | 0 | } |
604 | | |
605 | | static int dsa_spki_pub_to_der(const void *dsa, unsigned char **pder, |
606 | | ossl_unused void *ctx) |
607 | 0 | { |
608 | 0 | const BIGNUM *bn = NULL; |
609 | 0 | ASN1_INTEGER *pub_key = NULL; |
610 | 0 | int ret; |
611 | |
|
612 | 0 | if ((bn = DSA_get0_pub_key(dsa)) == NULL) { |
613 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY); |
614 | 0 | return 0; |
615 | 0 | } |
616 | 0 | if ((pub_key = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) { |
617 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_BN_ERROR); |
618 | 0 | return 0; |
619 | 0 | } |
620 | | |
621 | 0 | ret = i2d_ASN1_INTEGER(pub_key, pder); |
622 | |
|
623 | 0 | ASN1_STRING_clear_free(pub_key); |
624 | 0 | return ret; |
625 | 0 | } |
626 | | |
627 | | static int dsa_pki_priv_to_der(const void *dsa, unsigned char **pder, |
628 | | ossl_unused void *ctx) |
629 | 0 | { |
630 | 0 | const BIGNUM *bn = NULL; |
631 | 0 | ASN1_INTEGER *priv_key = NULL; |
632 | 0 | int ret; |
633 | |
|
634 | 0 | if ((bn = DSA_get0_priv_key(dsa)) == NULL) { |
635 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY); |
636 | 0 | return 0; |
637 | 0 | } |
638 | 0 | if ((priv_key = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) { |
639 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_BN_ERROR); |
640 | 0 | return 0; |
641 | 0 | } |
642 | | |
643 | 0 | ret = i2d_ASN1_INTEGER(priv_key, pder); |
644 | |
|
645 | 0 | ASN1_STRING_clear_free(priv_key); |
646 | 0 | return ret; |
647 | 0 | } |
648 | | |
649 | | k2d_NOCTX(dsa_prv, i2d_DSAPrivateKey) |
650 | | k2d_NOCTX(dsa_pub, i2d_DSAPublicKey) |
651 | | k2d_NOCTX(dsa_param, i2d_DSAparams) |
652 | | |
653 | 0 | # define dsa_epki_priv_to_der dsa_pki_priv_to_der |
654 | | |
655 | 0 | # define dsa_type_specific_priv_to_der dsa_prv_k2d |
656 | 0 | # define dsa_type_specific_pub_to_der dsa_pub_k2d |
657 | 0 | # define dsa_type_specific_params_to_der dsa_param_k2d |
658 | | |
659 | 0 | # define dsa_check_key_type NULL |
660 | 0 | # define dsa_evp_type EVP_PKEY_DSA |
661 | 0 | # define dsa_pem_type "DSA" |
662 | | #endif |
663 | | |
664 | | /* ---------------------------------------------------------------------- */ |
665 | | |
666 | | #ifndef OPENSSL_NO_EC |
667 | | static int prepare_ec_explicit_params(const void *eckey, |
668 | | void **pstr, int *pstrtype) |
669 | 0 | { |
670 | 0 | ASN1_STRING *params = ASN1_STRING_new(); |
671 | |
|
672 | 0 | if (params == NULL) { |
673 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
674 | 0 | return 0; |
675 | 0 | } |
676 | | |
677 | 0 | params->length = i2d_ECParameters(eckey, ¶ms->data); |
678 | 0 | if (params->length <= 0) { |
679 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
680 | 0 | ASN1_STRING_free(params); |
681 | 0 | return 0; |
682 | 0 | } |
683 | | |
684 | 0 | *pstrtype = V_ASN1_SEQUENCE; |
685 | 0 | *pstr = params; |
686 | 0 | return 1; |
687 | 0 | } |
688 | | |
689 | | /* |
690 | | * This implements EcpkParameters, where the CHOICE is based on whether there |
691 | | * is a curve name (curve nid) to be found or not. See RFC 3279 for details. |
692 | | */ |
693 | | static int prepare_ec_params(const void *eckey, int nid, int save, |
694 | | void **pstr, int *pstrtype) |
695 | 0 | { |
696 | 0 | int curve_nid; |
697 | 0 | const EC_GROUP *group = EC_KEY_get0_group(eckey); |
698 | 0 | ASN1_OBJECT *params = NULL; |
699 | |
|
700 | 0 | if (group == NULL) |
701 | 0 | return 0; |
702 | 0 | curve_nid = EC_GROUP_get_curve_name(group); |
703 | 0 | if (curve_nid != NID_undef) { |
704 | 0 | params = OBJ_nid2obj(curve_nid); |
705 | 0 | if (params == NULL) |
706 | 0 | return 0; |
707 | 0 | } |
708 | | |
709 | 0 | if (curve_nid != NID_undef |
710 | 0 | && (EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE)) { |
711 | | /* The CHOICE came to namedCurve */ |
712 | 0 | if (OBJ_length(params) == 0) { |
713 | | /* Some curves might not have an associated OID */ |
714 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_OID); |
715 | 0 | ASN1_OBJECT_free(params); |
716 | 0 | return 0; |
717 | 0 | } |
718 | 0 | *pstr = params; |
719 | 0 | *pstrtype = V_ASN1_OBJECT; |
720 | 0 | return 1; |
721 | 0 | } else { |
722 | | /* The CHOICE came to ecParameters */ |
723 | 0 | return prepare_ec_explicit_params(eckey, pstr, pstrtype); |
724 | 0 | } |
725 | 0 | } |
726 | | |
727 | | static int ec_spki_pub_to_der(const void *eckey, unsigned char **pder, |
728 | | ossl_unused void *ctx) |
729 | 0 | { |
730 | 0 | if (EC_KEY_get0_public_key(eckey) == NULL) { |
731 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY); |
732 | 0 | return 0; |
733 | 0 | } |
734 | 0 | return i2o_ECPublicKey(eckey, pder); |
735 | 0 | } |
736 | | |
737 | | static int ec_pki_priv_to_der(const void *veckey, unsigned char **pder, |
738 | | ossl_unused void *ctx) |
739 | 0 | { |
740 | 0 | EC_KEY *eckey = (EC_KEY *)veckey; |
741 | 0 | unsigned int old_flags; |
742 | 0 | int ret = 0; |
743 | | |
744 | | /* |
745 | | * For PKCS8 the curve name appears in the PKCS8_PRIV_KEY_INFO object |
746 | | * as the pkeyalg->parameter field. (For a named curve this is an OID) |
747 | | * The pkey field is an octet string that holds the encoded |
748 | | * ECPrivateKey SEQUENCE with the optional parameters field omitted. |
749 | | * We omit this by setting the EC_PKEY_NO_PARAMETERS flag. |
750 | | */ |
751 | 0 | old_flags = EC_KEY_get_enc_flags(eckey); /* save old flags */ |
752 | 0 | EC_KEY_set_enc_flags(eckey, old_flags | EC_PKEY_NO_PARAMETERS); |
753 | 0 | ret = i2d_ECPrivateKey(eckey, pder); |
754 | 0 | EC_KEY_set_enc_flags(eckey, old_flags); /* restore old flags */ |
755 | 0 | return ret; /* return the length of the der encoded data */ |
756 | 0 | } |
757 | | |
758 | | k2d_NOCTX(ec_param, i2d_ECParameters) |
759 | | k2d_NOCTX(ec_prv, i2d_ECPrivateKey) |
760 | | |
761 | 0 | # define ec_epki_priv_to_der ec_pki_priv_to_der |
762 | | |
763 | 0 | # define ec_type_specific_params_to_der ec_param_k2d |
764 | | /* No ec_type_specific_pub_to_der, there simply is no such thing */ |
765 | 0 | # define ec_type_specific_priv_to_der ec_prv_k2d |
766 | | |
767 | 0 | # define ec_check_key_type NULL |
768 | 0 | # define ec_evp_type EVP_PKEY_EC |
769 | 0 | # define ec_pem_type "EC" |
770 | | |
771 | | # ifndef OPENSSL_NO_SM2 |
772 | | /* |
773 | | * Albeit SM2 is a slightly different algorithm than ECDSA, the key type |
774 | | * encoding (in all places where an AlgorithmIdentifier is produced, such |
775 | | * as PrivateKeyInfo and SubjectPublicKeyInfo) is the same as for ECC keys |
776 | | * according to the example in GM/T 0015-2012, appendix D.2. |
777 | | * This leaves the distinction of SM2 keys to the EC group (which is found |
778 | | * in AlgorithmIdentified.params). |
779 | | */ |
780 | 0 | # define sm2_evp_type ec_evp_type |
781 | 0 | # define sm2_pem_type "SM2" |
782 | | # endif |
783 | | #endif |
784 | | |
785 | | /* ---------------------------------------------------------------------- */ |
786 | | |
787 | | #ifndef OPENSSL_NO_ECX |
788 | 0 | # define prepare_ecx_params NULL |
789 | | |
790 | | static int ecx_spki_pub_to_der(const void *vecxkey, unsigned char **pder, |
791 | | ossl_unused void *ctx) |
792 | 0 | { |
793 | 0 | const ECX_KEY *ecxkey = vecxkey; |
794 | 0 | unsigned char *keyblob; |
795 | |
|
796 | 0 | if (ecxkey == NULL) { |
797 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); |
798 | 0 | return 0; |
799 | 0 | } |
800 | | |
801 | 0 | keyblob = OPENSSL_memdup(ecxkey->pubkey, ecxkey->keylen); |
802 | 0 | if (keyblob == NULL) |
803 | 0 | return 0; |
804 | | |
805 | 0 | *pder = keyblob; |
806 | 0 | return ecxkey->keylen; |
807 | 0 | } |
808 | | |
809 | | static int ecx_pki_priv_to_der(const void *vecxkey, unsigned char **pder, |
810 | | ossl_unused void *ctx) |
811 | 0 | { |
812 | 0 | const ECX_KEY *ecxkey = vecxkey; |
813 | 0 | ASN1_OCTET_STRING oct; |
814 | 0 | int keybloblen; |
815 | |
|
816 | 0 | if (ecxkey == NULL || ecxkey->privkey == NULL) { |
817 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); |
818 | 0 | return 0; |
819 | 0 | } |
820 | | |
821 | 0 | oct.data = ecxkey->privkey; |
822 | 0 | oct.length = ecxkey->keylen; |
823 | 0 | oct.flags = 0; |
824 | |
|
825 | 0 | keybloblen = i2d_ASN1_OCTET_STRING(&oct, pder); |
826 | 0 | if (keybloblen < 0) { |
827 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
828 | 0 | return 0; |
829 | 0 | } |
830 | | |
831 | 0 | return keybloblen; |
832 | 0 | } |
833 | | |
834 | 0 | # define ecx_epki_priv_to_der ecx_pki_priv_to_der |
835 | | |
836 | | /* |
837 | | * ED25519, ED448, X25519 and X448 only has PKCS#8 / SubjectPublicKeyInfo |
838 | | * representation, so we don't define ecx_type_specific_[priv,pub,params]_to_der. |
839 | | */ |
840 | | |
841 | 0 | # define ecx_check_key_type NULL |
842 | | |
843 | 0 | # define ed25519_evp_type EVP_PKEY_ED25519 |
844 | 0 | # define ed448_evp_type EVP_PKEY_ED448 |
845 | 0 | # define x25519_evp_type EVP_PKEY_X25519 |
846 | 0 | # define x448_evp_type EVP_PKEY_X448 |
847 | 0 | # define ed25519_pem_type "ED25519" |
848 | 0 | # define ed448_pem_type "ED448" |
849 | 0 | # define x25519_pem_type "X25519" |
850 | 0 | # define x448_pem_type "X448" |
851 | | #endif |
852 | | |
853 | | /* ---------------------------------------------------------------------- */ |
854 | | |
855 | | #ifndef OPENSSL_NO_ML_DSA |
856 | | static int ml_dsa_spki_pub_to_der(const void *vkey, unsigned char **pder, |
857 | | ossl_unused void *ctx) |
858 | 0 | { |
859 | 0 | return ossl_ml_dsa_i2d_pubkey(vkey, pder); |
860 | 0 | } |
861 | | |
862 | | static int ml_dsa_pki_priv_to_der(const void *vkey, unsigned char **pder, |
863 | | void *vctx) |
864 | 0 | { |
865 | 0 | KEY2ANY_CTX *ctx = vctx; |
866 | |
|
867 | 0 | return ossl_ml_dsa_i2d_prvkey(vkey, pder, ctx->provctx); |
868 | 0 | } |
869 | | |
870 | 0 | # define ml_dsa_epki_priv_to_der ml_dsa_pki_priv_to_der |
871 | 0 | # define prepare_ml_dsa_params NULL |
872 | 0 | # define ml_dsa_check_key_type NULL |
873 | | |
874 | 0 | # define ml_dsa_44_evp_type EVP_PKEY_ML_DSA_44 |
875 | 0 | # define ml_dsa_44_pem_type "ML-DSA-44" |
876 | 0 | # define ml_dsa_65_evp_type EVP_PKEY_ML_DSA_65 |
877 | 0 | # define ml_dsa_65_pem_type "ML-DSA-65" |
878 | 0 | # define ml_dsa_87_evp_type EVP_PKEY_ML_DSA_87 |
879 | 0 | # define ml_dsa_87_pem_type "ML-DSA-87" |
880 | | #endif /* OPENSSL_NO_ML_DSA */ |
881 | | |
882 | | /* ---------------------------------------------------------------------- */ |
883 | | |
884 | | #ifndef OPENSSL_NO_ML_KEM |
885 | | |
886 | | static int ml_kem_spki_pub_to_der(const void *vkey, unsigned char **pder, |
887 | | ossl_unused void *ctx) |
888 | 0 | { |
889 | 0 | return ossl_ml_kem_i2d_pubkey(vkey, pder); |
890 | 0 | } |
891 | | |
892 | | static int ml_kem_pki_priv_to_der(const void *vkey, unsigned char **pder, |
893 | | void *vctx) |
894 | 0 | { |
895 | 0 | KEY2ANY_CTX *ctx = vctx; |
896 | |
|
897 | 0 | return ossl_ml_kem_i2d_prvkey(vkey, pder, ctx->provctx); |
898 | 0 | } |
899 | | |
900 | 0 | # define ml_kem_epki_priv_to_der ml_kem_pki_priv_to_der |
901 | 0 | # define prepare_ml_kem_params NULL |
902 | 0 | # define ml_kem_check_key_type NULL |
903 | | |
904 | 0 | # define ml_kem_512_evp_type EVP_PKEY_ML_KEM_512 |
905 | 0 | # define ml_kem_512_pem_type "ML-KEM-512" |
906 | 0 | # define ml_kem_768_evp_type EVP_PKEY_ML_KEM_768 |
907 | 0 | # define ml_kem_768_pem_type "ML-KEM-768" |
908 | 0 | # define ml_kem_1024_evp_type EVP_PKEY_ML_KEM_1024 |
909 | 0 | # define ml_kem_1024_pem_type "ML-KEM-1024" |
910 | | #endif |
911 | | |
912 | | /* ---------------------------------------------------------------------- */ |
913 | | |
914 | | /* |
915 | | * Helper functions to prepare RSA-PSS params for encoding. We would |
916 | | * have simply written the whole AlgorithmIdentifier, but existing libcrypto |
917 | | * functionality doesn't allow that. |
918 | | */ |
919 | | |
920 | | static int prepare_rsa_params(const void *rsa, int nid, int save, |
921 | | void **pstr, int *pstrtype) |
922 | 0 | { |
923 | 0 | const RSA_PSS_PARAMS_30 *pss = ossl_rsa_get0_pss_params_30((RSA *)rsa); |
924 | |
|
925 | 0 | *pstr = NULL; |
926 | |
|
927 | 0 | switch (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK)) { |
928 | 0 | case RSA_FLAG_TYPE_RSA: |
929 | | /* If plain RSA, the parameters shall be NULL */ |
930 | 0 | *pstrtype = V_ASN1_NULL; |
931 | 0 | return 1; |
932 | 0 | case RSA_FLAG_TYPE_RSASSAPSS: |
933 | 0 | if (ossl_rsa_pss_params_30_is_unrestricted(pss)) { |
934 | 0 | *pstrtype = V_ASN1_UNDEF; |
935 | 0 | return 1; |
936 | 0 | } else { |
937 | 0 | ASN1_STRING *astr = NULL; |
938 | 0 | WPACKET pkt; |
939 | 0 | unsigned char *str = NULL; |
940 | 0 | size_t str_sz = 0; |
941 | 0 | int i; |
942 | |
|
943 | 0 | for (i = 0; i < 2; i++) { |
944 | 0 | switch (i) { |
945 | 0 | case 0: |
946 | 0 | if (!WPACKET_init_null_der(&pkt)) |
947 | 0 | goto err; |
948 | 0 | break; |
949 | 0 | case 1: |
950 | 0 | if ((str = OPENSSL_malloc(str_sz)) == NULL |
951 | 0 | || !WPACKET_init_der(&pkt, str, str_sz)) { |
952 | 0 | WPACKET_cleanup(&pkt); |
953 | 0 | goto err; |
954 | 0 | } |
955 | 0 | break; |
956 | 0 | } |
957 | 0 | if (!ossl_DER_w_RSASSA_PSS_params(&pkt, -1, pss) |
958 | 0 | || !WPACKET_finish(&pkt) |
959 | 0 | || !WPACKET_get_total_written(&pkt, &str_sz)) { |
960 | 0 | WPACKET_cleanup(&pkt); |
961 | 0 | goto err; |
962 | 0 | } |
963 | 0 | WPACKET_cleanup(&pkt); |
964 | | |
965 | | /* |
966 | | * If no PSS parameters are going to be written, there's no |
967 | | * point going for another iteration. |
968 | | * This saves us from getting |str| allocated just to have it |
969 | | * immediately de-allocated. |
970 | | */ |
971 | 0 | if (str_sz == 0) |
972 | 0 | break; |
973 | 0 | } |
974 | | |
975 | 0 | if ((astr = ASN1_STRING_new()) == NULL) |
976 | 0 | goto err; |
977 | 0 | *pstrtype = V_ASN1_SEQUENCE; |
978 | 0 | ASN1_STRING_set0(astr, str, (int)str_sz); |
979 | 0 | *pstr = astr; |
980 | |
|
981 | 0 | return 1; |
982 | 0 | err: |
983 | 0 | OPENSSL_free(str); |
984 | 0 | return 0; |
985 | 0 | } |
986 | 0 | } |
987 | | |
988 | | /* Currently unsupported RSA key type */ |
989 | 0 | return 0; |
990 | 0 | } |
991 | | |
992 | | k2d_NOCTX(rsa_prv, i2d_RSAPrivateKey) |
993 | | k2d_NOCTX(rsa_pub, i2d_RSAPublicKey) |
994 | | |
995 | | /* |
996 | | * RSA is extremely simple, as PKCS#1 is used for the PKCS#8 |privateKey| |
997 | | * field as well as the SubjectPublicKeyInfo |subjectPublicKey| field. |
998 | | */ |
999 | 0 | #define rsa_pki_priv_to_der rsa_type_specific_priv_to_der |
1000 | 0 | #define rsa_epki_priv_to_der rsa_type_specific_priv_to_der |
1001 | 0 | #define rsa_spki_pub_to_der rsa_type_specific_pub_to_der |
1002 | 0 | #define rsa_type_specific_priv_to_der rsa_prv_k2d |
1003 | 0 | #define rsa_type_specific_pub_to_der rsa_pub_k2d |
1004 | | #define rsa_type_specific_params_to_der NULL |
1005 | | |
1006 | | static int rsa_check_key_type(const void *rsa, int expected_type) |
1007 | 0 | { |
1008 | 0 | switch (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK)) { |
1009 | 0 | case RSA_FLAG_TYPE_RSA: |
1010 | 0 | return expected_type == EVP_PKEY_RSA; |
1011 | 0 | case RSA_FLAG_TYPE_RSASSAPSS: |
1012 | 0 | return expected_type == EVP_PKEY_RSA_PSS; |
1013 | 0 | } |
1014 | | |
1015 | | /* Currently unsupported RSA key type */ |
1016 | 0 | return EVP_PKEY_NONE; |
1017 | 0 | } |
1018 | | |
1019 | 0 | #define rsa_evp_type EVP_PKEY_RSA |
1020 | 0 | #define rsapss_evp_type EVP_PKEY_RSA_PSS |
1021 | 0 | #define rsa_pem_type "RSA" |
1022 | 0 | #define rsapss_pem_type "RSA-PSS" |
1023 | | |
1024 | | /* ---------------------------------------------------------------------- */ |
1025 | | |
1026 | | #ifndef OPENSSL_NO_SLH_DSA |
1027 | 0 | # define prepare_slh_dsa_params NULL |
1028 | | |
1029 | | static int slh_dsa_spki_pub_to_der(const void *vkey, unsigned char **pder, |
1030 | | ossl_unused void *ctx) |
1031 | 0 | { |
1032 | 0 | const SLH_DSA_KEY *key = vkey; |
1033 | 0 | uint8_t *key_blob; |
1034 | 0 | size_t key_len; |
1035 | |
|
1036 | 0 | if (key == NULL) { |
1037 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); |
1038 | 0 | return 0; |
1039 | 0 | } |
1040 | 0 | key_len = ossl_slh_dsa_key_get_pub_len(key); |
1041 | 0 | key_blob = OPENSSL_memdup(ossl_slh_dsa_key_get_pub(key), key_len); |
1042 | 0 | if (key_blob == NULL) |
1043 | 0 | return 0; |
1044 | | |
1045 | 0 | *pder = key_blob; |
1046 | 0 | return key_len; |
1047 | 0 | } |
1048 | | |
1049 | | static int slh_dsa_pki_priv_to_der(const void *vkey, unsigned char **pder, |
1050 | | ossl_unused void *ctx) |
1051 | 0 | { |
1052 | 0 | const SLH_DSA_KEY *key = vkey; |
1053 | 0 | size_t len; |
1054 | |
|
1055 | 0 | if (ossl_slh_dsa_key_get_priv(key) == NULL) { |
1056 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); |
1057 | 0 | return 0; |
1058 | 0 | } |
1059 | 0 | len = ossl_slh_dsa_key_get_priv_len(key); |
1060 | |
|
1061 | 0 | if (pder != NULL |
1062 | 0 | && ((*pder = OPENSSL_memdup(ossl_slh_dsa_key_get_priv(key), len)) == NULL)) |
1063 | 0 | return 0; |
1064 | | |
1065 | 0 | return len; |
1066 | 0 | } |
1067 | 0 | # define slh_dsa_epki_priv_to_der slh_dsa_pki_priv_to_der |
1068 | | |
1069 | | /* SLH_DSA only has PKCS#8 / SubjectPublicKeyInfo representations. */ |
1070 | | |
1071 | 0 | # define slh_dsa_check_key_type NULL |
1072 | 0 | # define slh_dsa_sha2_128s_evp_type EVP_PKEY_SLH_DSA_SHA2_128S |
1073 | 0 | # define slh_dsa_sha2_128f_evp_type EVP_PKEY_SLH_DSA_SHA2_128F |
1074 | 0 | # define slh_dsa_sha2_192s_evp_type EVP_PKEY_SLH_DSA_SHA2_192S |
1075 | 0 | # define slh_dsa_sha2_192f_evp_type EVP_PKEY_SLH_DSA_SHA2_192F |
1076 | 0 | # define slh_dsa_sha2_256s_evp_type EVP_PKEY_SLH_DSA_SHA2_256S |
1077 | 0 | # define slh_dsa_sha2_256f_evp_type EVP_PKEY_SLH_DSA_SHA2_256F |
1078 | 0 | # define slh_dsa_shake_128s_evp_type EVP_PKEY_SLH_DSA_SHAKE_128S |
1079 | 0 | # define slh_dsa_shake_128f_evp_type EVP_PKEY_SLH_DSA_SHAKE_128F |
1080 | 0 | # define slh_dsa_shake_192s_evp_type EVP_PKEY_SLH_DSA_SHAKE_192S |
1081 | 0 | # define slh_dsa_shake_192f_evp_type EVP_PKEY_SLH_DSA_SHAKE_192F |
1082 | 0 | # define slh_dsa_shake_256s_evp_type EVP_PKEY_SLH_DSA_SHAKE_256S |
1083 | 0 | # define slh_dsa_shake_256f_evp_type EVP_PKEY_SLH_DSA_SHAKE_256F |
1084 | | # define slh_dsa_sha2_128s_input_type "SLH-DSA-SHA2-128s" |
1085 | | # define slh_dsa_sha2_128f_input_type "SLH-DSA-SHA2-128f" |
1086 | | # define slh_dsa_sha2_192s_input_type "SLH-DSA-SHA2-192s" |
1087 | | # define slh_dsa_sha2_192f_input_type "SLH-DSA-SHA2-192f" |
1088 | | # define slh_dsa_sha2_256s_input_type "SLH-DSA-SHA2-256s" |
1089 | | # define slh_dsa_sha2_256f_input_type "SLH-DSA-SHA2-256f" |
1090 | | # define slh_dsa_shake_128s_input_type "SLH-DSA-SHAKE-128s" |
1091 | | # define slh_dsa_shake_128f_input_type "SLH-DSA-SHAKE-128f" |
1092 | | # define slh_dsa_shake_192s_input_type "SLH-DSA-SHAKE-192s" |
1093 | | # define slh_dsa_shake_192f_input_type "SLH-DSA-SHAKE-192f" |
1094 | | # define slh_dsa_shake_256s_input_type "SLH-DSA-SHAKE-256s" |
1095 | | # define slh_dsa_shake_256f_input_type "SLH-DSA-SHAKE-256f" |
1096 | 0 | # define slh_dsa_sha2_128s_pem_type "SLH-DSA-SHA2-128s" |
1097 | 0 | # define slh_dsa_sha2_128f_pem_type "SLH-DSA-SHA2-128f" |
1098 | 0 | # define slh_dsa_sha2_192s_pem_type "SLH-DSA-SHA2-192s" |
1099 | 0 | # define slh_dsa_sha2_192f_pem_type "SLH-DSA-SHA2-192f" |
1100 | 0 | # define slh_dsa_sha2_256s_pem_type "SLH-DSA-SHA2-256s" |
1101 | 0 | # define slh_dsa_sha2_256f_pem_type "SLH-DSA-SHA2-256f" |
1102 | 0 | # define slh_dsa_shake_128s_pem_type "SLH-DSA-SHAKE-128s" |
1103 | 0 | # define slh_dsa_shake_128f_pem_type "SLH-DSA-SHAKE-128f" |
1104 | 0 | # define slh_dsa_shake_192s_pem_type "SLH-DSA-SHAKE-192s" |
1105 | 0 | # define slh_dsa_shake_192f_pem_type "SLH-DSA-SHAKE-192f" |
1106 | 0 | # define slh_dsa_shake_256s_pem_type "SLH-DSA-SHAKE-256s" |
1107 | 0 | # define slh_dsa_shake_256f_pem_type "SLH-DSA-SHAKE-256f" |
1108 | | #endif /* OPENSSL_NO_SLH_DSA */ |
1109 | | |
1110 | | /* ---------------------------------------------------------------------- */ |
1111 | | |
1112 | | static OSSL_FUNC_decoder_newctx_fn key2any_newctx; |
1113 | | static OSSL_FUNC_decoder_freectx_fn key2any_freectx; |
1114 | | |
1115 | | static void *key2any_newctx(void *provctx) |
1116 | 0 | { |
1117 | 0 | KEY2ANY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx)); |
1118 | |
|
1119 | 0 | if (ctx != NULL) { |
1120 | 0 | ctx->provctx = provctx; |
1121 | 0 | ctx->save_parameters = 1; |
1122 | 0 | } |
1123 | |
|
1124 | 0 | return ctx; |
1125 | 0 | } |
1126 | | |
1127 | | static void key2any_freectx(void *vctx) |
1128 | 0 | { |
1129 | 0 | KEY2ANY_CTX *ctx = vctx; |
1130 | |
|
1131 | 0 | ossl_pw_clear_passphrase_data(&ctx->pwdata); |
1132 | 0 | EVP_CIPHER_free(ctx->cipher); |
1133 | 0 | OPENSSL_free(ctx); |
1134 | 0 | } |
1135 | | |
1136 | | static const OSSL_PARAM *key2any_settable_ctx_params(ossl_unused void *provctx) |
1137 | 0 | { |
1138 | 0 | static const OSSL_PARAM settables[] = { |
1139 | 0 | OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_CIPHER, NULL, 0), |
1140 | 0 | OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_PROPERTIES, NULL, 0), |
1141 | 0 | OSSL_PARAM_END, |
1142 | 0 | }; |
1143 | |
|
1144 | 0 | return settables; |
1145 | 0 | } |
1146 | | |
1147 | | static int key2any_set_ctx_params(void *vctx, const OSSL_PARAM params[]) |
1148 | 0 | { |
1149 | 0 | KEY2ANY_CTX *ctx = vctx; |
1150 | 0 | OSSL_LIB_CTX *libctx = ossl_prov_ctx_get0_libctx(ctx->provctx); |
1151 | 0 | const OSSL_PARAM *cipherp = |
1152 | 0 | OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_CIPHER); |
1153 | 0 | const OSSL_PARAM *propsp = |
1154 | 0 | OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_PROPERTIES); |
1155 | 0 | const OSSL_PARAM *save_paramsp = |
1156 | 0 | OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_SAVE_PARAMETERS); |
1157 | |
|
1158 | 0 | if (cipherp != NULL) { |
1159 | 0 | const char *ciphername = NULL; |
1160 | 0 | const char *props = NULL; |
1161 | |
|
1162 | 0 | if (!OSSL_PARAM_get_utf8_string_ptr(cipherp, &ciphername)) |
1163 | 0 | return 0; |
1164 | 0 | if (propsp != NULL && !OSSL_PARAM_get_utf8_string_ptr(propsp, &props)) |
1165 | 0 | return 0; |
1166 | | |
1167 | 0 | EVP_CIPHER_free(ctx->cipher); |
1168 | 0 | ctx->cipher = NULL; |
1169 | 0 | ctx->cipher_intent = ciphername != NULL; |
1170 | 0 | if (ciphername != NULL |
1171 | 0 | && ((ctx->cipher = |
1172 | 0 | EVP_CIPHER_fetch(libctx, ciphername, props)) == NULL)) |
1173 | 0 | return 0; |
1174 | 0 | } |
1175 | | |
1176 | 0 | if (save_paramsp != NULL) { |
1177 | 0 | if (!OSSL_PARAM_get_int(save_paramsp, &ctx->save_parameters)) |
1178 | 0 | return 0; |
1179 | 0 | } |
1180 | 0 | return 1; |
1181 | 0 | } |
1182 | | |
1183 | | static int key2any_check_selection(int selection, int selection_mask) |
1184 | 0 | { |
1185 | | /* |
1186 | | * The selections are kinda sorta "levels", i.e. each selection given |
1187 | | * here is assumed to include those following. |
1188 | | */ |
1189 | 0 | int checks[] = { |
1190 | 0 | OSSL_KEYMGMT_SELECT_PRIVATE_KEY, |
1191 | 0 | OSSL_KEYMGMT_SELECT_PUBLIC_KEY, |
1192 | 0 | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS |
1193 | 0 | }; |
1194 | 0 | size_t i; |
1195 | | |
1196 | | /* The decoder implementations made here support guessing */ |
1197 | 0 | if (selection == 0) |
1198 | 0 | return 1; |
1199 | | |
1200 | 0 | for (i = 0; i < OSSL_NELEM(checks); i++) { |
1201 | 0 | int check1 = (selection & checks[i]) != 0; |
1202 | 0 | int check2 = (selection_mask & checks[i]) != 0; |
1203 | | |
1204 | | /* |
1205 | | * If the caller asked for the currently checked bit(s), return |
1206 | | * whether the decoder description says it's supported. |
1207 | | */ |
1208 | 0 | if (check1) |
1209 | 0 | return check2; |
1210 | 0 | } |
1211 | | |
1212 | | /* This should be dead code, but just to be safe... */ |
1213 | 0 | return 0; |
1214 | 0 | } |
1215 | | |
1216 | | static int key2any_encode(KEY2ANY_CTX *ctx, OSSL_CORE_BIO *cout, |
1217 | | const void *key, int type, const char *pemname, |
1218 | | check_key_type_fn *checker, |
1219 | | key_to_der_fn *writer, |
1220 | | OSSL_PASSPHRASE_CALLBACK *pwcb, void *pwcbarg, |
1221 | | key_to_paramstring_fn *key2paramstring, |
1222 | | OSSL_i2d_of_void_ctx *key2der) |
1223 | 0 | { |
1224 | 0 | int ret = 0; |
1225 | |
|
1226 | 0 | if (key == NULL) { |
1227 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); |
1228 | 0 | } else if (writer != NULL |
1229 | 0 | && (checker == NULL || checker(key, type))) { |
1230 | 0 | BIO *out = ossl_bio_new_from_core_bio(ctx->provctx, cout); |
1231 | |
|
1232 | 0 | if (out != NULL |
1233 | 0 | && (pwcb == NULL |
1234 | 0 | || ossl_pw_set_ossl_passphrase_cb(&ctx->pwdata, pwcb, pwcbarg))) |
1235 | 0 | ret = |
1236 | 0 | writer(out, key, type, pemname, key2paramstring, key2der, ctx); |
1237 | |
|
1238 | 0 | BIO_free(out); |
1239 | 0 | } else { |
1240 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT); |
1241 | 0 | } |
1242 | 0 | return ret; |
1243 | 0 | } |
1244 | | |
1245 | 0 | #define DO_PRIVATE_KEY_selection_mask OSSL_KEYMGMT_SELECT_PRIVATE_KEY |
1246 | | #define DO_PRIVATE_KEY(impl, type, kind, output) \ |
1247 | 0 | if ((selection & DO_PRIVATE_KEY_selection_mask) != 0) \ |
1248 | 0 | return key2any_encode(ctx, cout, key, impl##_evp_type, \ |
1249 | 0 | impl##_pem_type " PRIVATE KEY", \ |
1250 | 0 | type##_check_key_type, \ |
1251 | 0 | key_to_##kind##_##output##_priv_bio, \ |
1252 | 0 | cb, cbarg, prepare_##type##_params, \ |
1253 | 0 | type##_##kind##_priv_to_der); |
1254 | | |
1255 | 0 | #define DO_PUBLIC_KEY_selection_mask OSSL_KEYMGMT_SELECT_PUBLIC_KEY |
1256 | | #define DO_PUBLIC_KEY(impl, type, kind, output) \ |
1257 | 0 | if ((selection & DO_PUBLIC_KEY_selection_mask) != 0) \ |
1258 | 0 | return key2any_encode(ctx, cout, key, impl##_evp_type, \ |
1259 | 0 | impl##_pem_type " PUBLIC KEY", \ |
1260 | 0 | type##_check_key_type, \ |
1261 | 0 | key_to_##kind##_##output##_pub_bio, \ |
1262 | 0 | cb, cbarg, prepare_##type##_params, \ |
1263 | 0 | type##_##kind##_pub_to_der); |
1264 | | |
1265 | 0 | #define DO_PARAMETERS_selection_mask OSSL_KEYMGMT_SELECT_ALL_PARAMETERS |
1266 | | #define DO_PARAMETERS(impl, type, kind, output) \ |
1267 | 0 | if ((selection & DO_PARAMETERS_selection_mask) != 0) \ |
1268 | 0 | return key2any_encode(ctx, cout, key, impl##_evp_type, \ |
1269 | 0 | impl##_pem_type " PARAMETERS", \ |
1270 | 0 | type##_check_key_type, \ |
1271 | 0 | key_to_##kind##_##output##_param_bio, \ |
1272 | 0 | NULL, NULL, NULL, \ |
1273 | 0 | type##_##kind##_params_to_der); |
1274 | | |
1275 | | /*- |
1276 | | * Implement the kinds of output structure that can be produced. They are |
1277 | | * referred to by name, and for each name, the following macros are defined |
1278 | | * (braces not included): |
1279 | | * |
1280 | | * DO_{kind}_selection_mask |
1281 | | * |
1282 | | * A mask of selection bits that must not be zero. This is used as a |
1283 | | * selection criterion for each implementation. |
1284 | | * This mask must never be zero. |
1285 | | * |
1286 | | * DO_{kind} |
1287 | | * |
1288 | | * The performing macro. It must use the DO_ macros defined above, |
1289 | | * always in this order: |
1290 | | * |
1291 | | * - DO_PRIVATE_KEY |
1292 | | * - DO_PUBLIC_KEY |
1293 | | * - DO_PARAMETERS |
1294 | | * |
1295 | | * Any of those may be omitted, but the relative order must still be |
1296 | | * the same. |
1297 | | */ |
1298 | | |
1299 | | /* |
1300 | | * PKCS#8 defines two structures for private keys only: |
1301 | | * - PrivateKeyInfo (raw unencrypted form) |
1302 | | * - EncryptedPrivateKeyInfo (encrypted wrapping) |
1303 | | * |
1304 | | * To allow a certain amount of flexibility, we allow the routines |
1305 | | * for PrivateKeyInfo to also produce EncryptedPrivateKeyInfo if a |
1306 | | * passphrase callback has been passed to them. |
1307 | | */ |
1308 | 0 | #define DO_PrivateKeyInfo_selection_mask DO_PRIVATE_KEY_selection_mask |
1309 | | #define DO_PrivateKeyInfo(impl, type, output) \ |
1310 | 0 | DO_PRIVATE_KEY(impl, type, pki, output) |
1311 | | |
1312 | 0 | #define DO_EncryptedPrivateKeyInfo_selection_mask DO_PRIVATE_KEY_selection_mask |
1313 | | #define DO_EncryptedPrivateKeyInfo(impl, type, output) \ |
1314 | 0 | DO_PRIVATE_KEY(impl, type, epki, output) |
1315 | | |
1316 | | /* SubjectPublicKeyInfo is a structure for public keys only */ |
1317 | 0 | #define DO_SubjectPublicKeyInfo_selection_mask DO_PUBLIC_KEY_selection_mask |
1318 | | #define DO_SubjectPublicKeyInfo(impl, type, output) \ |
1319 | 0 | DO_PUBLIC_KEY(impl, type, spki, output) |
1320 | | |
1321 | | /* |
1322 | | * "type-specific" is a uniform name for key type specific output for private |
1323 | | * and public keys as well as key parameters. This is used internally in |
1324 | | * libcrypto so it doesn't have to have special knowledge about select key |
1325 | | * types, but also when no better name has been found. If there are more |
1326 | | * expressive DO_ names above, those are preferred. |
1327 | | * |
1328 | | * Three forms exist: |
1329 | | * |
1330 | | * - type_specific_keypair Only supports private and public key |
1331 | | * - type_specific_params Only supports parameters |
1332 | | * - type_specific Supports all parts of an EVP_PKEY |
1333 | | * - type_specific_no_pub Supports all parts of an EVP_PKEY |
1334 | | * except public key |
1335 | | */ |
1336 | 0 | #define DO_type_specific_params_selection_mask DO_PARAMETERS_selection_mask |
1337 | | #define DO_type_specific_params(impl, type, output) \ |
1338 | 0 | DO_PARAMETERS(impl, type, type_specific, output) |
1339 | | #define DO_type_specific_keypair_selection_mask \ |
1340 | 0 | ( DO_PRIVATE_KEY_selection_mask | DO_PUBLIC_KEY_selection_mask ) |
1341 | | #define DO_type_specific_keypair(impl, type, output) \ |
1342 | 0 | DO_PRIVATE_KEY(impl, type, type_specific, output) \ |
1343 | 0 | DO_PUBLIC_KEY(impl, type, type_specific, output) |
1344 | | #define DO_type_specific_selection_mask \ |
1345 | 0 | ( DO_type_specific_keypair_selection_mask \ |
1346 | 0 | | DO_type_specific_params_selection_mask ) |
1347 | | #define DO_type_specific(impl, type, output) \ |
1348 | 0 | DO_type_specific_keypair(impl, type, output) \ |
1349 | 0 | DO_type_specific_params(impl, type, output) |
1350 | | #define DO_type_specific_no_pub_selection_mask \ |
1351 | 0 | ( DO_PRIVATE_KEY_selection_mask | DO_PARAMETERS_selection_mask) |
1352 | | #define DO_type_specific_no_pub(impl, type, output) \ |
1353 | 0 | DO_PRIVATE_KEY(impl, type, type_specific, output) \ |
1354 | 0 | DO_type_specific_params(impl, type, output) |
1355 | | |
1356 | | /* |
1357 | | * Type specific aliases for the cases where we need to refer to them by |
1358 | | * type name. |
1359 | | * This only covers key types that are represented with i2d_{TYPE}PrivateKey, |
1360 | | * i2d_{TYPE}PublicKey and i2d_{TYPE}params / i2d_{TYPE}Parameters. |
1361 | | */ |
1362 | 0 | #define DO_RSA_selection_mask DO_type_specific_keypair_selection_mask |
1363 | 0 | #define DO_RSA(impl, type, output) DO_type_specific_keypair(impl, type, output) |
1364 | | |
1365 | 0 | #define DO_DH_selection_mask DO_type_specific_params_selection_mask |
1366 | 0 | #define DO_DH(impl, type, output) DO_type_specific_params(impl, type, output) |
1367 | | |
1368 | 0 | #define DO_DHX_selection_mask DO_type_specific_params_selection_mask |
1369 | 0 | #define DO_DHX(impl, type, output) DO_type_specific_params(impl, type, output) |
1370 | | |
1371 | 0 | #define DO_DSA_selection_mask DO_type_specific_selection_mask |
1372 | 0 | #define DO_DSA(impl, type, output) DO_type_specific(impl, type, output) |
1373 | | |
1374 | 0 | #define DO_EC_selection_mask DO_type_specific_no_pub_selection_mask |
1375 | 0 | #define DO_EC(impl, type, output) DO_type_specific_no_pub(impl, type, output) |
1376 | | |
1377 | 0 | #define DO_SM2_selection_mask DO_type_specific_no_pub_selection_mask |
1378 | 0 | #define DO_SM2(impl, type, output) DO_type_specific_no_pub(impl, type, output) |
1379 | | |
1380 | | /* PKCS#1 defines a structure for RSA private and public keys */ |
1381 | 0 | #define DO_PKCS1_selection_mask DO_RSA_selection_mask |
1382 | 0 | #define DO_PKCS1(impl, type, output) DO_RSA(impl, type, output) |
1383 | | |
1384 | | /* PKCS#3 defines a structure for DH parameters */ |
1385 | 0 | #define DO_PKCS3_selection_mask DO_DH_selection_mask |
1386 | 0 | #define DO_PKCS3(impl, type, output) DO_DH(impl, type, output) |
1387 | | /* X9.42 defines a structure for DHx parameters */ |
1388 | 0 | #define DO_X9_42_selection_mask DO_DHX_selection_mask |
1389 | 0 | #define DO_X9_42(impl, type, output) DO_DHX(impl, type, output) |
1390 | | |
1391 | | /* X9.62 defines a structure for EC keys and parameters */ |
1392 | 0 | #define DO_X9_62_selection_mask DO_EC_selection_mask |
1393 | 0 | #define DO_X9_62(impl, type, output) DO_EC(impl, type, output) |
1394 | | |
1395 | | /* |
1396 | | * MAKE_ENCODER is the single driver for creating OSSL_DISPATCH tables. |
1397 | | * It takes the following arguments: |
1398 | | * |
1399 | | * impl This is the key type name that's being implemented. |
1400 | | * type This is the type name for the set of functions that implement |
1401 | | * the key type. For example, ed25519, ed448, x25519 and x448 |
1402 | | * are all implemented with the exact same set of functions. |
1403 | | * kind What kind of support to implement. These translate into |
1404 | | * the DO_##kind macros above. |
1405 | | * output The output type to implement. may be der or pem. |
1406 | | * |
1407 | | * The resulting OSSL_DISPATCH array gets the following name (expressed in |
1408 | | * C preprocessor terms) from those arguments: |
1409 | | * |
1410 | | * ossl_##impl##_to_##kind##_##output##_encoder_functions |
1411 | | */ |
1412 | | #define MAKE_ENCODER(impl, type, kind, output) \ |
1413 | | static OSSL_FUNC_encoder_import_object_fn \ |
1414 | | impl##_to_##kind##_##output##_import_object; \ |
1415 | | static OSSL_FUNC_encoder_free_object_fn \ |
1416 | | impl##_to_##kind##_##output##_free_object; \ |
1417 | | static OSSL_FUNC_encoder_encode_fn \ |
1418 | | impl##_to_##kind##_##output##_encode; \ |
1419 | | \ |
1420 | | static void * \ |
1421 | | impl##_to_##kind##_##output##_import_object(void *vctx, int selection, \ |
1422 | | const OSSL_PARAM params[]) \ |
1423 | 0 | { \ |
1424 | 0 | KEY2ANY_CTX *ctx = vctx; \ |
1425 | 0 | \ |
1426 | 0 | return ossl_prov_import_key(ossl_##impl##_keymgmt_functions, \ |
1427 | 0 | ctx->provctx, selection, params); \ |
1428 | 0 | } \ Unexecuted instantiation: encode_key2any.c:rsa_to_type_specific_keypair_der_import_object Unexecuted instantiation: encode_key2any.c:dh_to_type_specific_params_der_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_type_specific_params_der_import_object Unexecuted instantiation: encode_key2any.c:dsa_to_type_specific_der_import_object Unexecuted instantiation: encode_key2any.c:ec_to_type_specific_no_pub_der_import_object Unexecuted instantiation: encode_key2any.c:sm2_to_type_specific_no_pub_der_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_type_specific_keypair_pem_import_object Unexecuted instantiation: encode_key2any.c:dh_to_type_specific_params_pem_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_type_specific_params_pem_import_object Unexecuted instantiation: encode_key2any.c:dsa_to_type_specific_pem_import_object Unexecuted instantiation: encode_key2any.c:ec_to_type_specific_no_pub_pem_import_object Unexecuted instantiation: encode_key2any.c:sm2_to_type_specific_no_pub_pem_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:rsapss_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:rsapss_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:dh_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:dh_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:dh_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:dh_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:dh_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:dh_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:dsa_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:dsa_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:dsa_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:dsa_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ec_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ec_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ec_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ec_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:sm2_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:sm2_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:sm2_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:sm2_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ed25519_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ed25519_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ed448_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ed448_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ed448_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ed448_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ed448_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ed448_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:x25519_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:x25519_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:x25519_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:x25519_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:x448_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:x448_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:x448_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:x448_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:x448_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:x448_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_RSA_der_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_RSA_pem_import_object Unexecuted instantiation: encode_key2any.c:dh_to_DH_der_import_object Unexecuted instantiation: encode_key2any.c:dh_to_DH_pem_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_DHX_der_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_DHX_pem_import_object Unexecuted instantiation: encode_key2any.c:dsa_to_DSA_der_import_object Unexecuted instantiation: encode_key2any.c:dsa_to_DSA_pem_import_object Unexecuted instantiation: encode_key2any.c:ec_to_EC_der_import_object Unexecuted instantiation: encode_key2any.c:ec_to_EC_pem_import_object Unexecuted instantiation: encode_key2any.c:sm2_to_SM2_der_import_object Unexecuted instantiation: encode_key2any.c:sm2_to_SM2_pem_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_PKCS1_der_import_object Unexecuted instantiation: encode_key2any.c:rsa_to_PKCS1_pem_import_object Unexecuted instantiation: encode_key2any.c:rsapss_to_PKCS1_der_import_object Unexecuted instantiation: encode_key2any.c:rsapss_to_PKCS1_pem_import_object Unexecuted instantiation: encode_key2any.c:dh_to_PKCS3_der_import_object Unexecuted instantiation: encode_key2any.c:dh_to_PKCS3_pem_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_X9_42_der_import_object Unexecuted instantiation: encode_key2any.c:dhx_to_X9_42_pem_import_object Unexecuted instantiation: encode_key2any.c:ec_to_X9_62_der_import_object Unexecuted instantiation: encode_key2any.c:ec_to_X9_62_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_SubjectPublicKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_EncryptedPrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_EncryptedPrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_PrivateKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_PrivateKeyInfo_pem_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_SubjectPublicKeyInfo_der_import_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_SubjectPublicKeyInfo_pem_import_object |
1429 | | static void impl##_to_##kind##_##output##_free_object(void *key) \ |
1430 | 0 | { \ |
1431 | 0 | ossl_prov_free_key(ossl_##impl##_keymgmt_functions, key); \ |
1432 | 0 | } \ Unexecuted instantiation: encode_key2any.c:rsa_to_type_specific_keypair_der_free_object Unexecuted instantiation: encode_key2any.c:dh_to_type_specific_params_der_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_type_specific_params_der_free_object Unexecuted instantiation: encode_key2any.c:dsa_to_type_specific_der_free_object Unexecuted instantiation: encode_key2any.c:ec_to_type_specific_no_pub_der_free_object Unexecuted instantiation: encode_key2any.c:sm2_to_type_specific_no_pub_der_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_type_specific_keypair_pem_free_object Unexecuted instantiation: encode_key2any.c:dh_to_type_specific_params_pem_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_type_specific_params_pem_free_object Unexecuted instantiation: encode_key2any.c:dsa_to_type_specific_pem_free_object Unexecuted instantiation: encode_key2any.c:ec_to_type_specific_no_pub_pem_free_object Unexecuted instantiation: encode_key2any.c:sm2_to_type_specific_no_pub_pem_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:rsapss_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:rsapss_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:dh_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:dh_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:dh_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:dh_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:dh_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:dh_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:dsa_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:dsa_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:dsa_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:dsa_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ec_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ec_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ec_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ec_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:sm2_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:sm2_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:sm2_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:sm2_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ed25519_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ed25519_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ed448_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ed448_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ed448_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ed448_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ed448_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ed448_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:x25519_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:x25519_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:x25519_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:x25519_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:x448_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:x448_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:x448_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:x448_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:x448_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:x448_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_RSA_der_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_RSA_pem_free_object Unexecuted instantiation: encode_key2any.c:dh_to_DH_der_free_object Unexecuted instantiation: encode_key2any.c:dh_to_DH_pem_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_DHX_der_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_DHX_pem_free_object Unexecuted instantiation: encode_key2any.c:dsa_to_DSA_der_free_object Unexecuted instantiation: encode_key2any.c:dsa_to_DSA_pem_free_object Unexecuted instantiation: encode_key2any.c:ec_to_EC_der_free_object Unexecuted instantiation: encode_key2any.c:ec_to_EC_pem_free_object Unexecuted instantiation: encode_key2any.c:sm2_to_SM2_der_free_object Unexecuted instantiation: encode_key2any.c:sm2_to_SM2_pem_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_PKCS1_der_free_object Unexecuted instantiation: encode_key2any.c:rsa_to_PKCS1_pem_free_object Unexecuted instantiation: encode_key2any.c:rsapss_to_PKCS1_der_free_object Unexecuted instantiation: encode_key2any.c:rsapss_to_PKCS1_pem_free_object Unexecuted instantiation: encode_key2any.c:dh_to_PKCS3_der_free_object Unexecuted instantiation: encode_key2any.c:dh_to_PKCS3_pem_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_X9_42_der_free_object Unexecuted instantiation: encode_key2any.c:dhx_to_X9_42_pem_free_object Unexecuted instantiation: encode_key2any.c:ec_to_X9_62_der_free_object Unexecuted instantiation: encode_key2any.c:ec_to_X9_62_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_SubjectPublicKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_EncryptedPrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_EncryptedPrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_PrivateKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_PrivateKeyInfo_pem_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_SubjectPublicKeyInfo_der_free_object Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_SubjectPublicKeyInfo_pem_free_object |
1433 | | static int impl##_to_##kind##_##output##_does_selection(void *ctx, \ |
1434 | | int selection) \ |
1435 | 0 | { \ |
1436 | 0 | return key2any_check_selection(selection, \ |
1437 | 0 | DO_##kind##_selection_mask); \ |
1438 | 0 | } \ Unexecuted instantiation: encode_key2any.c:rsa_to_type_specific_keypair_der_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_type_specific_params_der_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_type_specific_params_der_does_selection Unexecuted instantiation: encode_key2any.c:dsa_to_type_specific_der_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_type_specific_no_pub_der_does_selection Unexecuted instantiation: encode_key2any.c:sm2_to_type_specific_no_pub_der_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_type_specific_keypair_pem_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_type_specific_params_pem_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_type_specific_params_pem_does_selection Unexecuted instantiation: encode_key2any.c:dsa_to_type_specific_pem_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_type_specific_no_pub_pem_does_selection Unexecuted instantiation: encode_key2any.c:sm2_to_type_specific_no_pub_pem_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:rsapss_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:rsapss_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:dsa_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:dsa_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:dsa_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:dsa_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:sm2_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:sm2_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:sm2_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:sm2_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ed25519_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ed25519_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ed448_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ed448_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ed448_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ed448_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ed448_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ed448_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:x25519_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:x25519_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:x25519_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:x25519_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:x448_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:x448_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:x448_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:x448_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:x448_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:x448_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_RSA_der_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_RSA_pem_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_DH_der_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_DH_pem_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_DHX_der_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_DHX_pem_does_selection Unexecuted instantiation: encode_key2any.c:dsa_to_DSA_der_does_selection Unexecuted instantiation: encode_key2any.c:dsa_to_DSA_pem_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_EC_der_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_EC_pem_does_selection Unexecuted instantiation: encode_key2any.c:sm2_to_SM2_der_does_selection Unexecuted instantiation: encode_key2any.c:sm2_to_SM2_pem_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_PKCS1_der_does_selection Unexecuted instantiation: encode_key2any.c:rsa_to_PKCS1_pem_does_selection Unexecuted instantiation: encode_key2any.c:rsapss_to_PKCS1_der_does_selection Unexecuted instantiation: encode_key2any.c:rsapss_to_PKCS1_pem_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_PKCS3_der_does_selection Unexecuted instantiation: encode_key2any.c:dh_to_PKCS3_pem_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_X9_42_der_does_selection Unexecuted instantiation: encode_key2any.c:dhx_to_X9_42_pem_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_X9_62_der_does_selection Unexecuted instantiation: encode_key2any.c:ec_to_X9_62_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_SubjectPublicKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_EncryptedPrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_EncryptedPrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_PrivateKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_PrivateKeyInfo_pem_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_SubjectPublicKeyInfo_der_does_selection Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_SubjectPublicKeyInfo_pem_does_selection |
1439 | | static int \ |
1440 | | impl##_to_##kind##_##output##_encode(void *ctx, OSSL_CORE_BIO *cout, \ |
1441 | | const void *key, \ |
1442 | | const OSSL_PARAM key_abstract[], \ |
1443 | | int selection, \ |
1444 | | OSSL_PASSPHRASE_CALLBACK *cb, \ |
1445 | | void *cbarg) \ |
1446 | 0 | { \ |
1447 | 0 | /* We don't deal with abstract objects */ \ |
1448 | 0 | if (key_abstract != NULL) { \ |
1449 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT); \ |
1450 | 0 | return 0; \ |
1451 | 0 | } \ |
1452 | 0 | DO_##kind(impl, type, output) \ |
1453 | 0 | \ |
1454 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT); \ |
1455 | 0 | return 0; \ |
1456 | 0 | } \ Unexecuted instantiation: encode_key2any.c:rsa_to_type_specific_keypair_der_encode Unexecuted instantiation: encode_key2any.c:dh_to_type_specific_params_der_encode Unexecuted instantiation: encode_key2any.c:dhx_to_type_specific_params_der_encode Unexecuted instantiation: encode_key2any.c:dsa_to_type_specific_der_encode Unexecuted instantiation: encode_key2any.c:ec_to_type_specific_no_pub_der_encode Unexecuted instantiation: encode_key2any.c:sm2_to_type_specific_no_pub_der_encode Unexecuted instantiation: encode_key2any.c:rsa_to_type_specific_keypair_pem_encode Unexecuted instantiation: encode_key2any.c:dh_to_type_specific_params_pem_encode Unexecuted instantiation: encode_key2any.c:dhx_to_type_specific_params_pem_encode Unexecuted instantiation: encode_key2any.c:dsa_to_type_specific_pem_encode Unexecuted instantiation: encode_key2any.c:ec_to_type_specific_no_pub_pem_encode Unexecuted instantiation: encode_key2any.c:sm2_to_type_specific_no_pub_pem_encode Unexecuted instantiation: encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:rsa_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:rsa_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:rsa_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:rsa_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:rsapss_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:rsapss_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:dh_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:dh_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:dh_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:dh_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:dh_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:dh_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:dhx_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:dhx_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:dhx_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:dhx_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:dsa_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:dsa_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:dsa_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:dsa_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ec_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ec_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ec_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ec_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:sm2_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:sm2_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:sm2_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:sm2_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ed25519_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ed25519_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ed448_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ed448_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ed448_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ed448_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ed448_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ed448_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:x25519_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:x25519_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:x25519_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:x25519_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:x448_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:x448_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:x448_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:x448_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:x448_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:x448_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128s_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_128f_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192s_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_192f_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256s_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_sha2_256f_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128s_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_128f_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192s_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_192f_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256s_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:slh_dsa_shake_256f_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_kem_512_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_kem_768_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_kem_1024_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:rsa_to_RSA_der_encode Unexecuted instantiation: encode_key2any.c:rsa_to_RSA_pem_encode Unexecuted instantiation: encode_key2any.c:dh_to_DH_der_encode Unexecuted instantiation: encode_key2any.c:dh_to_DH_pem_encode Unexecuted instantiation: encode_key2any.c:dhx_to_DHX_der_encode Unexecuted instantiation: encode_key2any.c:dhx_to_DHX_pem_encode Unexecuted instantiation: encode_key2any.c:dsa_to_DSA_der_encode Unexecuted instantiation: encode_key2any.c:dsa_to_DSA_pem_encode Unexecuted instantiation: encode_key2any.c:ec_to_EC_der_encode Unexecuted instantiation: encode_key2any.c:ec_to_EC_pem_encode Unexecuted instantiation: encode_key2any.c:sm2_to_SM2_der_encode Unexecuted instantiation: encode_key2any.c:sm2_to_SM2_pem_encode Unexecuted instantiation: encode_key2any.c:rsa_to_PKCS1_der_encode Unexecuted instantiation: encode_key2any.c:rsa_to_PKCS1_pem_encode Unexecuted instantiation: encode_key2any.c:rsapss_to_PKCS1_der_encode Unexecuted instantiation: encode_key2any.c:rsapss_to_PKCS1_pem_encode Unexecuted instantiation: encode_key2any.c:dh_to_PKCS3_der_encode Unexecuted instantiation: encode_key2any.c:dh_to_PKCS3_pem_encode Unexecuted instantiation: encode_key2any.c:dhx_to_X9_42_der_encode Unexecuted instantiation: encode_key2any.c:dhx_to_X9_42_pem_encode Unexecuted instantiation: encode_key2any.c:ec_to_X9_62_der_encode Unexecuted instantiation: encode_key2any.c:ec_to_X9_62_pem_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_44_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_65_to_SubjectPublicKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_EncryptedPrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_EncryptedPrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_PrivateKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_PrivateKeyInfo_pem_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_SubjectPublicKeyInfo_der_encode Unexecuted instantiation: encode_key2any.c:ml_dsa_87_to_SubjectPublicKeyInfo_pem_encode |
1457 | | const OSSL_DISPATCH \ |
1458 | | ossl_##impl##_to_##kind##_##output##_encoder_functions[] = { \ |
1459 | | { OSSL_FUNC_ENCODER_NEWCTX, \ |
1460 | | (void (*)(void))key2any_newctx }, \ |
1461 | | { OSSL_FUNC_ENCODER_FREECTX, \ |
1462 | | (void (*)(void))key2any_freectx }, \ |
1463 | | { OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS, \ |
1464 | | (void (*)(void))key2any_settable_ctx_params }, \ |
1465 | | { OSSL_FUNC_ENCODER_SET_CTX_PARAMS, \ |
1466 | | (void (*)(void))key2any_set_ctx_params }, \ |
1467 | | { OSSL_FUNC_ENCODER_DOES_SELECTION, \ |
1468 | | (void (*)(void))impl##_to_##kind##_##output##_does_selection }, \ |
1469 | | { OSSL_FUNC_ENCODER_IMPORT_OBJECT, \ |
1470 | | (void (*)(void))impl##_to_##kind##_##output##_import_object }, \ |
1471 | | { OSSL_FUNC_ENCODER_FREE_OBJECT, \ |
1472 | | (void (*)(void))impl##_to_##kind##_##output##_free_object }, \ |
1473 | | { OSSL_FUNC_ENCODER_ENCODE, \ |
1474 | | (void (*)(void))impl##_to_##kind##_##output##_encode }, \ |
1475 | | OSSL_DISPATCH_END \ |
1476 | | } |
1477 | | |
1478 | | /* |
1479 | | * Replacements for i2d_{TYPE}PrivateKey, i2d_{TYPE}PublicKey, |
1480 | | * i2d_{TYPE}params, as they exist. |
1481 | | */ |
1482 | | MAKE_ENCODER(rsa, rsa, type_specific_keypair, der); |
1483 | | #ifndef OPENSSL_NO_DH |
1484 | | MAKE_ENCODER(dh, dh, type_specific_params, der); |
1485 | | MAKE_ENCODER(dhx, dh, type_specific_params, der); |
1486 | | #endif |
1487 | | #ifndef OPENSSL_NO_DSA |
1488 | | MAKE_ENCODER(dsa, dsa, type_specific, der); |
1489 | | #endif |
1490 | | #ifndef OPENSSL_NO_EC |
1491 | | MAKE_ENCODER(ec, ec, type_specific_no_pub, der); |
1492 | | # ifndef OPENSSL_NO_SM2 |
1493 | | MAKE_ENCODER(sm2, ec, type_specific_no_pub, der); |
1494 | | # endif |
1495 | | #endif |
1496 | | |
1497 | | /* |
1498 | | * Replacements for PEM_write_bio_{TYPE}PrivateKey, |
1499 | | * PEM_write_bio_{TYPE}PublicKey, PEM_write_bio_{TYPE}params, as they exist. |
1500 | | */ |
1501 | | MAKE_ENCODER(rsa, rsa, type_specific_keypair, pem); |
1502 | | #ifndef OPENSSL_NO_DH |
1503 | | MAKE_ENCODER(dh, dh, type_specific_params, pem); |
1504 | | MAKE_ENCODER(dhx, dh, type_specific_params, pem); |
1505 | | #endif |
1506 | | #ifndef OPENSSL_NO_DSA |
1507 | | MAKE_ENCODER(dsa, dsa, type_specific, pem); |
1508 | | #endif |
1509 | | #ifndef OPENSSL_NO_EC |
1510 | | MAKE_ENCODER(ec, ec, type_specific_no_pub, pem); |
1511 | | # ifndef OPENSSL_NO_SM2 |
1512 | | MAKE_ENCODER(sm2, ec, type_specific_no_pub, pem); |
1513 | | # endif |
1514 | | #endif |
1515 | | |
1516 | | /* |
1517 | | * PKCS#8 and SubjectPublicKeyInfo support. This may duplicate some of the |
1518 | | * implementations specified above, but are more specific. |
1519 | | * The SubjectPublicKeyInfo implementations also replace the |
1520 | | * PEM_write_bio_{TYPE}_PUBKEY functions. |
1521 | | * For PEM, these are expected to be used by PEM_write_bio_PrivateKey(), |
1522 | | * PEM_write_bio_PUBKEY() and PEM_write_bio_Parameters(). |
1523 | | */ |
1524 | | MAKE_ENCODER(rsa, rsa, EncryptedPrivateKeyInfo, der); |
1525 | | MAKE_ENCODER(rsa, rsa, EncryptedPrivateKeyInfo, pem); |
1526 | | MAKE_ENCODER(rsa, rsa, PrivateKeyInfo, der); |
1527 | | MAKE_ENCODER(rsa, rsa, PrivateKeyInfo, pem); |
1528 | | MAKE_ENCODER(rsa, rsa, SubjectPublicKeyInfo, der); |
1529 | | MAKE_ENCODER(rsa, rsa, SubjectPublicKeyInfo, pem); |
1530 | | MAKE_ENCODER(rsapss, rsa, EncryptedPrivateKeyInfo, der); |
1531 | | MAKE_ENCODER(rsapss, rsa, EncryptedPrivateKeyInfo, pem); |
1532 | | MAKE_ENCODER(rsapss, rsa, PrivateKeyInfo, der); |
1533 | | MAKE_ENCODER(rsapss, rsa, PrivateKeyInfo, pem); |
1534 | | MAKE_ENCODER(rsapss, rsa, SubjectPublicKeyInfo, der); |
1535 | | MAKE_ENCODER(rsapss, rsa, SubjectPublicKeyInfo, pem); |
1536 | | #ifndef OPENSSL_NO_DH |
1537 | | MAKE_ENCODER(dh, dh, EncryptedPrivateKeyInfo, der); |
1538 | | MAKE_ENCODER(dh, dh, EncryptedPrivateKeyInfo, pem); |
1539 | | MAKE_ENCODER(dh, dh, PrivateKeyInfo, der); |
1540 | | MAKE_ENCODER(dh, dh, PrivateKeyInfo, pem); |
1541 | | MAKE_ENCODER(dh, dh, SubjectPublicKeyInfo, der); |
1542 | | MAKE_ENCODER(dh, dh, SubjectPublicKeyInfo, pem); |
1543 | | MAKE_ENCODER(dhx, dh, EncryptedPrivateKeyInfo, der); |
1544 | | MAKE_ENCODER(dhx, dh, EncryptedPrivateKeyInfo, pem); |
1545 | | MAKE_ENCODER(dhx, dh, PrivateKeyInfo, der); |
1546 | | MAKE_ENCODER(dhx, dh, PrivateKeyInfo, pem); |
1547 | | MAKE_ENCODER(dhx, dh, SubjectPublicKeyInfo, der); |
1548 | | MAKE_ENCODER(dhx, dh, SubjectPublicKeyInfo, pem); |
1549 | | #endif |
1550 | | #ifndef OPENSSL_NO_DSA |
1551 | | MAKE_ENCODER(dsa, dsa, EncryptedPrivateKeyInfo, der); |
1552 | | MAKE_ENCODER(dsa, dsa, EncryptedPrivateKeyInfo, pem); |
1553 | | MAKE_ENCODER(dsa, dsa, PrivateKeyInfo, der); |
1554 | | MAKE_ENCODER(dsa, dsa, PrivateKeyInfo, pem); |
1555 | | MAKE_ENCODER(dsa, dsa, SubjectPublicKeyInfo, der); |
1556 | | MAKE_ENCODER(dsa, dsa, SubjectPublicKeyInfo, pem); |
1557 | | #endif |
1558 | | #ifndef OPENSSL_NO_EC |
1559 | | MAKE_ENCODER(ec, ec, EncryptedPrivateKeyInfo, der); |
1560 | | MAKE_ENCODER(ec, ec, EncryptedPrivateKeyInfo, pem); |
1561 | | MAKE_ENCODER(ec, ec, PrivateKeyInfo, der); |
1562 | | MAKE_ENCODER(ec, ec, PrivateKeyInfo, pem); |
1563 | | MAKE_ENCODER(ec, ec, SubjectPublicKeyInfo, der); |
1564 | | MAKE_ENCODER(ec, ec, SubjectPublicKeyInfo, pem); |
1565 | | # ifndef OPENSSL_NO_SM2 |
1566 | | MAKE_ENCODER(sm2, ec, EncryptedPrivateKeyInfo, der); |
1567 | | MAKE_ENCODER(sm2, ec, EncryptedPrivateKeyInfo, pem); |
1568 | | MAKE_ENCODER(sm2, ec, PrivateKeyInfo, der); |
1569 | | MAKE_ENCODER(sm2, ec, PrivateKeyInfo, pem); |
1570 | | MAKE_ENCODER(sm2, ec, SubjectPublicKeyInfo, der); |
1571 | | MAKE_ENCODER(sm2, ec, SubjectPublicKeyInfo, pem); |
1572 | | # endif |
1573 | | # ifndef OPENSSL_NO_ECX |
1574 | | MAKE_ENCODER(ed25519, ecx, EncryptedPrivateKeyInfo, der); |
1575 | | MAKE_ENCODER(ed25519, ecx, EncryptedPrivateKeyInfo, pem); |
1576 | | MAKE_ENCODER(ed25519, ecx, PrivateKeyInfo, der); |
1577 | | MAKE_ENCODER(ed25519, ecx, PrivateKeyInfo, pem); |
1578 | | MAKE_ENCODER(ed25519, ecx, SubjectPublicKeyInfo, der); |
1579 | | MAKE_ENCODER(ed25519, ecx, SubjectPublicKeyInfo, pem); |
1580 | | MAKE_ENCODER(ed448, ecx, EncryptedPrivateKeyInfo, der); |
1581 | | MAKE_ENCODER(ed448, ecx, EncryptedPrivateKeyInfo, pem); |
1582 | | MAKE_ENCODER(ed448, ecx, PrivateKeyInfo, der); |
1583 | | MAKE_ENCODER(ed448, ecx, PrivateKeyInfo, pem); |
1584 | | MAKE_ENCODER(ed448, ecx, SubjectPublicKeyInfo, der); |
1585 | | MAKE_ENCODER(ed448, ecx, SubjectPublicKeyInfo, pem); |
1586 | | MAKE_ENCODER(x25519, ecx, EncryptedPrivateKeyInfo, der); |
1587 | | MAKE_ENCODER(x25519, ecx, EncryptedPrivateKeyInfo, pem); |
1588 | | MAKE_ENCODER(x25519, ecx, PrivateKeyInfo, der); |
1589 | | MAKE_ENCODER(x25519, ecx, PrivateKeyInfo, pem); |
1590 | | MAKE_ENCODER(x25519, ecx, SubjectPublicKeyInfo, der); |
1591 | | MAKE_ENCODER(x25519, ecx, SubjectPublicKeyInfo, pem); |
1592 | | MAKE_ENCODER(x448, ecx, EncryptedPrivateKeyInfo, der); |
1593 | | MAKE_ENCODER(x448, ecx, EncryptedPrivateKeyInfo, pem); |
1594 | | MAKE_ENCODER(x448, ecx, PrivateKeyInfo, der); |
1595 | | MAKE_ENCODER(x448, ecx, PrivateKeyInfo, pem); |
1596 | | MAKE_ENCODER(x448, ecx, SubjectPublicKeyInfo, der); |
1597 | | MAKE_ENCODER(x448, ecx, SubjectPublicKeyInfo, pem); |
1598 | | # endif |
1599 | | #endif |
1600 | | #ifndef OPENSSL_NO_SLH_DSA |
1601 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1602 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1603 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1604 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1605 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1606 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1607 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1608 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1609 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1610 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1611 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1612 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1613 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1614 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1615 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1616 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1617 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1618 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1619 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1620 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1621 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1622 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1623 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1624 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1625 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, PrivateKeyInfo, der); |
1626 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, PrivateKeyInfo, der); |
1627 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, PrivateKeyInfo, der); |
1628 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, PrivateKeyInfo, der); |
1629 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, PrivateKeyInfo, der); |
1630 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, PrivateKeyInfo, der); |
1631 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, PrivateKeyInfo, pem); |
1632 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, PrivateKeyInfo, pem); |
1633 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, PrivateKeyInfo, pem); |
1634 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, PrivateKeyInfo, pem); |
1635 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, PrivateKeyInfo, pem); |
1636 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, PrivateKeyInfo, pem); |
1637 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, PrivateKeyInfo, der); |
1638 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, PrivateKeyInfo, der); |
1639 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, PrivateKeyInfo, der); |
1640 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, PrivateKeyInfo, der); |
1641 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, PrivateKeyInfo, der); |
1642 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, PrivateKeyInfo, der); |
1643 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, PrivateKeyInfo, pem); |
1644 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, PrivateKeyInfo, pem); |
1645 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, PrivateKeyInfo, pem); |
1646 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, PrivateKeyInfo, pem); |
1647 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, PrivateKeyInfo, pem); |
1648 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, PrivateKeyInfo, pem); |
1649 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, SubjectPublicKeyInfo, der); |
1650 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, SubjectPublicKeyInfo, der); |
1651 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, SubjectPublicKeyInfo, der); |
1652 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, SubjectPublicKeyInfo, der); |
1653 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, SubjectPublicKeyInfo, der); |
1654 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, SubjectPublicKeyInfo, der); |
1655 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, SubjectPublicKeyInfo, pem); |
1656 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, SubjectPublicKeyInfo, pem); |
1657 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, SubjectPublicKeyInfo, pem); |
1658 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, SubjectPublicKeyInfo, pem); |
1659 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, SubjectPublicKeyInfo, pem); |
1660 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, SubjectPublicKeyInfo, pem); |
1661 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, SubjectPublicKeyInfo, der); |
1662 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, SubjectPublicKeyInfo, der); |
1663 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, SubjectPublicKeyInfo, der); |
1664 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, SubjectPublicKeyInfo, der); |
1665 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, SubjectPublicKeyInfo, der); |
1666 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, SubjectPublicKeyInfo, der); |
1667 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, SubjectPublicKeyInfo, pem); |
1668 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, SubjectPublicKeyInfo, pem); |
1669 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, SubjectPublicKeyInfo, pem); |
1670 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, SubjectPublicKeyInfo, pem); |
1671 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, SubjectPublicKeyInfo, pem); |
1672 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, SubjectPublicKeyInfo, pem); |
1673 | | #endif /* OPENSSL_NO_SLH_DSA */ |
1674 | | |
1675 | | #ifndef OPENSSL_NO_ML_KEM |
1676 | | MAKE_ENCODER(ml_kem_512, ml_kem, EncryptedPrivateKeyInfo, der); |
1677 | | MAKE_ENCODER(ml_kem_512, ml_kem, EncryptedPrivateKeyInfo, pem); |
1678 | | MAKE_ENCODER(ml_kem_512, ml_kem, PrivateKeyInfo, der); |
1679 | | MAKE_ENCODER(ml_kem_512, ml_kem, PrivateKeyInfo, pem); |
1680 | | MAKE_ENCODER(ml_kem_512, ml_kem, SubjectPublicKeyInfo, der); |
1681 | | MAKE_ENCODER(ml_kem_512, ml_kem, SubjectPublicKeyInfo, pem); |
1682 | | |
1683 | | MAKE_ENCODER(ml_kem_768, ml_kem, EncryptedPrivateKeyInfo, der); |
1684 | | MAKE_ENCODER(ml_kem_768, ml_kem, EncryptedPrivateKeyInfo, pem); |
1685 | | MAKE_ENCODER(ml_kem_768, ml_kem, PrivateKeyInfo, der); |
1686 | | MAKE_ENCODER(ml_kem_768, ml_kem, PrivateKeyInfo, pem); |
1687 | | MAKE_ENCODER(ml_kem_768, ml_kem, SubjectPublicKeyInfo, der); |
1688 | | MAKE_ENCODER(ml_kem_768, ml_kem, SubjectPublicKeyInfo, pem); |
1689 | | |
1690 | | MAKE_ENCODER(ml_kem_1024, ml_kem, EncryptedPrivateKeyInfo, der); |
1691 | | MAKE_ENCODER(ml_kem_1024, ml_kem, EncryptedPrivateKeyInfo, pem); |
1692 | | MAKE_ENCODER(ml_kem_1024, ml_kem, PrivateKeyInfo, der); |
1693 | | MAKE_ENCODER(ml_kem_1024, ml_kem, PrivateKeyInfo, pem); |
1694 | | MAKE_ENCODER(ml_kem_1024, ml_kem, SubjectPublicKeyInfo, der); |
1695 | | MAKE_ENCODER(ml_kem_1024, ml_kem, SubjectPublicKeyInfo, pem); |
1696 | | #endif |
1697 | | |
1698 | | /* |
1699 | | * Support for key type specific output formats. Not all key types have |
1700 | | * this, we only aim to duplicate what is available in 1.1.1 as |
1701 | | * i2d_TYPEPrivateKey(), i2d_TYPEPublicKey() and i2d_TYPEparams(). |
1702 | | * For example, there are no publicly available i2d_ function for |
1703 | | * ED25519, ED448, X25519 or X448, and they therefore only have PKCS#8 |
1704 | | * and SubjectPublicKeyInfo implementations as implemented above. |
1705 | | */ |
1706 | | MAKE_ENCODER(rsa, rsa, RSA, der); |
1707 | | MAKE_ENCODER(rsa, rsa, RSA, pem); |
1708 | | #ifndef OPENSSL_NO_DH |
1709 | | MAKE_ENCODER(dh, dh, DH, der); |
1710 | | MAKE_ENCODER(dh, dh, DH, pem); |
1711 | | MAKE_ENCODER(dhx, dh, DHX, der); |
1712 | | MAKE_ENCODER(dhx, dh, DHX, pem); |
1713 | | #endif |
1714 | | #ifndef OPENSSL_NO_DSA |
1715 | | MAKE_ENCODER(dsa, dsa, DSA, der); |
1716 | | MAKE_ENCODER(dsa, dsa, DSA, pem); |
1717 | | #endif |
1718 | | #ifndef OPENSSL_NO_EC |
1719 | | MAKE_ENCODER(ec, ec, EC, der); |
1720 | | MAKE_ENCODER(ec, ec, EC, pem); |
1721 | | # ifndef OPENSSL_NO_SM2 |
1722 | | MAKE_ENCODER(sm2, ec, SM2, der); |
1723 | | MAKE_ENCODER(sm2, ec, SM2, pem); |
1724 | | # endif |
1725 | | #endif |
1726 | | |
1727 | | /* Convenience structure names */ |
1728 | | MAKE_ENCODER(rsa, rsa, PKCS1, der); |
1729 | | MAKE_ENCODER(rsa, rsa, PKCS1, pem); |
1730 | | MAKE_ENCODER(rsapss, rsa, PKCS1, der); |
1731 | | MAKE_ENCODER(rsapss, rsa, PKCS1, pem); |
1732 | | #ifndef OPENSSL_NO_DH |
1733 | | MAKE_ENCODER(dh, dh, PKCS3, der); /* parameters only */ |
1734 | | MAKE_ENCODER(dh, dh, PKCS3, pem); /* parameters only */ |
1735 | | MAKE_ENCODER(dhx, dh, X9_42, der); /* parameters only */ |
1736 | | MAKE_ENCODER(dhx, dh, X9_42, pem); /* parameters only */ |
1737 | | #endif |
1738 | | #ifndef OPENSSL_NO_EC |
1739 | | MAKE_ENCODER(ec, ec, X9_62, der); |
1740 | | MAKE_ENCODER(ec, ec, X9_62, pem); |
1741 | | #endif |
1742 | | |
1743 | | #ifndef OPENSSL_NO_ML_DSA |
1744 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, EncryptedPrivateKeyInfo, der); |
1745 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, EncryptedPrivateKeyInfo, pem); |
1746 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, PrivateKeyInfo, der); |
1747 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, PrivateKeyInfo, pem); |
1748 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, SubjectPublicKeyInfo, der); |
1749 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, SubjectPublicKeyInfo, pem); |
1750 | | |
1751 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, EncryptedPrivateKeyInfo, der); |
1752 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, EncryptedPrivateKeyInfo, pem); |
1753 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, PrivateKeyInfo, der); |
1754 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, PrivateKeyInfo, pem); |
1755 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, SubjectPublicKeyInfo, der); |
1756 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, SubjectPublicKeyInfo, pem); |
1757 | | |
1758 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, EncryptedPrivateKeyInfo, der); |
1759 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, EncryptedPrivateKeyInfo, pem); |
1760 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, PrivateKeyInfo, der); |
1761 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, PrivateKeyInfo, pem); |
1762 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, SubjectPublicKeyInfo, der); |
1763 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, SubjectPublicKeyInfo, pem); |
1764 | | #endif /* OPENSSL_NO_ML_DSA */ |