/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 | | /* |
12 | | * Low level APIs are deprecated for public use, but still ok for internal use. |
13 | | */ |
14 | | #include "internal/deprecated.h" |
15 | | |
16 | | #include <openssl/byteorder.h> |
17 | | #include <openssl/core.h> |
18 | | #include <openssl/core_dispatch.h> |
19 | | #include <openssl/core_names.h> |
20 | | #include <openssl/crypto.h> |
21 | | #include <openssl/params.h> |
22 | | #include <openssl/asn1.h> |
23 | | #include <openssl/err.h> |
24 | | #include <openssl/pem.h> |
25 | | #include <openssl/x509.h> |
26 | | #include <openssl/pkcs12.h> /* PKCS8_encrypt() */ |
27 | | #include <openssl/dh.h> |
28 | | #include <openssl/dsa.h> |
29 | | #include <openssl/ec.h> |
30 | | #include <openssl/proverr.h> |
31 | | #include "internal/passphrase.h" |
32 | | #include "internal/cryptlib.h" |
33 | | #include "crypto/ecx.h" |
34 | | #include "crypto/ml_kem.h" |
35 | | #include "crypto/rsa.h" |
36 | | #include "crypto/ml_dsa.h" |
37 | | #include "crypto/slh_dsa.h" |
38 | | #include "prov/implementations.h" |
39 | | #include "prov/bio.h" |
40 | | #include "prov/provider_ctx.h" |
41 | | #include "prov/der_rsa.h" |
42 | | #include "prov/endecoder_local.h" |
43 | | #include "prov/ml_dsa_codecs.h" |
44 | | #include "prov/ml_kem_codecs.h" |
45 | | |
46 | | #if defined(OPENSSL_NO_DH) && defined(OPENSSL_NO_DSA) && defined(OPENSSL_NO_EC) |
47 | | # define OPENSSL_NO_KEYPARAMS |
48 | | #endif |
49 | | |
50 | | typedef struct key2any_ctx_st { |
51 | | PROV_CTX *provctx; |
52 | | |
53 | | /* Set to 0 if parameters should not be saved (dsa only) */ |
54 | | int save_parameters; |
55 | | |
56 | | /* Set to 1 if intending to encrypt/decrypt, otherwise 0 */ |
57 | | int cipher_intent; |
58 | | |
59 | | EVP_CIPHER *cipher; |
60 | | |
61 | | struct ossl_passphrase_data_st pwdata; |
62 | | } KEY2ANY_CTX; |
63 | | |
64 | | typedef int check_key_type_fn(const void *key, int nid); |
65 | | typedef int key_to_paramstring_fn(const void *key, int nid, int save, |
66 | | void **str, int *strtype); |
67 | | typedef int key_to_der_fn(BIO *out, const void *key, |
68 | | int key_nid, const char *pemname, |
69 | | key_to_paramstring_fn *p2s, |
70 | | OSSL_i2d_of_void_ctx *k2d, KEY2ANY_CTX *ctx); |
71 | | typedef int write_bio_of_void_fn(BIO *bp, const void *x); |
72 | | |
73 | | |
74 | | /* Free the blob allocated during key_to_paramstring_fn */ |
75 | | static void free_asn1_data(int type, void *data) |
76 | 0 | { |
77 | 0 | switch (type) { |
78 | 0 | case V_ASN1_OBJECT: |
79 | 0 | ASN1_OBJECT_free(data); |
80 | 0 | break; |
81 | 0 | case V_ASN1_SEQUENCE: |
82 | 0 | ASN1_STRING_free(data); |
83 | 0 | break; |
84 | 0 | } |
85 | 0 | } |
86 | | |
87 | | static PKCS8_PRIV_KEY_INFO *key_to_p8info(const void *key, int key_nid, |
88 | | void *params, int params_type, |
89 | | OSSL_i2d_of_void_ctx *k2d, |
90 | | KEY2ANY_CTX *ctx) |
91 | 0 | { |
92 | | /* der, derlen store the key DER output and its length */ |
93 | 0 | unsigned char *der = NULL; |
94 | 0 | int derlen; |
95 | | /* The final PKCS#8 info */ |
96 | 0 | PKCS8_PRIV_KEY_INFO *p8info = NULL; |
97 | |
|
98 | 0 | if ((p8info = PKCS8_PRIV_KEY_INFO_new()) == NULL |
99 | 0 | || (derlen = k2d(key, &der, (void *)ctx)) <= 0 |
100 | 0 | || !PKCS8_pkey_set0(p8info, OBJ_nid2obj(key_nid), 0, |
101 | 0 | params_type, params, der, derlen)) { |
102 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
103 | 0 | PKCS8_PRIV_KEY_INFO_free(p8info); |
104 | 0 | OPENSSL_free(der); |
105 | 0 | p8info = NULL; |
106 | 0 | } |
107 | |
|
108 | 0 | return p8info; |
109 | 0 | } |
110 | | |
111 | | static X509_SIG *p8info_to_encp8(PKCS8_PRIV_KEY_INFO *p8info, |
112 | | KEY2ANY_CTX *ctx) |
113 | 0 | { |
114 | 0 | X509_SIG *p8 = NULL; |
115 | 0 | char kstr[PEM_BUFSIZE]; |
116 | 0 | size_t klen = 0; |
117 | 0 | OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx); |
118 | |
|
119 | 0 | if (ctx->cipher == NULL) |
120 | 0 | return NULL; |
121 | | |
122 | 0 | if (!ossl_pw_get_passphrase(kstr, sizeof(kstr), &klen, NULL, 1, |
123 | 0 | &ctx->pwdata)) { |
124 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PASSPHRASE); |
125 | 0 | return NULL; |
126 | 0 | } |
127 | | /* First argument == -1 means "standard" */ |
128 | 0 | p8 = PKCS8_encrypt_ex(-1, ctx->cipher, kstr, (int)klen, NULL, 0, 0, p8info, |
129 | 0 | libctx, NULL); |
130 | 0 | OPENSSL_cleanse(kstr, klen); |
131 | 0 | return p8; |
132 | 0 | } |
133 | | |
134 | | static X509_SIG *key_to_encp8(const void *key, int key_nid, |
135 | | void *params, int params_type, |
136 | | OSSL_i2d_of_void_ctx *k2d, |
137 | | KEY2ANY_CTX *ctx) |
138 | 0 | { |
139 | 0 | PKCS8_PRIV_KEY_INFO *p8info = |
140 | 0 | key_to_p8info(key, key_nid, params, params_type, k2d, ctx); |
141 | 0 | X509_SIG *p8 = NULL; |
142 | |
|
143 | 0 | if (p8info == NULL) { |
144 | 0 | free_asn1_data(params_type, params); |
145 | 0 | } else { |
146 | 0 | p8 = p8info_to_encp8(p8info, ctx); |
147 | 0 | PKCS8_PRIV_KEY_INFO_free(p8info); |
148 | 0 | } |
149 | 0 | return p8; |
150 | 0 | } |
151 | | |
152 | | static X509_PUBKEY *key_to_pubkey(const void *key, int key_nid, |
153 | | void *params, int params_type, |
154 | | OSSL_i2d_of_void_ctx *k2d, |
155 | | KEY2ANY_CTX *ctx) |
156 | 0 | { |
157 | | /* der, derlen store the key DER output and its length */ |
158 | 0 | unsigned char *der = NULL; |
159 | 0 | int derlen; |
160 | | /* The final X509_PUBKEY */ |
161 | 0 | X509_PUBKEY *xpk = NULL; |
162 | | |
163 | |
|
164 | 0 | if ((xpk = X509_PUBKEY_new()) == NULL |
165 | 0 | || (derlen = k2d(key, &der, (void *)ctx)) <= 0 |
166 | 0 | || !X509_PUBKEY_set0_param(xpk, OBJ_nid2obj(key_nid), |
167 | 0 | params_type, params, der, derlen)) { |
168 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_X509_LIB); |
169 | 0 | X509_PUBKEY_free(xpk); |
170 | 0 | OPENSSL_free(der); |
171 | 0 | xpk = NULL; |
172 | 0 | } |
173 | |
|
174 | 0 | return xpk; |
175 | 0 | } |
176 | | |
177 | | /* |
178 | | * key_to_epki_* produce encoded output with the private key data in a |
179 | | * EncryptedPrivateKeyInfo structure (defined by PKCS#8). They require |
180 | | * that there's an intent to encrypt, anything else is an error. |
181 | | * |
182 | | * key_to_pki_* primarily produce encoded output with the private key data |
183 | | * in a PrivateKeyInfo structure (also defined by PKCS#8). However, if |
184 | | * there is an intent to encrypt the data, the corresponding key_to_epki_* |
185 | | * function is used instead. |
186 | | * |
187 | | * key_to_spki_* produce encoded output with the public key data in an |
188 | | * X.509 SubjectPublicKeyInfo. |
189 | | * |
190 | | * Key parameters don't have any defined envelopment of this kind, but are |
191 | | * included in some manner in the output from the functions described above, |
192 | | * either in the AlgorithmIdentifier's parameter field, or as part of the |
193 | | * key data itself. |
194 | | */ |
195 | | |
196 | | static int key_to_epki_der_priv_bio(BIO *out, const void *key, |
197 | | int key_nid, |
198 | | ossl_unused const char *pemname, |
199 | | key_to_paramstring_fn *p2s, |
200 | | OSSL_i2d_of_void_ctx *k2d, |
201 | | KEY2ANY_CTX *ctx) |
202 | 0 | { |
203 | 0 | int ret = 0; |
204 | 0 | void *str = NULL; |
205 | 0 | int strtype = V_ASN1_UNDEF; |
206 | 0 | X509_SIG *p8; |
207 | |
|
208 | 0 | if (!ctx->cipher_intent) |
209 | 0 | return 0; |
210 | | |
211 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
212 | 0 | &str, &strtype)) |
213 | 0 | return 0; |
214 | | |
215 | 0 | p8 = key_to_encp8(key, key_nid, str, strtype, k2d, ctx); |
216 | 0 | if (p8 != NULL) |
217 | 0 | ret = i2d_PKCS8_bio(out, p8); |
218 | |
|
219 | 0 | X509_SIG_free(p8); |
220 | |
|
221 | 0 | return ret; |
222 | 0 | } |
223 | | |
224 | | static int key_to_epki_pem_priv_bio(BIO *out, const void *key, |
225 | | int key_nid, |
226 | | ossl_unused const char *pemname, |
227 | | key_to_paramstring_fn *p2s, |
228 | | OSSL_i2d_of_void_ctx *k2d, |
229 | | KEY2ANY_CTX *ctx) |
230 | 0 | { |
231 | 0 | int ret = 0; |
232 | 0 | void *str = NULL; |
233 | 0 | int strtype = V_ASN1_UNDEF; |
234 | 0 | X509_SIG *p8; |
235 | |
|
236 | 0 | if (!ctx->cipher_intent) |
237 | 0 | return 0; |
238 | | |
239 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
240 | 0 | &str, &strtype)) |
241 | 0 | return 0; |
242 | | |
243 | 0 | p8 = key_to_encp8(key, key_nid, str, strtype, k2d, ctx); |
244 | 0 | if (p8 != NULL) |
245 | 0 | ret = PEM_write_bio_PKCS8(out, p8); |
246 | |
|
247 | 0 | X509_SIG_free(p8); |
248 | |
|
249 | 0 | return ret; |
250 | 0 | } |
251 | | |
252 | | static int key_to_pki_der_priv_bio(BIO *out, const void *key, |
253 | | int key_nid, |
254 | | ossl_unused const char *pemname, |
255 | | key_to_paramstring_fn *p2s, |
256 | | OSSL_i2d_of_void_ctx *k2d, |
257 | | KEY2ANY_CTX *ctx) |
258 | 0 | { |
259 | 0 | int ret = 0; |
260 | 0 | void *str = NULL; |
261 | 0 | int strtype = V_ASN1_UNDEF; |
262 | 0 | PKCS8_PRIV_KEY_INFO *p8info; |
263 | |
|
264 | 0 | if (ctx->cipher_intent) |
265 | 0 | return key_to_epki_der_priv_bio(out, key, key_nid, pemname, |
266 | 0 | p2s, k2d, ctx); |
267 | | |
268 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
269 | 0 | &str, &strtype)) |
270 | 0 | return 0; |
271 | | |
272 | 0 | p8info = key_to_p8info(key, key_nid, str, strtype, k2d, ctx); |
273 | |
|
274 | 0 | if (p8info != NULL) |
275 | 0 | ret = i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8info); |
276 | 0 | else |
277 | 0 | free_asn1_data(strtype, str); |
278 | |
|
279 | 0 | PKCS8_PRIV_KEY_INFO_free(p8info); |
280 | |
|
281 | 0 | return ret; |
282 | 0 | } |
283 | | |
284 | | static int key_to_pki_pem_priv_bio(BIO *out, const void *key, |
285 | | int key_nid, |
286 | | ossl_unused const char *pemname, |
287 | | key_to_paramstring_fn *p2s, |
288 | | OSSL_i2d_of_void_ctx *k2d, |
289 | | KEY2ANY_CTX *ctx) |
290 | 0 | { |
291 | 0 | int ret = 0; |
292 | 0 | void *str = NULL; |
293 | 0 | int strtype = V_ASN1_UNDEF; |
294 | 0 | PKCS8_PRIV_KEY_INFO *p8info; |
295 | |
|
296 | 0 | if (ctx->cipher_intent) |
297 | 0 | return key_to_epki_pem_priv_bio(out, key, key_nid, pemname, |
298 | 0 | p2s, k2d, ctx); |
299 | | |
300 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
301 | 0 | &str, &strtype)) |
302 | 0 | return 0; |
303 | | |
304 | 0 | p8info = key_to_p8info(key, key_nid, str, strtype, k2d, ctx); |
305 | |
|
306 | 0 | if (p8info != NULL) |
307 | 0 | ret = PEM_write_bio_PKCS8_PRIV_KEY_INFO(out, p8info); |
308 | 0 | else |
309 | 0 | free_asn1_data(strtype, str); |
310 | |
|
311 | 0 | PKCS8_PRIV_KEY_INFO_free(p8info); |
312 | |
|
313 | 0 | return ret; |
314 | 0 | } |
315 | | |
316 | | static int key_to_spki_der_pub_bio(BIO *out, const void *key, |
317 | | int key_nid, |
318 | | ossl_unused const char *pemname, |
319 | | key_to_paramstring_fn *p2s, |
320 | | OSSL_i2d_of_void_ctx *k2d, |
321 | | KEY2ANY_CTX *ctx) |
322 | 0 | { |
323 | 0 | int ret = 0; |
324 | 0 | void *str = NULL; |
325 | 0 | int strtype = V_ASN1_UNDEF; |
326 | 0 | X509_PUBKEY *xpk = NULL; |
327 | |
|
328 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
329 | 0 | &str, &strtype)) |
330 | 0 | return 0; |
331 | | |
332 | 0 | xpk = key_to_pubkey(key, key_nid, str, strtype, k2d, ctx); |
333 | |
|
334 | 0 | if (xpk != NULL) |
335 | 0 | ret = i2d_X509_PUBKEY_bio(out, xpk); |
336 | | |
337 | | /* Also frees |str| */ |
338 | 0 | X509_PUBKEY_free(xpk); |
339 | 0 | return ret; |
340 | 0 | } |
341 | | |
342 | | static int key_to_spki_pem_pub_bio(BIO *out, const void *key, |
343 | | int key_nid, |
344 | | ossl_unused const char *pemname, |
345 | | key_to_paramstring_fn *p2s, |
346 | | OSSL_i2d_of_void_ctx *k2d, |
347 | | KEY2ANY_CTX *ctx) |
348 | 0 | { |
349 | 0 | int ret = 0; |
350 | 0 | void *str = NULL; |
351 | 0 | int strtype = V_ASN1_UNDEF; |
352 | 0 | X509_PUBKEY *xpk = NULL; |
353 | |
|
354 | 0 | if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters, |
355 | 0 | &str, &strtype)) |
356 | 0 | return 0; |
357 | | |
358 | 0 | xpk = key_to_pubkey(key, key_nid, str, strtype, k2d, ctx); |
359 | |
|
360 | 0 | if (xpk != NULL) |
361 | 0 | ret = PEM_write_bio_X509_PUBKEY(out, xpk); |
362 | 0 | else |
363 | 0 | free_asn1_data(strtype, str); |
364 | | |
365 | | /* Also frees |str| */ |
366 | 0 | X509_PUBKEY_free(xpk); |
367 | 0 | return ret; |
368 | 0 | } |
369 | | |
370 | | /* |
371 | | * key_to_type_specific_* produce encoded output with type specific key data, |
372 | | * no envelopment; the same kind of output as the type specific i2d_ and |
373 | | * PEM_write_ functions, which is often a simple SEQUENCE of INTEGER. |
374 | | * |
375 | | * OpenSSL tries to discourage production of new keys in this form, because |
376 | | * of the ambiguity when trying to recognise them, but can't deny that PKCS#1 |
377 | | * et al still are live standards. |
378 | | * |
379 | | * Note that these functions completely ignore p2s, and rather rely entirely |
380 | | * on k2d to do the complete work. |
381 | | */ |
382 | | static int key_to_type_specific_der_bio(BIO *out, const void *key, |
383 | | int key_nid, |
384 | | ossl_unused const char *pemname, |
385 | | key_to_paramstring_fn *p2s, |
386 | | OSSL_i2d_of_void_ctx *k2d, |
387 | | KEY2ANY_CTX *ctx) |
388 | 0 | { |
389 | 0 | unsigned char *der = NULL; |
390 | 0 | int derlen; |
391 | 0 | int ret; |
392 | |
|
393 | 0 | if ((derlen = k2d(key, &der, (void *)ctx)) <= 0) { |
394 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PROV_LIB); |
395 | 0 | return 0; |
396 | 0 | } |
397 | | |
398 | 0 | ret = BIO_write(out, der, derlen); |
399 | 0 | OPENSSL_free(der); |
400 | 0 | return ret > 0; |
401 | 0 | } |
402 | 0 | #define key_to_type_specific_der_priv_bio key_to_type_specific_der_bio |
403 | 0 | #define key_to_type_specific_der_pub_bio key_to_type_specific_der_bio |
404 | 0 | #define key_to_type_specific_der_param_bio key_to_type_specific_der_bio |
405 | | |
406 | | static int key_to_type_specific_pem_bio_cb(BIO *out, const void *key, |
407 | | int key_nid, const char *pemname, |
408 | | key_to_paramstring_fn *p2s, |
409 | | OSSL_i2d_of_void_ctx *k2d, |
410 | | KEY2ANY_CTX *ctx, |
411 | | pem_password_cb *cb, void *cbarg) |
412 | 0 | { |
413 | 0 | return PEM_ASN1_write_bio_ctx(k2d, (void *)ctx, pemname, out, key, |
414 | 0 | ctx->cipher, NULL, 0, cb, cbarg) > 0; |
415 | 0 | } |
416 | | |
417 | | static int key_to_type_specific_pem_priv_bio(BIO *out, const void *key, |
418 | | int key_nid, const char *pemname, |
419 | | key_to_paramstring_fn *p2s, |
420 | | OSSL_i2d_of_void_ctx *k2d, |
421 | | KEY2ANY_CTX *ctx) |
422 | 0 | { |
423 | 0 | return key_to_type_specific_pem_bio_cb(out, key, key_nid, pemname, |
424 | 0 | p2s, k2d, ctx, |
425 | 0 | ossl_pw_pem_password, &ctx->pwdata); |
426 | 0 | } |
427 | | |
428 | | static int key_to_type_specific_pem_pub_bio(BIO *out, const void *key, |
429 | | int key_nid, const char *pemname, |
430 | | key_to_paramstring_fn *p2s, |
431 | | OSSL_i2d_of_void_ctx *k2d, |
432 | | KEY2ANY_CTX *ctx) |
433 | 0 | { |
434 | 0 | return key_to_type_specific_pem_bio_cb(out, key, key_nid, pemname, |
435 | 0 | p2s, k2d, ctx, NULL, NULL); |
436 | 0 | } |
437 | | |
438 | | #ifndef OPENSSL_NO_KEYPARAMS |
439 | | static int key_to_type_specific_pem_param_bio(BIO *out, const void *key, |
440 | | int key_nid, const char *pemname, |
441 | | key_to_paramstring_fn *p2s, |
442 | | OSSL_i2d_of_void_ctx *k2d, |
443 | | KEY2ANY_CTX *ctx) |
444 | 0 | { |
445 | 0 | return key_to_type_specific_pem_bio_cb(out, key, key_nid, pemname, |
446 | 0 | p2s, k2d, ctx, NULL, NULL); |
447 | 0 | } |
448 | | #endif |
449 | | |
450 | | /* ---------------------------------------------------------------------- */ |
451 | | |
452 | | #define k2d_NOCTX(n, f) \ |
453 | | static int \ |
454 | | n##_k2d(const void *key, unsigned char **pder, \ |
455 | | ossl_unused void *ctx) \ |
456 | 0 | { \ |
457 | 0 | return f(key, pder); \ |
458 | 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 |
459 | | |
460 | | /* ---------------------------------------------------------------------- */ |
461 | | |
462 | | #ifndef OPENSSL_NO_DH |
463 | | static int prepare_dh_params(const void *dh, int nid, int save, |
464 | | void **pstr, int *pstrtype) |
465 | 0 | { |
466 | 0 | ASN1_STRING *params = ASN1_STRING_new(); |
467 | |
|
468 | 0 | if (params == NULL) { |
469 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
470 | 0 | return 0; |
471 | 0 | } |
472 | | |
473 | 0 | if (nid == EVP_PKEY_DHX) |
474 | 0 | params->length = i2d_DHxparams(dh, ¶ms->data); |
475 | 0 | else |
476 | 0 | params->length = i2d_DHparams(dh, ¶ms->data); |
477 | |
|
478 | 0 | if (params->length <= 0) { |
479 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
480 | 0 | ASN1_STRING_free(params); |
481 | 0 | return 0; |
482 | 0 | } |
483 | 0 | params->type = V_ASN1_SEQUENCE; |
484 | |
|
485 | 0 | *pstr = params; |
486 | 0 | *pstrtype = V_ASN1_SEQUENCE; |
487 | 0 | return 1; |
488 | 0 | } |
489 | | |
490 | | static int dh_spki_pub_to_der(const void *dh, unsigned char **pder, |
491 | | ossl_unused void *ctx) |
492 | 0 | { |
493 | 0 | const BIGNUM *bn = NULL; |
494 | 0 | ASN1_INTEGER *pub_key = NULL; |
495 | 0 | int ret; |
496 | |
|
497 | 0 | if ((bn = DH_get0_pub_key(dh)) == NULL) { |
498 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY); |
499 | 0 | return 0; |
500 | 0 | } |
501 | 0 | if ((pub_key = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) { |
502 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_BN_ERROR); |
503 | 0 | return 0; |
504 | 0 | } |
505 | | |
506 | 0 | ret = i2d_ASN1_INTEGER(pub_key, pder); |
507 | |
|
508 | 0 | ASN1_STRING_clear_free(pub_key); |
509 | 0 | return ret; |
510 | 0 | } |
511 | | |
512 | | static int dh_pki_priv_to_der(const void *dh, unsigned char **pder, |
513 | | ossl_unused void *ctx) |
514 | 0 | { |
515 | 0 | const BIGNUM *bn = NULL; |
516 | 0 | ASN1_INTEGER *priv_key = NULL; |
517 | 0 | int ret; |
518 | |
|
519 | 0 | if ((bn = DH_get0_priv_key(dh)) == NULL) { |
520 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY); |
521 | 0 | return 0; |
522 | 0 | } |
523 | 0 | if ((priv_key = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) { |
524 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_BN_ERROR); |
525 | 0 | return 0; |
526 | 0 | } |
527 | | |
528 | 0 | ret = i2d_ASN1_INTEGER(priv_key, pder); |
529 | |
|
530 | 0 | ASN1_STRING_clear_free(priv_key); |
531 | 0 | return ret; |
532 | 0 | } |
533 | | |
534 | 0 | # define dh_epki_priv_to_der dh_pki_priv_to_der |
535 | | |
536 | | static int |
537 | | dh_type_specific_params_to_der(const void *dh, unsigned char **pder, |
538 | | ossl_unused void *ctx) |
539 | 0 | { |
540 | 0 | if (DH_test_flags(dh, DH_FLAG_TYPE_DHX)) |
541 | 0 | return i2d_DHxparams(dh, pder); |
542 | 0 | return i2d_DHparams(dh, pder); |
543 | 0 | } |
544 | | |
545 | | /* |
546 | | * DH doesn't have i2d_DHPrivateKey or i2d_DHPublicKey, so we can't make |
547 | | * corresponding functions here. |
548 | | */ |
549 | | # define dh_type_specific_priv_to_der NULL |
550 | | # define dh_type_specific_pub_to_der NULL |
551 | | |
552 | | static int dh_check_key_type(const void *dh, int expected_type) |
553 | 0 | { |
554 | 0 | int type = |
555 | 0 | DH_test_flags(dh, DH_FLAG_TYPE_DHX) ? EVP_PKEY_DHX : EVP_PKEY_DH; |
556 | |
|
557 | 0 | return type == expected_type; |
558 | 0 | } |
559 | | |
560 | 0 | # define dh_evp_type EVP_PKEY_DH |
561 | 0 | # define dhx_evp_type EVP_PKEY_DHX |
562 | 0 | # define dh_pem_type "DH" |
563 | 0 | # define dhx_pem_type "X9.42 DH" |
564 | | #endif |
565 | | |
566 | | /* ---------------------------------------------------------------------- */ |
567 | | |
568 | | #ifndef OPENSSL_NO_DSA |
569 | | static int encode_dsa_params(const void *dsa, int nid, |
570 | | void **pstr, int *pstrtype) |
571 | 0 | { |
572 | 0 | ASN1_STRING *params = ASN1_STRING_new(); |
573 | |
|
574 | 0 | if (params == NULL) { |
575 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
576 | 0 | return 0; |
577 | 0 | } |
578 | | |
579 | 0 | params->length = i2d_DSAparams(dsa, ¶ms->data); |
580 | |
|
581 | 0 | if (params->length <= 0) { |
582 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
583 | 0 | ASN1_STRING_free(params); |
584 | 0 | return 0; |
585 | 0 | } |
586 | | |
587 | 0 | *pstrtype = V_ASN1_SEQUENCE; |
588 | 0 | *pstr = params; |
589 | 0 | return 1; |
590 | 0 | } |
591 | | |
592 | | static int prepare_dsa_params(const void *dsa, int nid, int save, |
593 | | void **pstr, int *pstrtype) |
594 | 0 | { |
595 | 0 | const BIGNUM *p = DSA_get0_p(dsa); |
596 | 0 | const BIGNUM *q = DSA_get0_q(dsa); |
597 | 0 | const BIGNUM *g = DSA_get0_g(dsa); |
598 | |
|
599 | 0 | if (save && p != NULL && q != NULL && g != NULL) |
600 | 0 | return encode_dsa_params(dsa, nid, pstr, pstrtype); |
601 | | |
602 | 0 | *pstr = NULL; |
603 | 0 | *pstrtype = V_ASN1_UNDEF; |
604 | 0 | return 1; |
605 | 0 | } |
606 | | |
607 | | static int dsa_spki_pub_to_der(const void *dsa, unsigned char **pder, |
608 | | ossl_unused void *ctx) |
609 | 0 | { |
610 | 0 | const BIGNUM *bn = NULL; |
611 | 0 | ASN1_INTEGER *pub_key = NULL; |
612 | 0 | int ret; |
613 | |
|
614 | 0 | if ((bn = DSA_get0_pub_key(dsa)) == NULL) { |
615 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY); |
616 | 0 | return 0; |
617 | 0 | } |
618 | 0 | if ((pub_key = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) { |
619 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_BN_ERROR); |
620 | 0 | return 0; |
621 | 0 | } |
622 | | |
623 | 0 | ret = i2d_ASN1_INTEGER(pub_key, pder); |
624 | |
|
625 | 0 | ASN1_STRING_clear_free(pub_key); |
626 | 0 | return ret; |
627 | 0 | } |
628 | | |
629 | | static int dsa_pki_priv_to_der(const void *dsa, unsigned char **pder, |
630 | | ossl_unused void *ctx) |
631 | 0 | { |
632 | 0 | const BIGNUM *bn = NULL; |
633 | 0 | ASN1_INTEGER *priv_key = NULL; |
634 | 0 | int ret; |
635 | |
|
636 | 0 | if ((bn = DSA_get0_priv_key(dsa)) == NULL) { |
637 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY); |
638 | 0 | return 0; |
639 | 0 | } |
640 | 0 | if ((priv_key = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) { |
641 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_BN_ERROR); |
642 | 0 | return 0; |
643 | 0 | } |
644 | | |
645 | 0 | ret = i2d_ASN1_INTEGER(priv_key, pder); |
646 | |
|
647 | 0 | ASN1_STRING_clear_free(priv_key); |
648 | 0 | return ret; |
649 | 0 | } |
650 | | |
651 | | k2d_NOCTX(dsa_prv, i2d_DSAPrivateKey) |
652 | | k2d_NOCTX(dsa_pub, i2d_DSAPublicKey) |
653 | | k2d_NOCTX(dsa_param, i2d_DSAparams) |
654 | | |
655 | 0 | # define dsa_epki_priv_to_der dsa_pki_priv_to_der |
656 | | |
657 | 0 | # define dsa_type_specific_priv_to_der dsa_prv_k2d |
658 | 0 | # define dsa_type_specific_pub_to_der dsa_pub_k2d |
659 | 0 | # define dsa_type_specific_params_to_der dsa_param_k2d |
660 | | |
661 | 0 | # define dsa_check_key_type NULL |
662 | 0 | # define dsa_evp_type EVP_PKEY_DSA |
663 | 0 | # define dsa_pem_type "DSA" |
664 | | #endif |
665 | | |
666 | | /* ---------------------------------------------------------------------- */ |
667 | | |
668 | | #ifndef OPENSSL_NO_EC |
669 | | static int prepare_ec_explicit_params(const void *eckey, |
670 | | void **pstr, int *pstrtype) |
671 | 0 | { |
672 | 0 | ASN1_STRING *params = ASN1_STRING_new(); |
673 | |
|
674 | 0 | if (params == NULL) { |
675 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
676 | 0 | return 0; |
677 | 0 | } |
678 | | |
679 | 0 | params->length = i2d_ECParameters(eckey, ¶ms->data); |
680 | 0 | if (params->length <= 0) { |
681 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
682 | 0 | ASN1_STRING_free(params); |
683 | 0 | return 0; |
684 | 0 | } |
685 | | |
686 | 0 | *pstrtype = V_ASN1_SEQUENCE; |
687 | 0 | *pstr = params; |
688 | 0 | return 1; |
689 | 0 | } |
690 | | |
691 | | /* |
692 | | * This implements EcpkParameters, where the CHOICE is based on whether there |
693 | | * is a curve name (curve nid) to be found or not. See RFC 3279 for details. |
694 | | */ |
695 | | static int prepare_ec_params(const void *eckey, int nid, int save, |
696 | | void **pstr, int *pstrtype) |
697 | 0 | { |
698 | 0 | int curve_nid; |
699 | 0 | const EC_GROUP *group = EC_KEY_get0_group(eckey); |
700 | 0 | ASN1_OBJECT *params = NULL; |
701 | |
|
702 | 0 | if (group == NULL) |
703 | 0 | return 0; |
704 | 0 | curve_nid = EC_GROUP_get_curve_name(group); |
705 | 0 | if (curve_nid != NID_undef) { |
706 | 0 | params = OBJ_nid2obj(curve_nid); |
707 | 0 | if (params == NULL) |
708 | 0 | return 0; |
709 | 0 | } |
710 | | |
711 | 0 | if (curve_nid != NID_undef |
712 | 0 | && (EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE)) { |
713 | | /* The CHOICE came to namedCurve */ |
714 | 0 | if (OBJ_length(params) == 0) { |
715 | | /* Some curves might not have an associated OID */ |
716 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_OID); |
717 | 0 | ASN1_OBJECT_free(params); |
718 | 0 | return 0; |
719 | 0 | } |
720 | 0 | *pstr = params; |
721 | 0 | *pstrtype = V_ASN1_OBJECT; |
722 | 0 | return 1; |
723 | 0 | } else { |
724 | | /* The CHOICE came to ecParameters */ |
725 | 0 | return prepare_ec_explicit_params(eckey, pstr, pstrtype); |
726 | 0 | } |
727 | 0 | } |
728 | | |
729 | | static int ec_spki_pub_to_der(const void *eckey, unsigned char **pder, |
730 | | ossl_unused void *ctx) |
731 | 0 | { |
732 | 0 | if (EC_KEY_get0_public_key(eckey) == NULL) { |
733 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY); |
734 | 0 | return 0; |
735 | 0 | } |
736 | 0 | return i2o_ECPublicKey(eckey, pder); |
737 | 0 | } |
738 | | |
739 | | static int ec_pki_priv_to_der(const void *veckey, unsigned char **pder, |
740 | | ossl_unused void *ctx) |
741 | 0 | { |
742 | 0 | EC_KEY *eckey = (EC_KEY *)veckey; |
743 | 0 | unsigned int old_flags; |
744 | 0 | int ret = 0; |
745 | | |
746 | | /* |
747 | | * For PKCS8 the curve name appears in the PKCS8_PRIV_KEY_INFO object |
748 | | * as the pkeyalg->parameter field. (For a named curve this is an OID) |
749 | | * The pkey field is an octet string that holds the encoded |
750 | | * ECPrivateKey SEQUENCE with the optional parameters field omitted. |
751 | | * We omit this by setting the EC_PKEY_NO_PARAMETERS flag. |
752 | | */ |
753 | 0 | old_flags = EC_KEY_get_enc_flags(eckey); /* save old flags */ |
754 | 0 | EC_KEY_set_enc_flags(eckey, old_flags | EC_PKEY_NO_PARAMETERS); |
755 | 0 | ret = i2d_ECPrivateKey(eckey, pder); |
756 | 0 | EC_KEY_set_enc_flags(eckey, old_flags); /* restore old flags */ |
757 | 0 | return ret; /* return the length of the der encoded data */ |
758 | 0 | } |
759 | | |
760 | | k2d_NOCTX(ec_param, i2d_ECParameters) |
761 | | k2d_NOCTX(ec_prv, i2d_ECPrivateKey) |
762 | | |
763 | 0 | # define ec_epki_priv_to_der ec_pki_priv_to_der |
764 | | |
765 | 0 | # define ec_type_specific_params_to_der ec_param_k2d |
766 | | /* No ec_type_specific_pub_to_der, there simply is no such thing */ |
767 | 0 | # define ec_type_specific_priv_to_der ec_prv_k2d |
768 | | |
769 | 0 | # define ec_check_key_type NULL |
770 | 0 | # define ec_evp_type EVP_PKEY_EC |
771 | 0 | # define ec_pem_type "EC" |
772 | | |
773 | | # ifndef OPENSSL_NO_SM2 |
774 | | /* |
775 | | * Albeit SM2 is a slightly different algorithm than ECDSA, the key type |
776 | | * encoding (in all places where an AlgorithmIdentifier is produced, such |
777 | | * as PrivateKeyInfo and SubjectPublicKeyInfo) is the same as for ECC keys |
778 | | * according to the example in GM/T 0015-2012, appendix D.2. |
779 | | * This leaves the distinction of SM2 keys to the EC group (which is found |
780 | | * in AlgorithmIdentified.params). |
781 | | */ |
782 | 0 | # define sm2_evp_type ec_evp_type |
783 | 0 | # define sm2_pem_type "SM2" |
784 | | # endif |
785 | | #endif |
786 | | |
787 | | /* ---------------------------------------------------------------------- */ |
788 | | |
789 | | #ifndef OPENSSL_NO_ECX |
790 | 0 | # define prepare_ecx_params NULL |
791 | | |
792 | | static int ecx_spki_pub_to_der(const void *vecxkey, unsigned char **pder, |
793 | | ossl_unused void *ctx) |
794 | 0 | { |
795 | 0 | const ECX_KEY *ecxkey = vecxkey; |
796 | 0 | unsigned char *keyblob; |
797 | |
|
798 | 0 | if (ecxkey == NULL) { |
799 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); |
800 | 0 | return 0; |
801 | 0 | } |
802 | | |
803 | 0 | keyblob = OPENSSL_memdup(ecxkey->pubkey, ecxkey->keylen); |
804 | 0 | if (keyblob == NULL) |
805 | 0 | return 0; |
806 | | |
807 | 0 | *pder = keyblob; |
808 | 0 | return (int)ecxkey->keylen; |
809 | 0 | } |
810 | | |
811 | | static int ecx_pki_priv_to_der(const void *vecxkey, unsigned char **pder, |
812 | | ossl_unused void *ctx) |
813 | 0 | { |
814 | 0 | const ECX_KEY *ecxkey = vecxkey; |
815 | 0 | ASN1_OCTET_STRING oct; |
816 | 0 | int keybloblen; |
817 | |
|
818 | 0 | if (ecxkey == NULL || ecxkey->privkey == NULL) { |
819 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); |
820 | 0 | return 0; |
821 | 0 | } |
822 | | |
823 | 0 | oct.data = ecxkey->privkey; |
824 | 0 | oct.length = (int)ecxkey->keylen; |
825 | 0 | oct.flags = 0; |
826 | |
|
827 | 0 | keybloblen = i2d_ASN1_OCTET_STRING(&oct, pder); |
828 | 0 | if (keybloblen < 0) { |
829 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB); |
830 | 0 | return 0; |
831 | 0 | } |
832 | | |
833 | 0 | return keybloblen; |
834 | 0 | } |
835 | | |
836 | 0 | # define ecx_epki_priv_to_der ecx_pki_priv_to_der |
837 | | |
838 | | /* |
839 | | * ED25519, ED448, X25519 and X448 only has PKCS#8 / SubjectPublicKeyInfo |
840 | | * representation, so we don't define ecx_type_specific_[priv,pub,params]_to_der. |
841 | | */ |
842 | | |
843 | 0 | # define ecx_check_key_type NULL |
844 | | |
845 | 0 | # define ed25519_evp_type EVP_PKEY_ED25519 |
846 | 0 | # define ed448_evp_type EVP_PKEY_ED448 |
847 | 0 | # define x25519_evp_type EVP_PKEY_X25519 |
848 | 0 | # define x448_evp_type EVP_PKEY_X448 |
849 | 0 | # define ed25519_pem_type "ED25519" |
850 | 0 | # define ed448_pem_type "ED448" |
851 | 0 | # define x25519_pem_type "X25519" |
852 | 0 | # define x448_pem_type "X448" |
853 | | #endif |
854 | | |
855 | | /* ---------------------------------------------------------------------- */ |
856 | | |
857 | | #ifndef OPENSSL_NO_ML_DSA |
858 | | static int ml_dsa_spki_pub_to_der(const void *vkey, unsigned char **pder, |
859 | | ossl_unused void *ctx) |
860 | 0 | { |
861 | 0 | return ossl_ml_dsa_i2d_pubkey(vkey, pder); |
862 | 0 | } |
863 | | |
864 | | static int ml_dsa_pki_priv_to_der(const void *vkey, unsigned char **pder, |
865 | | void *vctx) |
866 | 0 | { |
867 | 0 | KEY2ANY_CTX *ctx = vctx; |
868 | |
|
869 | 0 | return ossl_ml_dsa_i2d_prvkey(vkey, pder, ctx->provctx); |
870 | 0 | } |
871 | | |
872 | 0 | # define ml_dsa_epki_priv_to_der ml_dsa_pki_priv_to_der |
873 | 0 | # define prepare_ml_dsa_params NULL |
874 | 0 | # define ml_dsa_check_key_type NULL |
875 | | |
876 | 0 | # define ml_dsa_44_evp_type EVP_PKEY_ML_DSA_44 |
877 | 0 | # define ml_dsa_44_pem_type "ML-DSA-44" |
878 | 0 | # define ml_dsa_65_evp_type EVP_PKEY_ML_DSA_65 |
879 | 0 | # define ml_dsa_65_pem_type "ML-DSA-65" |
880 | 0 | # define ml_dsa_87_evp_type EVP_PKEY_ML_DSA_87 |
881 | 0 | # define ml_dsa_87_pem_type "ML-DSA-87" |
882 | | #endif /* OPENSSL_NO_ML_DSA */ |
883 | | |
884 | | /* ---------------------------------------------------------------------- */ |
885 | | |
886 | | #ifndef OPENSSL_NO_ML_KEM |
887 | | |
888 | | static int ml_kem_spki_pub_to_der(const void *vkey, unsigned char **pder, |
889 | | ossl_unused void *ctx) |
890 | 0 | { |
891 | 0 | return ossl_ml_kem_i2d_pubkey(vkey, pder); |
892 | 0 | } |
893 | | |
894 | | static int ml_kem_pki_priv_to_der(const void *vkey, unsigned char **pder, |
895 | | void *vctx) |
896 | 0 | { |
897 | 0 | KEY2ANY_CTX *ctx = vctx; |
898 | |
|
899 | 0 | return ossl_ml_kem_i2d_prvkey(vkey, pder, ctx->provctx); |
900 | 0 | } |
901 | | |
902 | 0 | # define ml_kem_epki_priv_to_der ml_kem_pki_priv_to_der |
903 | 0 | # define prepare_ml_kem_params NULL |
904 | 0 | # define ml_kem_check_key_type NULL |
905 | | |
906 | 0 | # define ml_kem_512_evp_type EVP_PKEY_ML_KEM_512 |
907 | 0 | # define ml_kem_512_pem_type "ML-KEM-512" |
908 | 0 | # define ml_kem_768_evp_type EVP_PKEY_ML_KEM_768 |
909 | 0 | # define ml_kem_768_pem_type "ML-KEM-768" |
910 | 0 | # define ml_kem_1024_evp_type EVP_PKEY_ML_KEM_1024 |
911 | 0 | # define ml_kem_1024_pem_type "ML-KEM-1024" |
912 | | #endif |
913 | | |
914 | | /* ---------------------------------------------------------------------- */ |
915 | | |
916 | | /* |
917 | | * Helper functions to prepare RSA-PSS params for encoding. We would |
918 | | * have simply written the whole AlgorithmIdentifier, but existing libcrypto |
919 | | * functionality doesn't allow that. |
920 | | */ |
921 | | |
922 | | static int prepare_rsa_params(const void *rsa, int nid, int save, |
923 | | void **pstr, int *pstrtype) |
924 | 0 | { |
925 | 0 | const RSA_PSS_PARAMS_30 *pss = ossl_rsa_get0_pss_params_30((RSA *)rsa); |
926 | |
|
927 | 0 | *pstr = NULL; |
928 | |
|
929 | 0 | switch (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK)) { |
930 | 0 | case RSA_FLAG_TYPE_RSA: |
931 | | /* If plain RSA, the parameters shall be NULL */ |
932 | 0 | *pstrtype = V_ASN1_NULL; |
933 | 0 | return 1; |
934 | 0 | case RSA_FLAG_TYPE_RSASSAPSS: |
935 | 0 | if (ossl_rsa_pss_params_30_is_unrestricted(pss)) { |
936 | 0 | *pstrtype = V_ASN1_UNDEF; |
937 | 0 | return 1; |
938 | 0 | } else { |
939 | 0 | ASN1_STRING *astr = NULL; |
940 | 0 | WPACKET pkt; |
941 | 0 | unsigned char *str = NULL; |
942 | 0 | size_t str_sz = 0; |
943 | 0 | int i; |
944 | |
|
945 | 0 | for (i = 0; i < 2; i++) { |
946 | 0 | switch (i) { |
947 | 0 | case 0: |
948 | 0 | if (!WPACKET_init_null_der(&pkt)) |
949 | 0 | goto err; |
950 | 0 | break; |
951 | 0 | case 1: |
952 | 0 | if ((str = OPENSSL_malloc(str_sz)) == NULL |
953 | 0 | || !WPACKET_init_der(&pkt, str, str_sz)) { |
954 | 0 | WPACKET_cleanup(&pkt); |
955 | 0 | goto err; |
956 | 0 | } |
957 | 0 | break; |
958 | 0 | } |
959 | 0 | if (!ossl_DER_w_RSASSA_PSS_params(&pkt, -1, pss) |
960 | 0 | || !WPACKET_finish(&pkt) |
961 | 0 | || !WPACKET_get_total_written(&pkt, &str_sz)) { |
962 | 0 | WPACKET_cleanup(&pkt); |
963 | 0 | goto err; |
964 | 0 | } |
965 | 0 | WPACKET_cleanup(&pkt); |
966 | | |
967 | | /* |
968 | | * If no PSS parameters are going to be written, there's no |
969 | | * point going for another iteration. |
970 | | * This saves us from getting |str| allocated just to have it |
971 | | * immediately de-allocated. |
972 | | */ |
973 | 0 | if (str_sz == 0) |
974 | 0 | break; |
975 | 0 | } |
976 | | |
977 | 0 | if ((astr = ASN1_STRING_new()) == NULL) |
978 | 0 | goto err; |
979 | 0 | *pstrtype = V_ASN1_SEQUENCE; |
980 | 0 | ASN1_STRING_set0(astr, str, (int)str_sz); |
981 | 0 | *pstr = astr; |
982 | |
|
983 | 0 | return 1; |
984 | 0 | err: |
985 | 0 | OPENSSL_free(str); |
986 | 0 | return 0; |
987 | 0 | } |
988 | 0 | } |
989 | | |
990 | | /* Currently unsupported RSA key type */ |
991 | 0 | return 0; |
992 | 0 | } |
993 | | |
994 | | k2d_NOCTX(rsa_prv, i2d_RSAPrivateKey) |
995 | | k2d_NOCTX(rsa_pub, i2d_RSAPublicKey) |
996 | | |
997 | | /* |
998 | | * RSA is extremely simple, as PKCS#1 is used for the PKCS#8 |privateKey| |
999 | | * field as well as the SubjectPublicKeyInfo |subjectPublicKey| field. |
1000 | | */ |
1001 | 0 | #define rsa_pki_priv_to_der rsa_type_specific_priv_to_der |
1002 | 0 | #define rsa_epki_priv_to_der rsa_type_specific_priv_to_der |
1003 | 0 | #define rsa_spki_pub_to_der rsa_type_specific_pub_to_der |
1004 | 0 | #define rsa_type_specific_priv_to_der rsa_prv_k2d |
1005 | 0 | #define rsa_type_specific_pub_to_der rsa_pub_k2d |
1006 | | #define rsa_type_specific_params_to_der NULL |
1007 | | |
1008 | | static int rsa_check_key_type(const void *rsa, int expected_type) |
1009 | 0 | { |
1010 | 0 | switch (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK)) { |
1011 | 0 | case RSA_FLAG_TYPE_RSA: |
1012 | 0 | return expected_type == EVP_PKEY_RSA; |
1013 | 0 | case RSA_FLAG_TYPE_RSASSAPSS: |
1014 | 0 | return expected_type == EVP_PKEY_RSA_PSS; |
1015 | 0 | } |
1016 | | |
1017 | | /* Currently unsupported RSA key type */ |
1018 | 0 | return EVP_PKEY_NONE; |
1019 | 0 | } |
1020 | | |
1021 | 0 | #define rsa_evp_type EVP_PKEY_RSA |
1022 | 0 | #define rsapss_evp_type EVP_PKEY_RSA_PSS |
1023 | 0 | #define rsa_pem_type "RSA" |
1024 | 0 | #define rsapss_pem_type "RSA-PSS" |
1025 | | |
1026 | | /* ---------------------------------------------------------------------- */ |
1027 | | |
1028 | | #ifndef OPENSSL_NO_SLH_DSA |
1029 | 0 | # define prepare_slh_dsa_params NULL |
1030 | | |
1031 | | static int slh_dsa_spki_pub_to_der(const void *vkey, unsigned char **pder, |
1032 | | ossl_unused void *ctx) |
1033 | 0 | { |
1034 | 0 | const SLH_DSA_KEY *key = vkey; |
1035 | 0 | uint8_t *key_blob; |
1036 | 0 | size_t key_len; |
1037 | |
|
1038 | 0 | if (key == NULL) { |
1039 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); |
1040 | 0 | return 0; |
1041 | 0 | } |
1042 | 0 | key_len = ossl_slh_dsa_key_get_pub_len(key); |
1043 | 0 | key_blob = OPENSSL_memdup(ossl_slh_dsa_key_get_pub(key), key_len); |
1044 | 0 | if (key_blob == NULL) |
1045 | 0 | return 0; |
1046 | | |
1047 | 0 | *pder = key_blob; |
1048 | 0 | return (int)key_len; |
1049 | 0 | } |
1050 | | |
1051 | | static int slh_dsa_pki_priv_to_der(const void *vkey, unsigned char **pder, |
1052 | | ossl_unused void *ctx) |
1053 | 0 | { |
1054 | 0 | const SLH_DSA_KEY *key = vkey; |
1055 | 0 | size_t len; |
1056 | |
|
1057 | 0 | if (ossl_slh_dsa_key_get_priv(key) == NULL) { |
1058 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); |
1059 | 0 | return 0; |
1060 | 0 | } |
1061 | 0 | len = ossl_slh_dsa_key_get_priv_len(key); |
1062 | |
|
1063 | 0 | if (pder != NULL |
1064 | 0 | && ((*pder = OPENSSL_memdup(ossl_slh_dsa_key_get_priv(key), len)) == NULL)) |
1065 | 0 | return 0; |
1066 | | |
1067 | 0 | return (int)len; |
1068 | 0 | } |
1069 | 0 | # define slh_dsa_epki_priv_to_der slh_dsa_pki_priv_to_der |
1070 | | |
1071 | | /* SLH_DSA only has PKCS#8 / SubjectPublicKeyInfo representations. */ |
1072 | | |
1073 | 0 | # define slh_dsa_check_key_type NULL |
1074 | 0 | # define slh_dsa_sha2_128s_evp_type EVP_PKEY_SLH_DSA_SHA2_128S |
1075 | 0 | # define slh_dsa_sha2_128f_evp_type EVP_PKEY_SLH_DSA_SHA2_128F |
1076 | 0 | # define slh_dsa_sha2_192s_evp_type EVP_PKEY_SLH_DSA_SHA2_192S |
1077 | 0 | # define slh_dsa_sha2_192f_evp_type EVP_PKEY_SLH_DSA_SHA2_192F |
1078 | 0 | # define slh_dsa_sha2_256s_evp_type EVP_PKEY_SLH_DSA_SHA2_256S |
1079 | 0 | # define slh_dsa_sha2_256f_evp_type EVP_PKEY_SLH_DSA_SHA2_256F |
1080 | 0 | # define slh_dsa_shake_128s_evp_type EVP_PKEY_SLH_DSA_SHAKE_128S |
1081 | 0 | # define slh_dsa_shake_128f_evp_type EVP_PKEY_SLH_DSA_SHAKE_128F |
1082 | 0 | # define slh_dsa_shake_192s_evp_type EVP_PKEY_SLH_DSA_SHAKE_192S |
1083 | 0 | # define slh_dsa_shake_192f_evp_type EVP_PKEY_SLH_DSA_SHAKE_192F |
1084 | 0 | # define slh_dsa_shake_256s_evp_type EVP_PKEY_SLH_DSA_SHAKE_256S |
1085 | 0 | # define slh_dsa_shake_256f_evp_type EVP_PKEY_SLH_DSA_SHAKE_256F |
1086 | | # define slh_dsa_sha2_128s_input_type "SLH-DSA-SHA2-128s" |
1087 | | # define slh_dsa_sha2_128f_input_type "SLH-DSA-SHA2-128f" |
1088 | | # define slh_dsa_sha2_192s_input_type "SLH-DSA-SHA2-192s" |
1089 | | # define slh_dsa_sha2_192f_input_type "SLH-DSA-SHA2-192f" |
1090 | | # define slh_dsa_sha2_256s_input_type "SLH-DSA-SHA2-256s" |
1091 | | # define slh_dsa_sha2_256f_input_type "SLH-DSA-SHA2-256f" |
1092 | | # define slh_dsa_shake_128s_input_type "SLH-DSA-SHAKE-128s" |
1093 | | # define slh_dsa_shake_128f_input_type "SLH-DSA-SHAKE-128f" |
1094 | | # define slh_dsa_shake_192s_input_type "SLH-DSA-SHAKE-192s" |
1095 | | # define slh_dsa_shake_192f_input_type "SLH-DSA-SHAKE-192f" |
1096 | | # define slh_dsa_shake_256s_input_type "SLH-DSA-SHAKE-256s" |
1097 | | # define slh_dsa_shake_256f_input_type "SLH-DSA-SHAKE-256f" |
1098 | 0 | # define slh_dsa_sha2_128s_pem_type "SLH-DSA-SHA2-128s" |
1099 | 0 | # define slh_dsa_sha2_128f_pem_type "SLH-DSA-SHA2-128f" |
1100 | 0 | # define slh_dsa_sha2_192s_pem_type "SLH-DSA-SHA2-192s" |
1101 | 0 | # define slh_dsa_sha2_192f_pem_type "SLH-DSA-SHA2-192f" |
1102 | 0 | # define slh_dsa_sha2_256s_pem_type "SLH-DSA-SHA2-256s" |
1103 | 0 | # define slh_dsa_sha2_256f_pem_type "SLH-DSA-SHA2-256f" |
1104 | 0 | # define slh_dsa_shake_128s_pem_type "SLH-DSA-SHAKE-128s" |
1105 | 0 | # define slh_dsa_shake_128f_pem_type "SLH-DSA-SHAKE-128f" |
1106 | 0 | # define slh_dsa_shake_192s_pem_type "SLH-DSA-SHAKE-192s" |
1107 | 0 | # define slh_dsa_shake_192f_pem_type "SLH-DSA-SHAKE-192f" |
1108 | 0 | # define slh_dsa_shake_256s_pem_type "SLH-DSA-SHAKE-256s" |
1109 | 0 | # define slh_dsa_shake_256f_pem_type "SLH-DSA-SHAKE-256f" |
1110 | | #endif /* OPENSSL_NO_SLH_DSA */ |
1111 | | |
1112 | | /* ---------------------------------------------------------------------- */ |
1113 | | |
1114 | | static OSSL_FUNC_decoder_newctx_fn key2any_newctx; |
1115 | | static OSSL_FUNC_decoder_freectx_fn key2any_freectx; |
1116 | | |
1117 | | static void *key2any_newctx(void *provctx) |
1118 | 0 | { |
1119 | 0 | KEY2ANY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx)); |
1120 | |
|
1121 | 0 | if (ctx != NULL) { |
1122 | 0 | ctx->provctx = provctx; |
1123 | 0 | ctx->save_parameters = 1; |
1124 | 0 | } |
1125 | |
|
1126 | 0 | return ctx; |
1127 | 0 | } |
1128 | | |
1129 | | static void key2any_freectx(void *vctx) |
1130 | 0 | { |
1131 | 0 | KEY2ANY_CTX *ctx = vctx; |
1132 | |
|
1133 | 0 | ossl_pw_clear_passphrase_data(&ctx->pwdata); |
1134 | 0 | EVP_CIPHER_free(ctx->cipher); |
1135 | 0 | OPENSSL_free(ctx); |
1136 | 0 | } |
1137 | | |
1138 | | /* Machine generated by util/perl/OpenSSL/paramnames.pm */ |
1139 | | #ifndef key2any_set_ctx_params_list |
1140 | | static const OSSL_PARAM key2any_set_ctx_params_list[] = { |
1141 | | OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_CIPHER, NULL, 0), |
1142 | | OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_PROPERTIES, NULL, 0), |
1143 | | OSSL_PARAM_int(OSSL_ENCODER_PARAM_SAVE_PARAMETERS, NULL), |
1144 | | OSSL_PARAM_END |
1145 | | }; |
1146 | | #endif |
1147 | | |
1148 | | #ifndef key2any_set_ctx_params_st |
1149 | | struct key2any_set_ctx_params_st { |
1150 | | OSSL_PARAM *cipher; |
1151 | | OSSL_PARAM *propq; |
1152 | | OSSL_PARAM *svprm; |
1153 | | }; |
1154 | | #endif |
1155 | | |
1156 | | #ifndef key2any_set_ctx_params_decoder |
1157 | | static int key2any_set_ctx_params_decoder |
1158 | | (const OSSL_PARAM *p, struct key2any_set_ctx_params_st *r) |
1159 | 0 | { |
1160 | 0 | const char *s; |
1161 | |
|
1162 | 0 | memset(r, 0, sizeof(*r)); |
1163 | 0 | if (p != NULL) |
1164 | 0 | for (; (s = p->key) != NULL; p++) |
1165 | 0 | switch(s[0]) { |
1166 | 0 | default: |
1167 | 0 | break; |
1168 | 0 | case 'c': |
1169 | 0 | if (ossl_likely(strcmp("ipher", s + 1) == 0)) { |
1170 | | /* ENCODER_PARAM_CIPHER */ |
1171 | 0 | if (ossl_unlikely(r->cipher != NULL)) { |
1172 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
1173 | 0 | "param %s is repeated", s); |
1174 | 0 | return 0; |
1175 | 0 | } |
1176 | 0 | r->cipher = (OSSL_PARAM *)p; |
1177 | 0 | } |
1178 | 0 | break; |
1179 | 0 | case 'p': |
1180 | 0 | if (ossl_likely(strcmp("roperties", s + 1) == 0)) { |
1181 | | /* ENCODER_PARAM_PROPERTIES */ |
1182 | 0 | if (ossl_unlikely(r->propq != NULL)) { |
1183 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
1184 | 0 | "param %s is repeated", s); |
1185 | 0 | return 0; |
1186 | 0 | } |
1187 | 0 | r->propq = (OSSL_PARAM *)p; |
1188 | 0 | } |
1189 | 0 | break; |
1190 | 0 | case 's': |
1191 | 0 | if (ossl_likely(strcmp("ave-parameters", s + 1) == 0)) { |
1192 | | /* ENCODER_PARAM_SAVE_PARAMETERS */ |
1193 | 0 | if (ossl_unlikely(r->svprm != NULL)) { |
1194 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
1195 | 0 | "param %s is repeated", s); |
1196 | 0 | return 0; |
1197 | 0 | } |
1198 | 0 | r->svprm = (OSSL_PARAM *)p; |
1199 | 0 | } |
1200 | 0 | } |
1201 | 0 | return 1; |
1202 | 0 | } |
1203 | | #endif |
1204 | | /* End of machine generated */ |
1205 | | |
1206 | | static const OSSL_PARAM *key2any_settable_ctx_params(ossl_unused void *provctx) |
1207 | 0 | { |
1208 | 0 | return key2any_set_ctx_params_list; |
1209 | 0 | } |
1210 | | |
1211 | | static int key2any_set_ctx_params(void *vctx, const OSSL_PARAM params[]) |
1212 | 0 | { |
1213 | 0 | KEY2ANY_CTX *ctx = vctx; |
1214 | 0 | struct key2any_set_ctx_params_st p; |
1215 | |
|
1216 | 0 | if (ctx == NULL || !key2any_set_ctx_params_decoder(params, &p)) |
1217 | 0 | return 0; |
1218 | | |
1219 | 0 | if (p.cipher != NULL) { |
1220 | 0 | const char *ciphername = NULL; |
1221 | 0 | const char *props = NULL; |
1222 | 0 | OSSL_LIB_CTX *libctx; |
1223 | |
|
1224 | 0 | if (!OSSL_PARAM_get_utf8_string_ptr(p.cipher, &ciphername)) |
1225 | 0 | return 0; |
1226 | 0 | if (p.propq != NULL && !OSSL_PARAM_get_utf8_string_ptr(p.propq, &props)) |
1227 | 0 | return 0; |
1228 | | |
1229 | 0 | libctx = ossl_prov_ctx_get0_libctx(ctx->provctx); |
1230 | 0 | EVP_CIPHER_free(ctx->cipher); |
1231 | 0 | ctx->cipher = NULL; |
1232 | 0 | ctx->cipher_intent = ciphername != NULL; |
1233 | 0 | if (ciphername != NULL |
1234 | 0 | && ((ctx->cipher = |
1235 | 0 | EVP_CIPHER_fetch(libctx, ciphername, props)) == NULL)) |
1236 | 0 | return 0; |
1237 | 0 | } |
1238 | | |
1239 | 0 | if (p.svprm != NULL && !OSSL_PARAM_get_int(p.svprm, &ctx->save_parameters)) |
1240 | 0 | return 0; |
1241 | | |
1242 | 0 | return 1; |
1243 | 0 | } |
1244 | | |
1245 | | static int key2any_check_selection(int selection, int selection_mask) |
1246 | 0 | { |
1247 | | /* |
1248 | | * The selections are kinda sorta "levels", i.e. each selection given |
1249 | | * here is assumed to include those following. |
1250 | | */ |
1251 | 0 | int checks[] = { |
1252 | 0 | OSSL_KEYMGMT_SELECT_PRIVATE_KEY, |
1253 | 0 | OSSL_KEYMGMT_SELECT_PUBLIC_KEY, |
1254 | 0 | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS |
1255 | 0 | }; |
1256 | 0 | size_t i; |
1257 | | |
1258 | | /* The decoder implementations made here support guessing */ |
1259 | 0 | if (selection == 0) |
1260 | 0 | return 1; |
1261 | | |
1262 | 0 | for (i = 0; i < OSSL_NELEM(checks); i++) { |
1263 | 0 | int check1 = (selection & checks[i]) != 0; |
1264 | 0 | int check2 = (selection_mask & checks[i]) != 0; |
1265 | | |
1266 | | /* |
1267 | | * If the caller asked for the currently checked bit(s), return |
1268 | | * whether the decoder description says it's supported. |
1269 | | */ |
1270 | 0 | if (check1) |
1271 | 0 | return check2; |
1272 | 0 | } |
1273 | | |
1274 | | /* This should be dead code, but just to be safe... */ |
1275 | 0 | return 0; |
1276 | 0 | } |
1277 | | |
1278 | | static int key2any_encode(KEY2ANY_CTX *ctx, OSSL_CORE_BIO *cout, |
1279 | | const void *key, int type, const char *pemname, |
1280 | | check_key_type_fn *checker, |
1281 | | key_to_der_fn *writer, |
1282 | | OSSL_PASSPHRASE_CALLBACK *pwcb, void *pwcbarg, |
1283 | | key_to_paramstring_fn *key2paramstring, |
1284 | | OSSL_i2d_of_void_ctx *key2der) |
1285 | 0 | { |
1286 | 0 | int ret = 0; |
1287 | |
|
1288 | 0 | if (key == NULL) { |
1289 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER); |
1290 | 0 | } else if (writer != NULL |
1291 | 0 | && (checker == NULL || checker(key, type))) { |
1292 | 0 | BIO *out = ossl_bio_new_from_core_bio(ctx->provctx, cout); |
1293 | |
|
1294 | 0 | if (out != NULL |
1295 | 0 | && (pwcb == NULL |
1296 | 0 | || ossl_pw_set_ossl_passphrase_cb(&ctx->pwdata, pwcb, pwcbarg))) |
1297 | 0 | ret = |
1298 | 0 | writer(out, key, type, pemname, key2paramstring, key2der, ctx); |
1299 | |
|
1300 | 0 | BIO_free(out); |
1301 | 0 | } else { |
1302 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT); |
1303 | 0 | } |
1304 | 0 | return ret; |
1305 | 0 | } |
1306 | | |
1307 | 0 | #define DO_PRIVATE_KEY_selection_mask OSSL_KEYMGMT_SELECT_PRIVATE_KEY |
1308 | | #define DO_PRIVATE_KEY(impl, type, kind, output) \ |
1309 | 0 | if ((selection & DO_PRIVATE_KEY_selection_mask) != 0) \ |
1310 | 0 | return key2any_encode(ctx, cout, key, impl##_evp_type, \ |
1311 | 0 | impl##_pem_type " PRIVATE KEY", \ |
1312 | 0 | type##_check_key_type, \ |
1313 | 0 | key_to_##kind##_##output##_priv_bio, \ |
1314 | 0 | cb, cbarg, prepare_##type##_params, \ |
1315 | 0 | type##_##kind##_priv_to_der); |
1316 | | |
1317 | 0 | #define DO_PUBLIC_KEY_selection_mask OSSL_KEYMGMT_SELECT_PUBLIC_KEY |
1318 | | #define DO_PUBLIC_KEY(impl, type, kind, output) \ |
1319 | 0 | if ((selection & DO_PUBLIC_KEY_selection_mask) != 0) \ |
1320 | 0 | return key2any_encode(ctx, cout, key, impl##_evp_type, \ |
1321 | 0 | impl##_pem_type " PUBLIC KEY", \ |
1322 | 0 | type##_check_key_type, \ |
1323 | 0 | key_to_##kind##_##output##_pub_bio, \ |
1324 | 0 | cb, cbarg, prepare_##type##_params, \ |
1325 | 0 | type##_##kind##_pub_to_der); |
1326 | | |
1327 | 0 | #define DO_PARAMETERS_selection_mask OSSL_KEYMGMT_SELECT_ALL_PARAMETERS |
1328 | | #define DO_PARAMETERS(impl, type, kind, output) \ |
1329 | 0 | if ((selection & DO_PARAMETERS_selection_mask) != 0) \ |
1330 | 0 | return key2any_encode(ctx, cout, key, impl##_evp_type, \ |
1331 | 0 | impl##_pem_type " PARAMETERS", \ |
1332 | 0 | type##_check_key_type, \ |
1333 | 0 | key_to_##kind##_##output##_param_bio, \ |
1334 | 0 | NULL, NULL, NULL, \ |
1335 | 0 | type##_##kind##_params_to_der); |
1336 | | |
1337 | | /*- |
1338 | | * Implement the kinds of output structure that can be produced. They are |
1339 | | * referred to by name, and for each name, the following macros are defined |
1340 | | * (braces not included): |
1341 | | * |
1342 | | * DO_{kind}_selection_mask |
1343 | | * |
1344 | | * A mask of selection bits that must not be zero. This is used as a |
1345 | | * selection criterion for each implementation. |
1346 | | * This mask must never be zero. |
1347 | | * |
1348 | | * DO_{kind} |
1349 | | * |
1350 | | * The performing macro. It must use the DO_ macros defined above, |
1351 | | * always in this order: |
1352 | | * |
1353 | | * - DO_PRIVATE_KEY |
1354 | | * - DO_PUBLIC_KEY |
1355 | | * - DO_PARAMETERS |
1356 | | * |
1357 | | * Any of those may be omitted, but the relative order must still be |
1358 | | * the same. |
1359 | | */ |
1360 | | |
1361 | | /* |
1362 | | * PKCS#8 defines two structures for private keys only: |
1363 | | * - PrivateKeyInfo (raw unencrypted form) |
1364 | | * - EncryptedPrivateKeyInfo (encrypted wrapping) |
1365 | | * |
1366 | | * To allow a certain amount of flexibility, we allow the routines |
1367 | | * for PrivateKeyInfo to also produce EncryptedPrivateKeyInfo if a |
1368 | | * passphrase callback has been passed to them. |
1369 | | */ |
1370 | 0 | #define DO_PrivateKeyInfo_selection_mask DO_PRIVATE_KEY_selection_mask |
1371 | | #define DO_PrivateKeyInfo(impl, type, output) \ |
1372 | 0 | DO_PRIVATE_KEY(impl, type, pki, output) |
1373 | | |
1374 | 0 | #define DO_EncryptedPrivateKeyInfo_selection_mask DO_PRIVATE_KEY_selection_mask |
1375 | | #define DO_EncryptedPrivateKeyInfo(impl, type, output) \ |
1376 | 0 | DO_PRIVATE_KEY(impl, type, epki, output) |
1377 | | |
1378 | | /* SubjectPublicKeyInfo is a structure for public keys only */ |
1379 | 0 | #define DO_SubjectPublicKeyInfo_selection_mask DO_PUBLIC_KEY_selection_mask |
1380 | | #define DO_SubjectPublicKeyInfo(impl, type, output) \ |
1381 | 0 | DO_PUBLIC_KEY(impl, type, spki, output) |
1382 | | |
1383 | | /* |
1384 | | * "type-specific" is a uniform name for key type specific output for private |
1385 | | * and public keys as well as key parameters. This is used internally in |
1386 | | * libcrypto so it doesn't have to have special knowledge about select key |
1387 | | * types, but also when no better name has been found. If there are more |
1388 | | * expressive DO_ names above, those are preferred. |
1389 | | * |
1390 | | * Three forms exist: |
1391 | | * |
1392 | | * - type_specific_keypair Only supports private and public key |
1393 | | * - type_specific_params Only supports parameters |
1394 | | * - type_specific Supports all parts of an EVP_PKEY |
1395 | | * - type_specific_no_pub Supports all parts of an EVP_PKEY |
1396 | | * except public key |
1397 | | */ |
1398 | 0 | #define DO_type_specific_params_selection_mask DO_PARAMETERS_selection_mask |
1399 | | #define DO_type_specific_params(impl, type, output) \ |
1400 | 0 | DO_PARAMETERS(impl, type, type_specific, output) |
1401 | | #define DO_type_specific_keypair_selection_mask \ |
1402 | 0 | ( DO_PRIVATE_KEY_selection_mask | DO_PUBLIC_KEY_selection_mask ) |
1403 | | #define DO_type_specific_keypair(impl, type, output) \ |
1404 | 0 | DO_PRIVATE_KEY(impl, type, type_specific, output) \ |
1405 | 0 | DO_PUBLIC_KEY(impl, type, type_specific, output) |
1406 | | #define DO_type_specific_selection_mask \ |
1407 | 0 | ( DO_type_specific_keypair_selection_mask \ |
1408 | 0 | | DO_type_specific_params_selection_mask ) |
1409 | | #define DO_type_specific(impl, type, output) \ |
1410 | 0 | DO_type_specific_keypair(impl, type, output) \ |
1411 | 0 | DO_type_specific_params(impl, type, output) |
1412 | | #define DO_type_specific_no_pub_selection_mask \ |
1413 | 0 | ( DO_PRIVATE_KEY_selection_mask | DO_PARAMETERS_selection_mask) |
1414 | | #define DO_type_specific_no_pub(impl, type, output) \ |
1415 | 0 | DO_PRIVATE_KEY(impl, type, type_specific, output) \ |
1416 | 0 | DO_type_specific_params(impl, type, output) |
1417 | | |
1418 | | /* |
1419 | | * Type specific aliases for the cases where we need to refer to them by |
1420 | | * type name. |
1421 | | * This only covers key types that are represented with i2d_{TYPE}PrivateKey, |
1422 | | * i2d_{TYPE}PublicKey and i2d_{TYPE}params / i2d_{TYPE}Parameters. |
1423 | | */ |
1424 | 0 | #define DO_RSA_selection_mask DO_type_specific_keypair_selection_mask |
1425 | 0 | #define DO_RSA(impl, type, output) DO_type_specific_keypair(impl, type, output) |
1426 | | |
1427 | 0 | #define DO_DH_selection_mask DO_type_specific_params_selection_mask |
1428 | 0 | #define DO_DH(impl, type, output) DO_type_specific_params(impl, type, output) |
1429 | | |
1430 | 0 | #define DO_DHX_selection_mask DO_type_specific_params_selection_mask |
1431 | 0 | #define DO_DHX(impl, type, output) DO_type_specific_params(impl, type, output) |
1432 | | |
1433 | 0 | #define DO_DSA_selection_mask DO_type_specific_selection_mask |
1434 | 0 | #define DO_DSA(impl, type, output) DO_type_specific(impl, type, output) |
1435 | | |
1436 | 0 | #define DO_EC_selection_mask DO_type_specific_no_pub_selection_mask |
1437 | 0 | #define DO_EC(impl, type, output) DO_type_specific_no_pub(impl, type, output) |
1438 | | |
1439 | 0 | #define DO_SM2_selection_mask DO_type_specific_no_pub_selection_mask |
1440 | 0 | #define DO_SM2(impl, type, output) DO_type_specific_no_pub(impl, type, output) |
1441 | | |
1442 | | /* PKCS#1 defines a structure for RSA private and public keys */ |
1443 | 0 | #define DO_PKCS1_selection_mask DO_RSA_selection_mask |
1444 | 0 | #define DO_PKCS1(impl, type, output) DO_RSA(impl, type, output) |
1445 | | |
1446 | | /* PKCS#3 defines a structure for DH parameters */ |
1447 | 0 | #define DO_PKCS3_selection_mask DO_DH_selection_mask |
1448 | 0 | #define DO_PKCS3(impl, type, output) DO_DH(impl, type, output) |
1449 | | /* X9.42 defines a structure for DHx parameters */ |
1450 | 0 | #define DO_X9_42_selection_mask DO_DHX_selection_mask |
1451 | 0 | #define DO_X9_42(impl, type, output) DO_DHX(impl, type, output) |
1452 | | |
1453 | | /* X9.62 defines a structure for EC keys and parameters */ |
1454 | 0 | #define DO_X9_62_selection_mask DO_EC_selection_mask |
1455 | 0 | #define DO_X9_62(impl, type, output) DO_EC(impl, type, output) |
1456 | | |
1457 | | /* |
1458 | | * MAKE_ENCODER is the single driver for creating OSSL_DISPATCH tables. |
1459 | | * It takes the following arguments: |
1460 | | * |
1461 | | * impl This is the key type name that's being implemented. |
1462 | | * type This is the type name for the set of functions that implement |
1463 | | * the key type. For example, ed25519, ed448, x25519 and x448 |
1464 | | * are all implemented with the exact same set of functions. |
1465 | | * kind What kind of support to implement. These translate into |
1466 | | * the DO_##kind macros above. |
1467 | | * output The output type to implement. may be der or pem. |
1468 | | * |
1469 | | * The resulting OSSL_DISPATCH array gets the following name (expressed in |
1470 | | * C preprocessor terms) from those arguments: |
1471 | | * |
1472 | | * ossl_##impl##_to_##kind##_##output##_encoder_functions |
1473 | | */ |
1474 | | #define MAKE_ENCODER(impl, type, kind, output) \ |
1475 | | static OSSL_FUNC_encoder_import_object_fn \ |
1476 | | impl##_to_##kind##_##output##_import_object; \ |
1477 | | static OSSL_FUNC_encoder_free_object_fn \ |
1478 | | impl##_to_##kind##_##output##_free_object; \ |
1479 | | static OSSL_FUNC_encoder_encode_fn \ |
1480 | | impl##_to_##kind##_##output##_encode; \ |
1481 | | \ |
1482 | | static void * \ |
1483 | | impl##_to_##kind##_##output##_import_object(void *vctx, int selection, \ |
1484 | | const OSSL_PARAM params[]) \ |
1485 | 0 | { \ |
1486 | 0 | KEY2ANY_CTX *ctx = vctx; \ |
1487 | 0 | \ |
1488 | 0 | return ossl_prov_import_key(ossl_##impl##_keymgmt_functions, \ |
1489 | 0 | ctx->provctx, selection, params); \ |
1490 | 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 |
1491 | | static void impl##_to_##kind##_##output##_free_object(void *key) \ |
1492 | 0 | { \ |
1493 | 0 | ossl_prov_free_key(ossl_##impl##_keymgmt_functions, key); \ |
1494 | 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 |
1495 | | static int impl##_to_##kind##_##output##_does_selection(void *ctx, \ |
1496 | | int selection) \ |
1497 | 0 | { \ |
1498 | 0 | return key2any_check_selection(selection, \ |
1499 | 0 | DO_##kind##_selection_mask); \ |
1500 | 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 |
1501 | | static int \ |
1502 | | impl##_to_##kind##_##output##_encode(void *ctx, OSSL_CORE_BIO *cout, \ |
1503 | | const void *key, \ |
1504 | | const OSSL_PARAM key_abstract[], \ |
1505 | | int selection, \ |
1506 | | OSSL_PASSPHRASE_CALLBACK *cb, \ |
1507 | | void *cbarg) \ |
1508 | 0 | { \ |
1509 | 0 | /* We don't deal with abstract objects */ \ |
1510 | 0 | if (key_abstract != NULL) { \ |
1511 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT); \ |
1512 | 0 | return 0; \ |
1513 | 0 | } \ |
1514 | 0 | DO_##kind(impl, type, output) \ |
1515 | 0 | \ |
1516 | 0 | ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT); \ |
1517 | 0 | return 0; \ |
1518 | 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 |
1519 | | const OSSL_DISPATCH \ |
1520 | | ossl_##impl##_to_##kind##_##output##_encoder_functions[] = { \ |
1521 | | { OSSL_FUNC_ENCODER_NEWCTX, \ |
1522 | | (void (*)(void))key2any_newctx }, \ |
1523 | | { OSSL_FUNC_ENCODER_FREECTX, \ |
1524 | | (void (*)(void))key2any_freectx }, \ |
1525 | | { OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS, \ |
1526 | | (void (*)(void))key2any_settable_ctx_params }, \ |
1527 | | { OSSL_FUNC_ENCODER_SET_CTX_PARAMS, \ |
1528 | | (void (*)(void))key2any_set_ctx_params }, \ |
1529 | | { OSSL_FUNC_ENCODER_DOES_SELECTION, \ |
1530 | | (void (*)(void))impl##_to_##kind##_##output##_does_selection }, \ |
1531 | | { OSSL_FUNC_ENCODER_IMPORT_OBJECT, \ |
1532 | | (void (*)(void))impl##_to_##kind##_##output##_import_object }, \ |
1533 | | { OSSL_FUNC_ENCODER_FREE_OBJECT, \ |
1534 | | (void (*)(void))impl##_to_##kind##_##output##_free_object }, \ |
1535 | | { OSSL_FUNC_ENCODER_ENCODE, \ |
1536 | | (void (*)(void))impl##_to_##kind##_##output##_encode }, \ |
1537 | | OSSL_DISPATCH_END \ |
1538 | | } |
1539 | | |
1540 | | /* |
1541 | | * Replacements for i2d_{TYPE}PrivateKey, i2d_{TYPE}PublicKey, |
1542 | | * i2d_{TYPE}params, as they exist. |
1543 | | */ |
1544 | | MAKE_ENCODER(rsa, rsa, type_specific_keypair, der); |
1545 | | #ifndef OPENSSL_NO_DH |
1546 | | MAKE_ENCODER(dh, dh, type_specific_params, der); |
1547 | | MAKE_ENCODER(dhx, dh, type_specific_params, der); |
1548 | | #endif |
1549 | | #ifndef OPENSSL_NO_DSA |
1550 | | MAKE_ENCODER(dsa, dsa, type_specific, der); |
1551 | | #endif |
1552 | | #ifndef OPENSSL_NO_EC |
1553 | | MAKE_ENCODER(ec, ec, type_specific_no_pub, der); |
1554 | | # ifndef OPENSSL_NO_SM2 |
1555 | | MAKE_ENCODER(sm2, ec, type_specific_no_pub, der); |
1556 | | # endif |
1557 | | #endif |
1558 | | |
1559 | | /* |
1560 | | * Replacements for PEM_write_bio_{TYPE}PrivateKey, |
1561 | | * PEM_write_bio_{TYPE}PublicKey, PEM_write_bio_{TYPE}params, as they exist. |
1562 | | */ |
1563 | | MAKE_ENCODER(rsa, rsa, type_specific_keypair, pem); |
1564 | | #ifndef OPENSSL_NO_DH |
1565 | | MAKE_ENCODER(dh, dh, type_specific_params, pem); |
1566 | | MAKE_ENCODER(dhx, dh, type_specific_params, pem); |
1567 | | #endif |
1568 | | #ifndef OPENSSL_NO_DSA |
1569 | | MAKE_ENCODER(dsa, dsa, type_specific, pem); |
1570 | | #endif |
1571 | | #ifndef OPENSSL_NO_EC |
1572 | | MAKE_ENCODER(ec, ec, type_specific_no_pub, pem); |
1573 | | # ifndef OPENSSL_NO_SM2 |
1574 | | MAKE_ENCODER(sm2, ec, type_specific_no_pub, pem); |
1575 | | # endif |
1576 | | #endif |
1577 | | |
1578 | | /* |
1579 | | * PKCS#8 and SubjectPublicKeyInfo support. This may duplicate some of the |
1580 | | * implementations specified above, but are more specific. |
1581 | | * The SubjectPublicKeyInfo implementations also replace the |
1582 | | * PEM_write_bio_{TYPE}_PUBKEY functions. |
1583 | | * For PEM, these are expected to be used by PEM_write_bio_PrivateKey(), |
1584 | | * PEM_write_bio_PUBKEY() and PEM_write_bio_Parameters(). |
1585 | | */ |
1586 | | MAKE_ENCODER(rsa, rsa, EncryptedPrivateKeyInfo, der); |
1587 | | MAKE_ENCODER(rsa, rsa, EncryptedPrivateKeyInfo, pem); |
1588 | | MAKE_ENCODER(rsa, rsa, PrivateKeyInfo, der); |
1589 | | MAKE_ENCODER(rsa, rsa, PrivateKeyInfo, pem); |
1590 | | MAKE_ENCODER(rsa, rsa, SubjectPublicKeyInfo, der); |
1591 | | MAKE_ENCODER(rsa, rsa, SubjectPublicKeyInfo, pem); |
1592 | | MAKE_ENCODER(rsapss, rsa, EncryptedPrivateKeyInfo, der); |
1593 | | MAKE_ENCODER(rsapss, rsa, EncryptedPrivateKeyInfo, pem); |
1594 | | MAKE_ENCODER(rsapss, rsa, PrivateKeyInfo, der); |
1595 | | MAKE_ENCODER(rsapss, rsa, PrivateKeyInfo, pem); |
1596 | | MAKE_ENCODER(rsapss, rsa, SubjectPublicKeyInfo, der); |
1597 | | MAKE_ENCODER(rsapss, rsa, SubjectPublicKeyInfo, pem); |
1598 | | #ifndef OPENSSL_NO_DH |
1599 | | MAKE_ENCODER(dh, dh, EncryptedPrivateKeyInfo, der); |
1600 | | MAKE_ENCODER(dh, dh, EncryptedPrivateKeyInfo, pem); |
1601 | | MAKE_ENCODER(dh, dh, PrivateKeyInfo, der); |
1602 | | MAKE_ENCODER(dh, dh, PrivateKeyInfo, pem); |
1603 | | MAKE_ENCODER(dh, dh, SubjectPublicKeyInfo, der); |
1604 | | MAKE_ENCODER(dh, dh, SubjectPublicKeyInfo, pem); |
1605 | | MAKE_ENCODER(dhx, dh, EncryptedPrivateKeyInfo, der); |
1606 | | MAKE_ENCODER(dhx, dh, EncryptedPrivateKeyInfo, pem); |
1607 | | MAKE_ENCODER(dhx, dh, PrivateKeyInfo, der); |
1608 | | MAKE_ENCODER(dhx, dh, PrivateKeyInfo, pem); |
1609 | | MAKE_ENCODER(dhx, dh, SubjectPublicKeyInfo, der); |
1610 | | MAKE_ENCODER(dhx, dh, SubjectPublicKeyInfo, pem); |
1611 | | #endif |
1612 | | #ifndef OPENSSL_NO_DSA |
1613 | | MAKE_ENCODER(dsa, dsa, EncryptedPrivateKeyInfo, der); |
1614 | | MAKE_ENCODER(dsa, dsa, EncryptedPrivateKeyInfo, pem); |
1615 | | MAKE_ENCODER(dsa, dsa, PrivateKeyInfo, der); |
1616 | | MAKE_ENCODER(dsa, dsa, PrivateKeyInfo, pem); |
1617 | | MAKE_ENCODER(dsa, dsa, SubjectPublicKeyInfo, der); |
1618 | | MAKE_ENCODER(dsa, dsa, SubjectPublicKeyInfo, pem); |
1619 | | #endif |
1620 | | #ifndef OPENSSL_NO_EC |
1621 | | MAKE_ENCODER(ec, ec, EncryptedPrivateKeyInfo, der); |
1622 | | MAKE_ENCODER(ec, ec, EncryptedPrivateKeyInfo, pem); |
1623 | | MAKE_ENCODER(ec, ec, PrivateKeyInfo, der); |
1624 | | MAKE_ENCODER(ec, ec, PrivateKeyInfo, pem); |
1625 | | MAKE_ENCODER(ec, ec, SubjectPublicKeyInfo, der); |
1626 | | MAKE_ENCODER(ec, ec, SubjectPublicKeyInfo, pem); |
1627 | | # ifndef OPENSSL_NO_SM2 |
1628 | | MAKE_ENCODER(sm2, ec, EncryptedPrivateKeyInfo, der); |
1629 | | MAKE_ENCODER(sm2, ec, EncryptedPrivateKeyInfo, pem); |
1630 | | MAKE_ENCODER(sm2, ec, PrivateKeyInfo, der); |
1631 | | MAKE_ENCODER(sm2, ec, PrivateKeyInfo, pem); |
1632 | | MAKE_ENCODER(sm2, ec, SubjectPublicKeyInfo, der); |
1633 | | MAKE_ENCODER(sm2, ec, SubjectPublicKeyInfo, pem); |
1634 | | # endif |
1635 | | # ifndef OPENSSL_NO_ECX |
1636 | | MAKE_ENCODER(ed25519, ecx, EncryptedPrivateKeyInfo, der); |
1637 | | MAKE_ENCODER(ed25519, ecx, EncryptedPrivateKeyInfo, pem); |
1638 | | MAKE_ENCODER(ed25519, ecx, PrivateKeyInfo, der); |
1639 | | MAKE_ENCODER(ed25519, ecx, PrivateKeyInfo, pem); |
1640 | | MAKE_ENCODER(ed25519, ecx, SubjectPublicKeyInfo, der); |
1641 | | MAKE_ENCODER(ed25519, ecx, SubjectPublicKeyInfo, pem); |
1642 | | MAKE_ENCODER(ed448, ecx, EncryptedPrivateKeyInfo, der); |
1643 | | MAKE_ENCODER(ed448, ecx, EncryptedPrivateKeyInfo, pem); |
1644 | | MAKE_ENCODER(ed448, ecx, PrivateKeyInfo, der); |
1645 | | MAKE_ENCODER(ed448, ecx, PrivateKeyInfo, pem); |
1646 | | MAKE_ENCODER(ed448, ecx, SubjectPublicKeyInfo, der); |
1647 | | MAKE_ENCODER(ed448, ecx, SubjectPublicKeyInfo, pem); |
1648 | | MAKE_ENCODER(x25519, ecx, EncryptedPrivateKeyInfo, der); |
1649 | | MAKE_ENCODER(x25519, ecx, EncryptedPrivateKeyInfo, pem); |
1650 | | MAKE_ENCODER(x25519, ecx, PrivateKeyInfo, der); |
1651 | | MAKE_ENCODER(x25519, ecx, PrivateKeyInfo, pem); |
1652 | | MAKE_ENCODER(x25519, ecx, SubjectPublicKeyInfo, der); |
1653 | | MAKE_ENCODER(x25519, ecx, SubjectPublicKeyInfo, pem); |
1654 | | MAKE_ENCODER(x448, ecx, EncryptedPrivateKeyInfo, der); |
1655 | | MAKE_ENCODER(x448, ecx, EncryptedPrivateKeyInfo, pem); |
1656 | | MAKE_ENCODER(x448, ecx, PrivateKeyInfo, der); |
1657 | | MAKE_ENCODER(x448, ecx, PrivateKeyInfo, pem); |
1658 | | MAKE_ENCODER(x448, ecx, SubjectPublicKeyInfo, der); |
1659 | | MAKE_ENCODER(x448, ecx, SubjectPublicKeyInfo, pem); |
1660 | | # endif |
1661 | | #endif |
1662 | | #ifndef OPENSSL_NO_SLH_DSA |
1663 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1664 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1665 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1666 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1667 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1668 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1669 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1670 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1671 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1672 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1673 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1674 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1675 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1676 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1677 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1678 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1679 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, EncryptedPrivateKeyInfo, der); |
1680 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, EncryptedPrivateKeyInfo, der); |
1681 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1682 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1683 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1684 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1685 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1686 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, EncryptedPrivateKeyInfo, pem); |
1687 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, PrivateKeyInfo, der); |
1688 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, PrivateKeyInfo, der); |
1689 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, PrivateKeyInfo, der); |
1690 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, PrivateKeyInfo, der); |
1691 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, PrivateKeyInfo, der); |
1692 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, PrivateKeyInfo, der); |
1693 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, PrivateKeyInfo, pem); |
1694 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, PrivateKeyInfo, pem); |
1695 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, PrivateKeyInfo, pem); |
1696 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, PrivateKeyInfo, pem); |
1697 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, PrivateKeyInfo, pem); |
1698 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, PrivateKeyInfo, pem); |
1699 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, PrivateKeyInfo, der); |
1700 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, PrivateKeyInfo, der); |
1701 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, PrivateKeyInfo, der); |
1702 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, PrivateKeyInfo, der); |
1703 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, PrivateKeyInfo, der); |
1704 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, PrivateKeyInfo, der); |
1705 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, PrivateKeyInfo, pem); |
1706 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, PrivateKeyInfo, pem); |
1707 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, PrivateKeyInfo, pem); |
1708 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, PrivateKeyInfo, pem); |
1709 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, PrivateKeyInfo, pem); |
1710 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, PrivateKeyInfo, pem); |
1711 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, SubjectPublicKeyInfo, der); |
1712 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, SubjectPublicKeyInfo, der); |
1713 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, SubjectPublicKeyInfo, der); |
1714 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, SubjectPublicKeyInfo, der); |
1715 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, SubjectPublicKeyInfo, der); |
1716 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, SubjectPublicKeyInfo, der); |
1717 | | MAKE_ENCODER(slh_dsa_sha2_128s, slh_dsa, SubjectPublicKeyInfo, pem); |
1718 | | MAKE_ENCODER(slh_dsa_sha2_128f, slh_dsa, SubjectPublicKeyInfo, pem); |
1719 | | MAKE_ENCODER(slh_dsa_sha2_192s, slh_dsa, SubjectPublicKeyInfo, pem); |
1720 | | MAKE_ENCODER(slh_dsa_sha2_192f, slh_dsa, SubjectPublicKeyInfo, pem); |
1721 | | MAKE_ENCODER(slh_dsa_sha2_256s, slh_dsa, SubjectPublicKeyInfo, pem); |
1722 | | MAKE_ENCODER(slh_dsa_sha2_256f, slh_dsa, SubjectPublicKeyInfo, pem); |
1723 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, SubjectPublicKeyInfo, der); |
1724 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, SubjectPublicKeyInfo, der); |
1725 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, SubjectPublicKeyInfo, der); |
1726 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, SubjectPublicKeyInfo, der); |
1727 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, SubjectPublicKeyInfo, der); |
1728 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, SubjectPublicKeyInfo, der); |
1729 | | MAKE_ENCODER(slh_dsa_shake_128s, slh_dsa, SubjectPublicKeyInfo, pem); |
1730 | | MAKE_ENCODER(slh_dsa_shake_128f, slh_dsa, SubjectPublicKeyInfo, pem); |
1731 | | MAKE_ENCODER(slh_dsa_shake_192s, slh_dsa, SubjectPublicKeyInfo, pem); |
1732 | | MAKE_ENCODER(slh_dsa_shake_192f, slh_dsa, SubjectPublicKeyInfo, pem); |
1733 | | MAKE_ENCODER(slh_dsa_shake_256s, slh_dsa, SubjectPublicKeyInfo, pem); |
1734 | | MAKE_ENCODER(slh_dsa_shake_256f, slh_dsa, SubjectPublicKeyInfo, pem); |
1735 | | #endif /* OPENSSL_NO_SLH_DSA */ |
1736 | | |
1737 | | #ifndef OPENSSL_NO_ML_KEM |
1738 | | MAKE_ENCODER(ml_kem_512, ml_kem, EncryptedPrivateKeyInfo, der); |
1739 | | MAKE_ENCODER(ml_kem_512, ml_kem, EncryptedPrivateKeyInfo, pem); |
1740 | | MAKE_ENCODER(ml_kem_512, ml_kem, PrivateKeyInfo, der); |
1741 | | MAKE_ENCODER(ml_kem_512, ml_kem, PrivateKeyInfo, pem); |
1742 | | MAKE_ENCODER(ml_kem_512, ml_kem, SubjectPublicKeyInfo, der); |
1743 | | MAKE_ENCODER(ml_kem_512, ml_kem, SubjectPublicKeyInfo, pem); |
1744 | | |
1745 | | MAKE_ENCODER(ml_kem_768, ml_kem, EncryptedPrivateKeyInfo, der); |
1746 | | MAKE_ENCODER(ml_kem_768, ml_kem, EncryptedPrivateKeyInfo, pem); |
1747 | | MAKE_ENCODER(ml_kem_768, ml_kem, PrivateKeyInfo, der); |
1748 | | MAKE_ENCODER(ml_kem_768, ml_kem, PrivateKeyInfo, pem); |
1749 | | MAKE_ENCODER(ml_kem_768, ml_kem, SubjectPublicKeyInfo, der); |
1750 | | MAKE_ENCODER(ml_kem_768, ml_kem, SubjectPublicKeyInfo, pem); |
1751 | | |
1752 | | MAKE_ENCODER(ml_kem_1024, ml_kem, EncryptedPrivateKeyInfo, der); |
1753 | | MAKE_ENCODER(ml_kem_1024, ml_kem, EncryptedPrivateKeyInfo, pem); |
1754 | | MAKE_ENCODER(ml_kem_1024, ml_kem, PrivateKeyInfo, der); |
1755 | | MAKE_ENCODER(ml_kem_1024, ml_kem, PrivateKeyInfo, pem); |
1756 | | MAKE_ENCODER(ml_kem_1024, ml_kem, SubjectPublicKeyInfo, der); |
1757 | | MAKE_ENCODER(ml_kem_1024, ml_kem, SubjectPublicKeyInfo, pem); |
1758 | | #endif |
1759 | | |
1760 | | /* |
1761 | | * Support for key type specific output formats. Not all key types have |
1762 | | * this, we only aim to duplicate what is available in 1.1.1 as |
1763 | | * i2d_TYPEPrivateKey(), i2d_TYPEPublicKey() and i2d_TYPEparams(). |
1764 | | * For example, there are no publicly available i2d_ function for |
1765 | | * ED25519, ED448, X25519 or X448, and they therefore only have PKCS#8 |
1766 | | * and SubjectPublicKeyInfo implementations as implemented above. |
1767 | | */ |
1768 | | MAKE_ENCODER(rsa, rsa, RSA, der); |
1769 | | MAKE_ENCODER(rsa, rsa, RSA, pem); |
1770 | | #ifndef OPENSSL_NO_DH |
1771 | | MAKE_ENCODER(dh, dh, DH, der); |
1772 | | MAKE_ENCODER(dh, dh, DH, pem); |
1773 | | MAKE_ENCODER(dhx, dh, DHX, der); |
1774 | | MAKE_ENCODER(dhx, dh, DHX, pem); |
1775 | | #endif |
1776 | | #ifndef OPENSSL_NO_DSA |
1777 | | MAKE_ENCODER(dsa, dsa, DSA, der); |
1778 | | MAKE_ENCODER(dsa, dsa, DSA, pem); |
1779 | | #endif |
1780 | | #ifndef OPENSSL_NO_EC |
1781 | | MAKE_ENCODER(ec, ec, EC, der); |
1782 | | MAKE_ENCODER(ec, ec, EC, pem); |
1783 | | # ifndef OPENSSL_NO_SM2 |
1784 | | MAKE_ENCODER(sm2, ec, SM2, der); |
1785 | | MAKE_ENCODER(sm2, ec, SM2, pem); |
1786 | | # endif |
1787 | | #endif |
1788 | | |
1789 | | /* Convenience structure names */ |
1790 | | MAKE_ENCODER(rsa, rsa, PKCS1, der); |
1791 | | MAKE_ENCODER(rsa, rsa, PKCS1, pem); |
1792 | | MAKE_ENCODER(rsapss, rsa, PKCS1, der); |
1793 | | MAKE_ENCODER(rsapss, rsa, PKCS1, pem); |
1794 | | #ifndef OPENSSL_NO_DH |
1795 | | MAKE_ENCODER(dh, dh, PKCS3, der); /* parameters only */ |
1796 | | MAKE_ENCODER(dh, dh, PKCS3, pem); /* parameters only */ |
1797 | | MAKE_ENCODER(dhx, dh, X9_42, der); /* parameters only */ |
1798 | | MAKE_ENCODER(dhx, dh, X9_42, pem); /* parameters only */ |
1799 | | #endif |
1800 | | #ifndef OPENSSL_NO_EC |
1801 | | MAKE_ENCODER(ec, ec, X9_62, der); |
1802 | | MAKE_ENCODER(ec, ec, X9_62, pem); |
1803 | | #endif |
1804 | | |
1805 | | #ifndef OPENSSL_NO_ML_DSA |
1806 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, EncryptedPrivateKeyInfo, der); |
1807 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, EncryptedPrivateKeyInfo, pem); |
1808 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, PrivateKeyInfo, der); |
1809 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, PrivateKeyInfo, pem); |
1810 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, SubjectPublicKeyInfo, der); |
1811 | | MAKE_ENCODER(ml_dsa_44, ml_dsa, SubjectPublicKeyInfo, pem); |
1812 | | |
1813 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, EncryptedPrivateKeyInfo, der); |
1814 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, EncryptedPrivateKeyInfo, pem); |
1815 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, PrivateKeyInfo, der); |
1816 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, PrivateKeyInfo, pem); |
1817 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, SubjectPublicKeyInfo, der); |
1818 | | MAKE_ENCODER(ml_dsa_65, ml_dsa, SubjectPublicKeyInfo, pem); |
1819 | | |
1820 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, EncryptedPrivateKeyInfo, der); |
1821 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, EncryptedPrivateKeyInfo, pem); |
1822 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, PrivateKeyInfo, der); |
1823 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, PrivateKeyInfo, pem); |
1824 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, SubjectPublicKeyInfo, der); |
1825 | | MAKE_ENCODER(ml_dsa_87, ml_dsa, SubjectPublicKeyInfo, pem); |
1826 | | #endif /* OPENSSL_NO_ML_DSA */ |