From 80765a797b4174fc05541ef84c2fb7f3261d40ff Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 25 Aug 2019 19:14:53 -0400 Subject: [PATCH] correct outer cipher text len --- libi2pd/LeaseSet.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libi2pd/LeaseSet.cpp b/libi2pd/LeaseSet.cpp index c44a2f6f..3a4ddd1f 100644 --- a/libi2pd/LeaseSet.cpp +++ b/libi2pd/LeaseSet.cpp @@ -834,7 +834,11 @@ namespace data { if (authType == ENCRYPTED_LEASESET_AUTH_TYPE_DH) layer1Flags |= 0x01; // DH, authentication scheme 0, auth bit 1 else if (authType == ENCRYPTED_LEASESET_AUTH_TYPE_PSK) layer1Flags |= 0x03; // PSK, authentication scheme 1, auth bit 1 - if (layer1Flags) m_BufferLen += authKeys->size ()*40 + 2; // auth data len + if (layer1Flags) + { + m_BufferLen += authKeys->size ()*40 + 2; // auth data len + lenOuterCiphertext += authKeys->size ()*40 + 2; + } } m_Buffer = new uint8_t[m_BufferLen + 1]; m_Buffer[0] = NETDB_STORE_TYPE_ENCRYPTED_LEASESET2;