diff options
Diffstat (limited to 'src/lib/pubkey/pkcs8.cpp')
-rw-r--r-- | src/lib/pubkey/pkcs8.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/pubkey/pkcs8.cpp b/src/lib/pubkey/pkcs8.cpp index d299a98a4..b6d33cfcb 100644 --- a/src/lib/pubkey/pkcs8.cpp +++ b/src/lib/pubkey/pkcs8.cpp @@ -160,10 +160,15 @@ choose_pbe_params(const std::string& pbe_algo, const std::string& key_algo) if(pbe_algo.empty()) { // Defaults: - if(key_algo == "Curve25519" || key_algo == "McEliece") + const bool nonstandard_pk = (key_algo == "McEliece" || key_algo == "XMSS"); + +#if defined(BOTAN_HAS_GCM) && defined(BOTAN_HAS_SHA2_64) + if(nonstandard_pk) return std::make_pair("AES-256/GCM", "SHA-512"); - else // for everything else (RSA, DSA, ECDSA, GOST, ...) - return std::make_pair("AES-256/CBC", "SHA-256"); +#endif + + // Default is something compatible with everyone else + return std::make_pair("AES-256/CBC", "SHA-256"); } SCAN_Name request(pbe_algo); |