From 76212eb9d7395b8da3217f4449026dd606b4d8f6 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 9 Jul 2026 10:08:38 -0400 Subject: [PATCH] include FROM to FIN packet if offline signature --- libi2pd/Streaming.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libi2pd/Streaming.cpp b/libi2pd/Streaming.cpp index f6b792f2..d2c664e1 100644 --- a/libi2pd/Streaming.cpp +++ b/libi2pd/Streaming.cpp @@ -1390,7 +1390,7 @@ namespace stream { flags |= PACKET_FLAG_SIGNATURE_INCLUDED; isOfflineSignature = m_LocalDestination.GetOwner ()->GetPrivateKeys ().IsOfflineSignature (); - if (isOfflineSignature) flags |= PACKET_FLAG_OFFLINE_SIGNATURE; + if (isOfflineSignature) flags |= PACKET_FLAG_OFFLINE_SIGNATURE | PACKET_FLAG_FROM_INCLUDED; } htobe16buf (packet + size, flags); size += 2; // flags @@ -1405,6 +1405,10 @@ namespace stream size += 2; // options size if (isOfflineSignature) { + // we must include FROM if offline signature for compatibility with Java-I2P + size_t identityLen = m_LocalDestination.GetOwner ()->GetIdentity ()->GetFullLen (); + m_LocalDestination.GetOwner ()->GetIdentity ()->ToBuffer (packet + size, identityLen); + size += identityLen; // from const auto& offlineSignature = m_LocalDestination.GetOwner ()->GetPrivateKeys ().GetOfflineSignature (); memcpy (packet + size, offlineSignature.data (), offlineSignature.size ()); size += offlineSignature.size (); // offline signature