Commit Graph
28 Commits
Author SHA1 Message Date
orignal daf3b5c58d check encryption key len for known key types 2026-09-16 08:31:21 -04:00
orignal 8769d0615a Revert "LeaseSet2: check declared key length before creating an encryptor" 2026-09-16 07:27:26 -04:00
PobreGatoandClaude Opus 5 466e865e91 LeaseSet2: check declared key length before creating an encryptor
A key section in a standard LeaseSet2 carries both a key type and a key
length. The length is checked against the buffer, but the encryptor reads
a length fixed by the type instead: 256 bytes for ElGamal, 64 for ECIES
P256, 32 for X25519. A section that declares ElGamal with a length of zero
passes the check and then makes CreateEncryptor read 256 bytes past the end
of the message.

Key sections are parsed before the signature is verified, so no key material
is needed to trigger it.

GetCryptoPublicKeyLen returned 32 for ECIES P256, while the key is x and y,
32 bytes each; without fixing that too, the new check would still let a 32
byte P256 section through.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Awv7FvZTpGFsKFNeNyJaTE
2026-09-14 21:43:53 -04:00
orignal 855e111bd0 fixed private key size and publishing for crypto type 1 2025-05-02 08:32:20 -04:00
orignal f6c93f7345 common LocalEncryptionKey to pass to loacl LeaseSet 2025-04-16 15:40:09 -04:00
orignal 9c46ff2449 Initial Noise states and encryptors/decryptors for ML-KEM-768 and ML-KEM-1024 2025-04-15 13:26:19 -04:00
orignal 4c5d0116f8 moved ML-KEM code to PostQuntum.h/.cpp 2025-04-14 18:21:07 -04:00
orignal 9ab1a67f0b common ML-KEM names and key lengths 2025-04-13 18:18:44 -04:00
orignal 9ce515ff79 MLKEM512_X25519 crypto key added 2025-03-19 08:40:10 -04:00
orignal bd2b96627c calculate crypto key length from key type 2025-03-18 19:23:13 -04:00
R4SAS edc0162163 clean line trailing spaces and tabs
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2021-11-27 23:30:35 +03:00
orignal 349022ae42 don't select ElGamal routers for tunnels 2021-09-03 13:30:01 -04:00
orignal bb518d3d51 don't pass BN_CTX to encrypt/decrypt functions 2021-08-31 18:51:40 -04:00
orignal c45e202fab removed ElGamal encryption support for own router 2021-08-29 14:22:01 -04:00
orignal e135696530 support multiple encryption keys through the I2CP 2020-06-03 16:05:19 -04:00
R4SAS 8bae4975fb add copyright headers
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2020-05-22 18:14:53 +00:00
R4SAS 7a5146ea74 fix code syle(spaces->tabs, tabulations)
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2020-05-22 18:14:53 +00:00
orignal b6800dd125 lookup ECIESX25519AEADRatchet session by static key 2020-01-16 15:45:22 -05:00
orignal 9f79bdae9b encryptor for ECIES-X25519-AEAD-Ratchet 2019-12-19 15:59:15 -05:00
orignal 521fb83e38 initial code for ECIES-X25519-AEAD-Ratchet KDF 2019-12-17 16:18:40 -05:00
orignal 553d59c32b decryptor for ECIES-X25519-AEAD-Ratchet 2019-12-11 13:38:36 -05:00
orignal 6569c4aa03 actual key size for LS2 2019-01-13 19:17:02 -05:00
orignal 182ffe4495 use croorect encryption type for tunnel build 2018-03-09 14:56:06 -05:00
yangfl 46f62e1af9 remove trailing whitespaces 2018-01-06 22:24:03 +08:00
orignal ab1cd3f5cf ECIES for GOST R 34.10 2017-11-09 15:01:07 -05:00
orignal 81658d2ff9 generic encryption for RoutingDestination 2017-11-07 15:05:22 -05:00
orignal 9fa67b0e0a crypto key encryptor and decryptor 2017-11-06 15:54:18 -05:00
orignal efacfced45 CryptoKey added 2017-11-06 13:40:58 -05:00