Remove QUICHE_EXPORT annotations from testing/utils.h, and add explanatory comments to other files with those annotations. PiperOrigin-RevId: 525519875
diff --git a/quiche/blind_sign_auth/anonymous_tokens/cpp/client/anonymous_tokens_rsa_bssa_client.h b/quiche/blind_sign_auth/anonymous_tokens/cpp/client/anonymous_tokens_rsa_bssa_client.h index b12b5c4..0f2cd5c 100644 --- a/quiche/blind_sign_auth/anonymous_tokens/cpp/client/anonymous_tokens_rsa_bssa_client.h +++ b/quiche/blind_sign_auth/anonymous_tokens/cpp/client/anonymous_tokens_rsa_bssa_client.h
@@ -26,6 +26,10 @@ #include "quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_blinder.h" #include "quiche/blind_sign_auth/anonymous_tokens/proto/anonymous_tokens.pb.h" #include "quiche/common/platform/api/quiche_export.h" +// copybara:strip_begin(internal comment) +// The QUICHE_EXPORT annotation is necessary for some classes and functions +// to link correctly on Windows. Please do not remove them! +// copybara:strip_end namespace private_membership { namespace anonymous_tokens {
diff --git a/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/crypto_utils.h b/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/crypto_utils.h index 25bf944..109476f 100644 --- a/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/crypto_utils.h +++ b/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/crypto_utils.h
@@ -29,6 +29,10 @@ #include "openssl/evp.h" #include "openssl/rsa.h" #include "quiche/common/platform/api/quiche_export.h" +// copybara:strip_begin(internal comment) +// The QUICHE_EXPORT annotation is necessary for some classes and functions +// to link correctly on Windows. Please do not remove them! +// copybara:strip_end namespace private_membership { namespace anonymous_tokens {
diff --git a/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_blind_signer.h b/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_blind_signer.h index c1abec1..e7f503e 100644 --- a/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_blind_signer.h +++ b/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_blind_signer.h
@@ -24,6 +24,10 @@ #include "quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/crypto_utils.h" #include "quiche/blind_sign_auth/anonymous_tokens/proto/anonymous_tokens.pb.h" #include "quiche/common/platform/api/quiche_export.h" +// copybara:strip_begin(internal comment) +// The QUICHE_EXPORT annotation is necessary for some classes and functions +// to link correctly on Windows. Please do not remove them! +// copybara:strip_end namespace private_membership { namespace anonymous_tokens {
diff --git a/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_blinder.h b/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_blinder.h index 519fbc2..0fb8304 100644 --- a/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_blinder.h +++ b/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_blinder.h
@@ -28,6 +28,10 @@ #include "quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/crypto_utils.h" #include "quiche/blind_sign_auth/anonymous_tokens/proto/anonymous_tokens.pb.h" #include "quiche/common/platform/api/quiche_export.h" +// copybara:strip_begin(internal comment) +// The QUICHE_EXPORT annotation is necessary for some classes and functions +// to link correctly on Windows. Please do not remove them! +// copybara:strip_end namespace private_membership { namespace anonymous_tokens {
diff --git a/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_ssa_pss_verifier.h b/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_ssa_pss_verifier.h index 569abe8..199717f 100644 --- a/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_ssa_pss_verifier.h +++ b/quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/rsa_ssa_pss_verifier.h
@@ -27,6 +27,10 @@ #include "quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/verifier.h" #include "quiche/blind_sign_auth/anonymous_tokens/proto/anonymous_tokens.pb.h" #include "quiche/common/platform/api/quiche_export.h" +// copybara:strip_begin(internal comment) +// The QUICHE_EXPORT annotation is necessary for some classes and functions +// to link correctly on Windows. Please do not remove them! +// copybara:strip_end namespace private_membership { namespace anonymous_tokens {
diff --git a/quiche/blind_sign_auth/anonymous_tokens/cpp/shared/proto_utils.h b/quiche/blind_sign_auth/anonymous_tokens/cpp/shared/proto_utils.h index 30fb2de..bc9b8df 100644 --- a/quiche/blind_sign_auth/anonymous_tokens/cpp/shared/proto_utils.h +++ b/quiche/blind_sign_auth/anonymous_tokens/cpp/shared/proto_utils.h
@@ -21,6 +21,10 @@ #include "absl/time/time.h" #include "quiche/blind_sign_auth/anonymous_tokens/proto/anonymous_tokens.pb.h" #include "quiche/common/platform/api/quiche_export.h" +// copybara:strip_begin(internal comment) +// The QUICHE_EXPORT annotation is necessary for some classes and functions +// to link correctly on Windows. Please do not remove them! +// copybara:strip_end namespace private_membership { namespace anonymous_tokens {
diff --git a/quiche/blind_sign_auth/anonymous_tokens/cpp/testing/utils.h b/quiche/blind_sign_auth/anonymous_tokens/cpp/testing/utils.h index d286d56..5c6aa1c 100644 --- a/quiche/blind_sign_auth/anonymous_tokens/cpp/testing/utils.h +++ b/quiche/blind_sign_auth/anonymous_tokens/cpp/testing/utils.h
@@ -26,12 +26,11 @@ #include "quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/constants.h" #include "quiche/blind_sign_auth/anonymous_tokens/proto/anonymous_tokens.pb.h" #include "openssl/base.h" -#include "quiche/common/platform/api/quiche_export.h" namespace private_membership { namespace anonymous_tokens { -struct QUICHE_EXPORT IetfStandardRsaBlindSignatureTestVector { +struct IetfStandardRsaBlindSignatureTestVector { std::string n; std::string e; std::string d; @@ -46,7 +45,7 @@ std::string signature; }; -struct QUICHE_EXPORT IetfRsaBlindSignatureWithPublicMetadataTestVector { +struct IetfRsaBlindSignatureWithPublicMetadataTestVector { std::string n; std::string e; std::string d; @@ -63,8 +62,7 @@ // Creates a pair containing a standard RSA Private key and an Anonymous Tokens // RSABlindSignaturePublicKey using RSA_F4 (65537) as the public exponent and // other input parameters. -absl::StatusOr<std::pair<bssl::UniquePtr<RSA>, - RSABlindSignaturePublicKey>> QUICHE_EXPORT +absl::StatusOr<std::pair<bssl::UniquePtr<RSA>, RSABlindSignaturePublicKey>> CreateTestKey(int key_size = 512, HashType sig_hash = AT_HASH_TYPE_SHA384, MaskGenFunction mfg1_hash = AT_MGF_SHA384, int salt_length = 48, MessageMaskType message_mask_type = AT_MESSAGE_MASK_CONCAT, @@ -83,65 +81,60 @@ // TestSign can be removed once rsa_blind_signer is moved to // anonympous_tokens/public/cpp/crypto -absl::StatusOr<std::string> QUICHE_EXPORT TestSign( - absl::string_view blinded_data, RSA* rsa_key); +absl::StatusOr<std::string> TestSign(absl::string_view blinded_data, + RSA* rsa_key); // TestSignWithPublicMetadata can be removed once rsa_blind_signer is moved to // anonympous_tokens/public/cpp/crypto -absl::StatusOr<std::string> QUICHE_EXPORT TestSignWithPublicMetadata( +absl::StatusOr<std::string> TestSignWithPublicMetadata( absl::string_view blinded_data, absl::string_view public_metadata, const RSA& rsa_key); // This method returns a newly generated RSA key pair, setting the public // exponent to be the standard RSA_F4 (65537) and the default modulus size to // 512 bytes. -absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> QUICHE_EXPORT -GetStandardRsaKeyPair(int modulus_size_in_bytes = kRsaModulusSizeInBytes512); +absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> GetStandardRsaKeyPair( + int modulus_size_in_bytes = kRsaModulusSizeInBytes512); // Method returns fixed 2048-bit strong RSA modulus for testing. -absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> QUICHE_EXPORT -GetStrongRsaKeys2048(); +absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> GetStrongRsaKeys2048(); // Method returns another fixed 2048-bit strong RSA modulus for testing. -absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> QUICHE_EXPORT +absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> GetAnotherStrongRsaKeys2048(); // Method returns fixed 3072-bit strong RSA modulus for testing. -absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> QUICHE_EXPORT -GetStrongRsaKeys3072(); +absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> GetStrongRsaKeys3072(); // Method returns fixed 4096-bit strong RSA modulus for testing. -absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> QUICHE_EXPORT -GetStrongRsaKeys4096(); +absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> GetStrongRsaKeys4096(); // Returns the IETF test example from // https://datatracker.ietf.org/doc/draft-irtf-cfrg-rsa-blind-signatures/ -IetfStandardRsaBlindSignatureTestVector QUICHE_EXPORT +IetfStandardRsaBlindSignatureTestVector GetIetfStandardRsaBlindSignatureTestVector(); // This method returns a RSA key pair as described in the IETF test example // above. -absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> QUICHE_EXPORT +absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> GetIetfStandardRsaBlindSignatureTestKeys(); // Returns the IETF test with Public Metadata examples from // https://datatracker.ietf.org/doc/draft-amjad-cfrg-partially-blind-rsa/ // // Note that all test vectors use the same RSA key pair. -std::vector< - IetfRsaBlindSignatureWithPublicMetadataTestVector> QUICHE_EXPORT +std::vector<IetfRsaBlindSignatureWithPublicMetadataTestVector> GetIetfRsaBlindSignatureWithPublicMetadataTestVectors(); // This method returns a RSA key pair as described in the IETF test with Public // Metadata example. It can be used for all test vectors returned by // GetIetfRsaBlindSignatureWithPublicMetadataTestVectors. -absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> QUICHE_EXPORT +absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>> GetIetfRsaBlindSignatureWithPublicMetadataTestKeys(); // Outputs a random string of n characters. -std::string QUICHE_EXPORT RandomString( - int n, std::uniform_int_distribution<int>* distr_u8, - std::mt19937_64* generator); +std::string RandomString(int n, std::uniform_int_distribution<int>* distr_u8, + std::mt19937_64* generator); #define ANON_TOKENS_ASSERT_OK_AND_ASSIGN(lhs, rexpr) \ ANON_TOKENS_ASSERT_OK_AND_ASSIGN_IMPL_( \