net: create I2P sessions using both ECIES-X25519 and ElGamal encryption #29200

pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:2024-01-i2p-use-both-encryption-types changing 1 files +2 −2
  1. jonatack commented at 10:39 pm on January 7, 2024: contributor

    A Bitcoin Core node may only connect to a peer destination via I2P if both sides have sessions with the same encryption type. 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 encryption type when creating I2P sessions, it uses the older default, ElGamal (type 0).

    This pull updates our I2P session creation to use both ECIES-X25519 and ElGamal (types 4 and 0, respectively). This allows to connect to I2P peers of either type, and the newer, faster ECIES-X25519 will be preferred.

    See also:

    Thank you and credit to zzzi2p for reporting and to vort for the patch.

    Closes #29197.

  2. 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.
    9d728916b2
  3. DrahtBot commented at 10:39 pm on January 7, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label P2P on Jan 7, 2024
  5. zzzi2p commented at 0:08 am on January 8, 2024: none
    ACK 9d728916b27e18efc6f8839770ed5ec14789fc08
  6. kristapsk approved
  7. kristapsk commented at 0:17 am on January 8, 2024: contributor
    cr utACK 9d728916b27e18efc6f8839770ed5ec14789fc08
  8. jonatack commented at 2:31 am on January 8, 2024: contributor
    544A5198-B738-49C5-A08E-0630603AE372_4_5005_c
  9. brunoerg approved
  10. brunoerg commented at 9:45 am on January 8, 2024: contributor
    crACK 9d728916b27e18efc6f8839770ed5ec14789fc08
  11. recursive-rat4 commented at 2:32 pm on January 8, 2024: none

    ACK 9d728916b27e18efc6f8839770ed5ec14789fc08

    I2P 2.3.0 shows both encryption keys.

  12. shaavan approved
  13. shaavan commented at 12:15 pm on January 9, 2024: contributor

    crACK 9d728916b27e18efc6f8839770ed5ec14789fc08

    Expanded Encryption Support: Enables I2P to connect using both ECIES-X25519 and ElGamal encryption types (4 and 0, respectively), broadening secure connectivity options beyond the default ElGamal.

    Optimal Encryption Choice: Code logic appropriately prioritizes the faster ECIES-X25519 encryption, aligning with best practices for security and performance.

    Clear Rationale: Commit message provides a concise and transparent explanation for the code update, enhancing overall clarity.

    Overall, this PR enhances encryption flexibility, prioritizing speed, and maintains clear documentation.

  14. fanquake merged this on Jan 9, 2024
  15. fanquake closed this on Jan 9, 2024

  16. fanquake added the label Needs backport (26.x) on Jan 9, 2024
  17. jonatack deleted the branch on Jan 9, 2024
  18. glozow referenced this in commit 44c72a3a15 on Jan 10, 2024
  19. glozow commented at 5:00 pm on January 10, 2024: member
    Backported in #29209
  20. glozow removed the label Needs backport (26.x) on Jan 10, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-11 06:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me