Skip to content

Commit 8b2891a

Browse files
committed
i2p: use the same destination type for transient and persistent addresses
We generate our persistent I2P address with type `EdDSA_SHA512_Ed25519` (`DEST GENERATE SIGNATURE_TYPE=7`). Use the same type for our transient addresses which are created by the `SESSION CREATE ...` command. If not specified, then the default one is `DSA_SHA1` according to https://geti2p.net/en/docs/api/samv3.
1 parent 5558d2f commit 8b2891a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/i2p.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ void Session::DestGenerate(const Sock& sock)
325325
// https://geti2p.net/spec/common-structures#key-certificates
326326
// "7" or "EdDSA_SHA512_Ed25519" - "Recent Router Identities and Destinations".
327327
// Use "7" because i2pd <2.24.0 does not recognize the textual form.
328+
// If SIGNATURE_TYPE is not specified, then the default one is DSA_SHA1.
328329
const Reply& reply = SendRequestAndGetReply(sock, "DEST GENERATE SIGNATURE_TYPE=7", false);
329330

330331
m_private_key = DecodeI2PBase64(reply.Get("PRIV"));
@@ -378,7 +379,7 @@ void Session::CreateIfNotCreatedAlready()
378379
// in the reply in DESTINATION=.
379380
const Reply& reply = SendRequestAndGetReply(
380381
*sock,
381-
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=TRANSIENT", session_id));
382+
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=TRANSIENT SIGNATURE_TYPE=7", session_id));
382383

383384
m_private_key = DecodeI2PBase64(reply.Get("DESTINATION"));
384385
} else {

0 commit comments

Comments
 (0)