Comment 2 for bug 1233810

Revision history for this message
Tobias Oberstein (tobias-oberstein) wrote :

2 notes:

1) It works for me with pyOpenSSL HEAD. With a suitable ECDH enabled OpenSSL, this indeed provides ECDH (tested with https://www.ssllabs.com/ssltest/analyze.html and `openssl s_client`

2) There is a small typo in

```
:param curve_name: The curve name constant (e.g. SSL.NID_X9_64_prime256v1)
```

This should be `SSL.NID_X9_62_prime256v1`.

Probably it would also be helpful to list the available curves in the function docstring.

3) Besides having the constant for curve identification, it would also be nice to have the human readable curve names accesible (for UI reasons .. let the user choose the curve).

SSL.SN_X9_62_prime192v1 = "prime192v1"
SSL.SN_X9_62_prime192v2 = "prime192v2"
SSL.SN_X9_62_prime192v3 = "prime192v3"
SSL.SN_X9_62_prime239v1 = "prime239v1"
SSL.SN_X9_62_prime239v2 = "prime239v2"
SSL.SN_X9_62_prime239v3 = "prime239v3"
SSL.SN_X9_62_prime256v1 = "prime256v1"

so one can do things like

```
ELLIPTIC_CURVES = {
   SSL.SN_X9_62_prime192v1: SSL.NID_X9_62_prime192v1,
   SSL.SN_X9_62_prime192v2: SSL.NID_X9_62_prime192v2,
   SSL.SN_X9_62_prime192v3: SSL.NID_X9_62_prime192v3,
   SSL.SN_X9_62_prime239v1: SSL.NID_X9_62_prime239v1,
   SSL.SN_X9_62_prime239v2: SSL.NID_X9_62_prime239v2,
   SSL.SN_X9_62_prime239v3: SSL.NID_X9_62_prime239v3,
   SSL.SN_X9_62_prime256v1: SSL.NID_X9_62_prime256v1
}

ECDH_DEFAULT_CURVE = ELLIPTIC_CURVES["prime256v1"]
```