Files
scriptc/docs
Chris Tate fb544eb98e Validate DiffieHellman peer keys like Node: oversized keys and RFC 5114 subgroups
Keys, primes and generators drop their leading zero bytes before import,
as BN_bin2bn does, and a value still past mbedTLS's 80000-byte limit
throws Node's error or a coded SC2020 error instead of aborting the
process: computeSecret rejects a key longer than the prime as too large,
a long generator is a bad generator, and setPublicKey/setPrivateKey
refuse with SC2020.

Under the RFC 5114 groups, computeSecret rejects a peer key with
key^q mod p != 1 with ERR_CRYPTO_INVALID_KEYTYPE, as OpenSSL's public
key check does, closing small-subgroup confinement of the private key.
The safe-prime groups keep the range check only, as in Node.

Exponents past 8192 bits are split into digits bit by bit, so
generateKeys with a long private key takes linear time.
2026-10-22 06:07:58 -05:00
..
2026-07-22 18:08:04 -05:00
2026-10-22 04:08:52 -05:00
2026-10-02 00:58:25 -05:00
2026-10-02 00:58:25 -05:00
2026-07-22 18:08:04 -05:00
2026-07-22 18:08:04 -05:00