set preferred crypto if i2cp.leaseSetEncType is not specified

This commit is contained in:
orignal
2026-01-31 12:16:57 -05:00
parent 85466e80b5
commit 2f8480f908
+9 -2
View File
@@ -1013,13 +1013,20 @@ namespace client
}
}
}
// if no param or valid crypto type use from identity
// if no encryption type specified use 0,4 or 0,4,6 if post quantum
if (encryptionKeyTypes.empty ())
{
encryptionKeyTypes.insert ( { GetIdentity ()->GetCryptoKeyType (),
#if OPENSSL_PQ
i2p::data::CRYPTO_KEY_TYPE_ECIES_MLKEM768_X25519_AEAD,
#endif
i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD }); // usually 0,4 or 0,6,4 if post quantum
i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD });
#if OPENSSL_PQ
m_PreferredCryptoType = i2p::data::CRYPTO_KEY_TYPE_ECIES_MLKEM768_X25519_AEAD;
#else
m_PreferredCryptoType = i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD;
#endif
}
for (auto& it: encryptionKeyTypes)
{