mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
net: create I2P sessions with both ECIES-X25519 and ElGamal encryption
A Bitcoin Core node may only connect to a peer destination via I2P if both sides
have sessions with the same encryption type. The encryption type is a property
of the session, not the destination. Sessions may support multiple encryption
types.
As Bitcoin Core is not currently setting the I2P encryption type when creating
sessions, it is using the older default, ElGamal (type 0).
This pull updates Bitcoin Core to use both ECIES-X25519 and ElGamal (types 4 and
0, respectively). This allows to connect to I2P peers with either type, and the
newer, faster ECIES-X25519 will be preferred.
See also the recently updated section "Signature and Encryption Types" in
https://geti2p.net/en/docs/api/samv3
Thanks and credit to zzzi2p (https://github.com/zzzi2p) for reporting.
Closes https://github.com/bitcoin/bitcoin/issues/29197.
Github-Pull: #29200
Rebased-From: 9d728916b2
This commit is contained in:
parent
fc62271015
commit
fe0f8fe8aa
1 changed files with 2 additions and 2 deletions
|
@ -427,7 +427,7 @@ void Session::CreateIfNotCreatedAlready()
|
|||
const Reply& reply = SendRequestAndGetReply(
|
||||
*sock,
|
||||
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=TRANSIENT SIGNATURE_TYPE=7 "
|
||||
"inbound.quantity=1 outbound.quantity=1",
|
||||
"i2cp.leaseSetEncType=4,0 inbound.quantity=1 outbound.quantity=1",
|
||||
session_id));
|
||||
|
||||
m_private_key = DecodeI2PBase64(reply.Get("DESTINATION"));
|
||||
|
@ -445,7 +445,7 @@ void Session::CreateIfNotCreatedAlready()
|
|||
|
||||
SendRequestAndGetReply(*sock,
|
||||
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=%s "
|
||||
"inbound.quantity=3 outbound.quantity=3",
|
||||
"i2cp.leaseSetEncType=4,0 inbound.quantity=3 outbound.quantity=3",
|
||||
session_id,
|
||||
private_key_b64));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue