mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-24 06:13:09 +00:00
check outer plaintext length in encrypted LeaseSet2
This commit is contained in:
1 parent
82047ccbc4
commit
a5d4896a5c
1 file changed
+5
@@ -573,6 +573,11 @@ namespace data
|
||||
// keys = HKDF(innerSalt, innerInput, "ELS2_L2K", 44)
|
||||
uint8_t innerInput[68];
|
||||
size_t authDataLen = ExtractClientAuthData (outerPlainText.data (), lenOuterPlaintext, secret, subcredential, innerInput);
|
||||
if (lenOuterPlaintext < authDataLen + 34) // flag + authData + inner salt + at least one byte of inner plaintext
|
||||
{
|
||||
LogPrint (eLogError, "LeaseSet2: Outer plaintext is too short ", lenOuterPlaintext);
|
||||
return;
|
||||
}
|
||||
if (authDataLen > 0)
|
||||
{
|
||||
memcpy (innerInput + 32, subcredential, 36);
|
||||
|
||||
Reference in new issue
Block a user