From 81b47ff6ec8e741801c5afec3197bb5d6abf27f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Silv=C3=A9n?= Date: Mon, 1 Jan 2024 17:54:31 +0100 Subject: [PATCH] Changing from local to public for some parts of the API. This is done to make it possible to use none Botan private keys when signing certificates. --- src/lib/asn1/info.txt | 2 +- src/lib/asn1/pss_params.cpp | 2 +- src/lib/asn1/pss_params.h | 2 +- src/lib/prov/pkcs11/info.txt | 5 +---- src/lib/prov/pkcs11/p11_ecdh.cpp | 2 +- src/lib/prov/pkcs11/p11_ecdsa.cpp | 2 +- src/lib/prov/pkcs11/p11_mechanism.cpp | 2 +- src/lib/prov/pkcs11/p11_mechanism.h | 2 +- src/lib/prov/pkcs11/p11_rsa.cpp | 2 +- .../tpm2/tpm2_crypto_backend/tpm2_crypto_backend_impl.cpp | 4 ++-- src/lib/prov/tpm2/tpm2_rsa/tpm2_rsa.cpp | 2 +- src/lib/pubkey/pubkey.cpp | 2 +- src/lib/pubkey/rsa/rsa.cpp | 2 +- src/lib/tls/tls_signature_scheme.cpp | 2 +- 14 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/lib/asn1/info.txt b/src/lib/asn1/info.txt index dc80cdbd46..ec2591cec4 100644 --- a/src/lib/asn1/info.txt +++ b/src/lib/asn1/info.txt @@ -17,9 +17,9 @@ asn1_obj.h der_enc.h oids.h ber_dec.h +pss_params.h oid_map.h -pss_params.h diff --git a/src/lib/asn1/pss_params.cpp b/src/lib/asn1/pss_params.cpp index a6e0ab3e4b..014906691a 100644 --- a/src/lib/asn1/pss_params.cpp +++ b/src/lib/asn1/pss_params.cpp @@ -5,7 +5,7 @@ * Botan is released under the Simplified BSD License (see license.txt) */ -#include +#include #include #include diff --git a/src/lib/asn1/pss_params.h b/src/lib/asn1/pss_params.h index fec4e9fc0a..33fdf612c9 100644 --- a/src/lib/asn1/pss_params.h +++ b/src/lib/asn1/pss_params.h @@ -13,7 +13,7 @@ namespace Botan { -class PSS_Params final : public ASN1_Object { +class BOTAN_PUBLIC_API(3, 7) PSS_Params final : public ASN1_Object { public: static PSS_Params from_emsa_name(std::string_view emsa_name); diff --git a/src/lib/prov/pkcs11/info.txt b/src/lib/prov/pkcs11/info.txt index 050f484e45..6141f729aa 100644 --- a/src/lib/prov/pkcs11/info.txt +++ b/src/lib/prov/pkcs11/info.txt @@ -14,10 +14,6 @@ pubkey pk_pad - -p11_mechanism.h - - pkcs11.h pkcs11f.h @@ -34,4 +30,5 @@ p11_randomgenerator.h p11_rsa.h p11_types.h p11_x509.h +p11_mechanism.h diff --git a/src/lib/prov/pkcs11/p11_ecdh.cpp b/src/lib/prov/pkcs11/p11_ecdh.cpp index d4ad64b76d..7f107939e2 100644 --- a/src/lib/prov/pkcs11/p11_ecdh.cpp +++ b/src/lib/prov/pkcs11/p11_ecdh.cpp @@ -11,9 +11,9 @@ #if defined(BOTAN_HAS_ECDH) #include + #include #include #include - #include namespace Botan::PKCS11 { diff --git a/src/lib/prov/pkcs11/p11_ecdsa.cpp b/src/lib/prov/pkcs11/p11_ecdsa.cpp index 24533d7b51..57beca7fbb 100644 --- a/src/lib/prov/pkcs11/p11_ecdsa.cpp +++ b/src/lib/prov/pkcs11/p11_ecdsa.cpp @@ -10,10 +10,10 @@ #if defined(BOTAN_HAS_ECDSA) + #include #include #include #include - #include namespace Botan::PKCS11 { diff --git a/src/lib/prov/pkcs11/p11_mechanism.cpp b/src/lib/prov/pkcs11/p11_mechanism.cpp index 1db137c284..209e3eb984 100644 --- a/src/lib/prov/pkcs11/p11_mechanism.cpp +++ b/src/lib/prov/pkcs11/p11_mechanism.cpp @@ -6,7 +6,7 @@ * Botan is released under the Simplified BSD License (see license.txt) */ -#include +#include #include #include diff --git a/src/lib/prov/pkcs11/p11_mechanism.h b/src/lib/prov/pkcs11/p11_mechanism.h index 96ea0dc154..4a9a436405 100644 --- a/src/lib/prov/pkcs11/p11_mechanism.h +++ b/src/lib/prov/pkcs11/p11_mechanism.h @@ -23,7 +23,7 @@ namespace Botan::PKCS11 { * for RSA (encryption/decryption, signature/verification) * and EC (ECDSA signature/verification, ECDH key derivation). */ -class MechanismWrapper final { +class BOTAN_PUBLIC_API(3, 7) MechanismWrapper final { public: /// @param mechanism_type the CK_MECHANISM_TYPE for the `mechanism` field of the CK_MECHANISM struct explicit MechanismWrapper(MechanismType mechanism_type); diff --git a/src/lib/prov/pkcs11/p11_rsa.cpp b/src/lib/prov/pkcs11/p11_rsa.cpp index 6ed7311c37..1c77ced553 100644 --- a/src/lib/prov/pkcs11/p11_rsa.cpp +++ b/src/lib/prov/pkcs11/p11_rsa.cpp @@ -12,10 +12,10 @@ #if defined(BOTAN_HAS_RSA) + #include #include #include #include - #include #include namespace Botan::PKCS11 { diff --git a/src/lib/prov/tpm2/tpm2_crypto_backend/tpm2_crypto_backend_impl.cpp b/src/lib/prov/tpm2/tpm2_crypto_backend/tpm2_crypto_backend_impl.cpp index 6702e9d866..97d6296f68 100644 --- a/src/lib/prov/tpm2/tpm2_crypto_backend/tpm2_crypto_backend_impl.cpp +++ b/src/lib/prov/tpm2/tpm2_crypto_backend/tpm2_crypto_backend_impl.cpp @@ -877,12 +877,12 @@ void set_crypto_callbacks(ESYS_CONTEXT* ctx, void* callback_state) { .get_ecdh_point = &get_ecdh_point, .aes_encrypt = &aes_encrypt, .aes_decrypt = &aes_decrypt, - .init = &init, - .userdata = callback_state, #if defined(BOTAN_TSS2_SUPPORTS_SM4_IN_CRYPTO_CALLBACKS) .sm4_encrypt = &sm4_encrypt, .sm4_decrypt = &sm4_decrypt, #endif + .init = &init, + .userdata = callback_state, }; // clang-format on diff --git a/src/lib/prov/tpm2/tpm2_rsa/tpm2_rsa.cpp b/src/lib/prov/tpm2/tpm2_rsa/tpm2_rsa.cpp index 701554ee32..3f8a406f39 100644 --- a/src/lib/prov/tpm2/tpm2_rsa/tpm2_rsa.cpp +++ b/src/lib/prov/tpm2/tpm2_rsa/tpm2_rsa.cpp @@ -9,12 +9,12 @@ #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/src/lib/pubkey/pubkey.cpp b/src/lib/pubkey/pubkey.cpp index 15fb363215..a1aa5bb992 100644 --- a/src/lib/pubkey/pubkey.cpp +++ b/src/lib/pubkey/pubkey.cpp @@ -11,11 +11,11 @@ #include #include #include +#include #include #include #include #include -#include #include namespace Botan { diff --git a/src/lib/pubkey/rsa/rsa.cpp b/src/lib/pubkey/rsa/rsa.cpp index 8ae7e444d6..ff62ac6d12 100644 --- a/src/lib/pubkey/rsa/rsa.cpp +++ b/src/lib/pubkey/rsa/rsa.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -19,7 +20,6 @@ #include #include #include -#include #include #if defined(BOTAN_HAS_THREAD_UTILS) diff --git a/src/lib/tls/tls_signature_scheme.cpp b/src/lib/tls/tls_signature_scheme.cpp index ce28501938..1729ea4945 100644 --- a/src/lib/tls/tls_signature_scheme.cpp +++ b/src/lib/tls/tls_signature_scheme.cpp @@ -11,9 +11,9 @@ #include #include #include +#include #include #include -#include #include namespace Botan::TLS {