Skip to content

Commit 19526d9

Browse files
committed
Merge bitcoin/bitcoin#26065: i2p: use the same destination type for transient and persistent addresses
8b2891a i2p: use the same destination type for transient and persistent addresses (Vasil Dimov) Pull request description: 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. Fixes bitcoin/bitcoin#26062 ACKs for top commit: mzumsande: ACK 8b2891a sipa: utACK 8b2891a; didn't test but verified this matches the documentation Tree-SHA512: 1b10e7e1e274b77609d08ee9cf9d73fef8c975c51aec452ce23e15fcf41709398c697087bfdece121b1fd26bc0501fc45857a91aaab679cadd0cbb37dd94c3a7
2 parents 27351fb + 8b2891a commit 19526d9

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)