]> git.ipfire.org Git - thirdparty/openssl.git/blame - providers/decoders.inc
configure: introduce no-ecx to remove ECX related feature
[thirdparty/openssl.git] / providers / decoders.inc
CommitLineData
ece9304c 1/*
a28d06f3 2 * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
ece9304c
RL
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
2c090c1d
RL
10#ifndef DECODER_PROVIDER
11# error Macro DECODER_PROVIDER undefined
ece9304c
RL
12#endif
13
2c090c1d
RL
14#define DECODER_STRUCTURE_type_specific_keypair "type-specific"
15#define DECODER_STRUCTURE_type_specific_params "type-specific"
16#define DECODER_STRUCTURE_type_specific "type-specific"
17#define DECODER_STRUCTURE_type_specific_no_pub "type-specific"
6a2b8ff3
RL
18#define DECODER_STRUCTURE_EncryptedPrivateKeyInfo "EncryptedPrivateKeyInfo"
19#define DECODER_STRUCTURE_PrivateKeyInfo "PrivateKeyInfo"
2c090c1d
RL
20#define DECODER_STRUCTURE_SubjectPublicKeyInfo "SubjectPublicKeyInfo"
21#define DECODER_STRUCTURE_DH "dh"
22#define DECODER_STRUCTURE_DHX "dhx"
23#define DECODER_STRUCTURE_DSA "dsa"
24#define DECODER_STRUCTURE_EC "ec"
25#define DECODER_STRUCTURE_RSA "rsa"
26
27/* Arguments are prefixed with '_' to avoid build breaks on certain platforms */
28#define DECODER(_name, _input, _output, _fips) \
29 { _name, \
30 "provider=" DECODER_PROVIDER ",fips=" #_fips ",input=" #_input, \
31 (ossl_##_input##_to_##_output##_decoder_functions) }
32#define DECODER_w_structure(_name, _input, _structure, _output, _fips) \
33 { _name, \
34 "provider=" DECODER_PROVIDER ",fips=" #_fips ",input=" #_input \
35 ",structure=" DECODER_STRUCTURE_##_structure, \
36 (ossl_##_structure##_##_input##_to_##_output##_decoder_functions) }
37
ece9304c 38#ifndef OPENSSL_NO_DH
6a2b8ff3 39DECODER_w_structure("DH", der, PrivateKeyInfo, dh, yes),
2c090c1d
RL
40DECODER_w_structure("DH", der, SubjectPublicKeyInfo, dh, yes),
41DECODER_w_structure("DH", der, type_specific_params, dh, yes),
42DECODER_w_structure("DH", der, DH, dh, yes),
6a2b8ff3 43DECODER_w_structure("DHX", der, PrivateKeyInfo, dhx, yes),
2c090c1d
RL
44DECODER_w_structure("DHX", der, SubjectPublicKeyInfo, dhx, yes),
45DECODER_w_structure("DHX", der, type_specific_params, dhx, yes),
46DECODER_w_structure("DHX", der, DHX, dhx, yes),
ece9304c
RL
47#endif
48#ifndef OPENSSL_NO_DSA
6a2b8ff3 49DECODER_w_structure("DSA", der, PrivateKeyInfo, dsa, yes),
2c090c1d
RL
50DECODER_w_structure("DSA", der, SubjectPublicKeyInfo, dsa, yes),
51DECODER_w_structure("DSA", der, type_specific, dsa, yes),
52DECODER_w_structure("DSA", der, DSA, dsa, yes),
53DECODER("DSA", msblob, dsa, yes),
2c090c1d 54DECODER("DSA", pvk, dsa, yes),
ece9304c
RL
55#endif
56#ifndef OPENSSL_NO_EC
6a2b8ff3 57DECODER_w_structure("EC", der, PrivateKeyInfo, ec, yes),
2c090c1d
RL
58DECODER_w_structure("EC", der, SubjectPublicKeyInfo, ec, yes),
59DECODER_w_structure("EC", der, type_specific_no_pub, ec, yes),
60DECODER_w_structure("EC", der, EC, ec, yes),
4032cd9a 61# ifndef OPENSSL_NO_ECX
6a2b8ff3 62DECODER_w_structure("ED25519", der, PrivateKeyInfo, ed25519, yes),
2c090c1d 63DECODER_w_structure("ED25519", der, SubjectPublicKeyInfo, ed25519, yes),
6a2b8ff3 64DECODER_w_structure("ED448", der, PrivateKeyInfo, ed448, yes),
2c090c1d 65DECODER_w_structure("ED448", der, SubjectPublicKeyInfo, ed448, yes),
6a2b8ff3 66DECODER_w_structure("X25519", der, PrivateKeyInfo, x25519, yes),
2c090c1d 67DECODER_w_structure("X25519", der, SubjectPublicKeyInfo, x25519, yes),
6a2b8ff3 68DECODER_w_structure("X448", der, PrivateKeyInfo, x448, yes),
2c090c1d 69DECODER_w_structure("X448", der, SubjectPublicKeyInfo, x448, yes),
4032cd9a 70# endif
f2db0528 71# ifndef OPENSSL_NO_SM2
a6f8e131
P
72DECODER_w_structure("SM2", der, PrivateKeyInfo, sm2, no),
73DECODER_w_structure("SM2", der, SubjectPublicKeyInfo, sm2, no),
08ae9fa6 74DECODER_w_structure("SM2", der, type_specific_no_pub, sm2, no),
f2db0528 75# endif
ece9304c 76#endif
6a2b8ff3 77DECODER_w_structure("RSA", der, PrivateKeyInfo, rsa, yes),
2c090c1d
RL
78DECODER_w_structure("RSA", der, SubjectPublicKeyInfo, rsa, yes),
79DECODER_w_structure("RSA", der, type_specific_keypair, rsa, yes),
80DECODER_w_structure("RSA", der, RSA, rsa, yes),
6a2b8ff3 81DECODER_w_structure("RSA-PSS", der, PrivateKeyInfo, rsapss, yes),
2c090c1d 82DECODER_w_structure("RSA-PSS", der, SubjectPublicKeyInfo, rsapss, yes),
2c090c1d 83DECODER("RSA", msblob, rsa, yes),
2c090c1d 84DECODER("RSA", pvk, rsa, yes),
ece9304c 85
8c7c1c84
MC
86/*
87 * A decoder that takes a SubjectPublicKeyInfo and figures out the types of key
88 * that it contains. The output is the same SubjectPublicKeyInfo
89 */
90DECODER_w_structure("DER", der, SubjectPublicKeyInfo, der, yes),
2c090c1d 91DECODER("DER", pem, der, yes),
6a2b8ff3
RL
92/*
93 * A decoder that recognises PKCS#8 EncryptedPrivateKeyInfo structure
94 * and decrypts it, passing on the unencrypted PrivateKeyInfo in DER
95 * form to the next decoder.
96 */
97DECODER_w_structure("DER", der, EncryptedPrivateKeyInfo, der, yes),