mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-23 04:21:37 +00:00
Revert "LeaseSet2: check declared key length before creating an encryptor"
This commit is contained in:
1 parent
99eab7aceb
commit
8769d0615a
2 files changed
+2
-7
No files matched your search
@@ -423,12 +423,7 @@ namespace data
|
||||
if (keyType <= i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD) // skip PQ keys if not supported
|
||||
#endif
|
||||
{
|
||||
// encryptionKeyLen is the length the publisher declares, and it was
|
||||
// checked against the buffer. The encryptor reads a length fixed by
|
||||
// the key type instead, so a section declaring a short ElGamal key
|
||||
// makes it read 256 bytes out of a few
|
||||
if (encryptionKeyLen >= i2p::crypto::GetCryptoPublicKeyLen (keyType) &&
|
||||
(keyType == m_PreferredEncryptionType || !newEncryptor || keyType > newEncryptionType) &&
|
||||
if ((keyType == m_PreferredEncryptionType || !newEncryptor || keyType > newEncryptionType) &&
|
||||
(!dest || dest->SupportsEncryptionType (keyType)))
|
||||
{
|
||||
auto encryptor = i2p::data::IdentityEx::CreateEncryptor (keyType, buf + offset);
|
||||
|
||||
Reference in new issue
Block a user