Commit 2db70f54 authored by Benjamin Peterson's avatar Benjamin Peterson

fix error message for invalid curve name

parent 2e73b2a5
......@@ -2855,8 +2855,12 @@ set_ecdh_curve(PySSLContext *self, PyObject *name)
}
nid = OBJ_sn2nid(name_bytes);
if (nid == 0) {
PyObject *r = PyObject_Repr(name);
if (!r)
return NULL;
PyErr_Format(PyExc_ValueError,
"unknown elliptic curve name %R", name);
"unknown elliptic curve name %s", PyString_AS_STRING(r));
Py_DECREF(r);
return NULL;
}
key = EC_KEY_new_by_curve_name(nid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment