summaryrefslogtreecommitdiff
path: root/src/_cffi_src/openssl
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2023-03-09 19:06:01 +0800
committerGitHub <noreply@github.com>2023-03-09 06:06:01 -0500
commit56bcc522b0ab69c82f3381da1507d4dca0b03ffc (patch)
tree0e1cfee86aaf0f40a00d39e8baf3885374075f4a /src/_cffi_src/openssl
parent36f418a6877c60459259acb796fc886bdac64421 (diff)
downloadcryptography-56bcc522b0ab69c82f3381da1507d4dca0b03ffc.tar.gz
replace use of EC_KEY_set_public_key_affine_coordinates (#8475)
EC_KEY_set_public_key_affine_coordinates calls EC_KEY_check_key, which checks the point isn't at infinity, that it is on the curve (which has already been done by EC_POINT_set_affine_coordinates), and that the private scalar matches the public point. We don't want to do expensive checks twice, so instead we swap to calling EC_POINT_set_affine_coordinates directly and implement a private scalar matches public point check of our own. Also we no longer call deprecated functions.
Diffstat (limited to 'src/_cffi_src/openssl')
-rw-r--r--src/_cffi_src/openssl/ec.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/_cffi_src/openssl/ec.py b/src/_cffi_src/openssl/ec.py
index 0c7e0545e..b037675f0 100644
--- a/src/_cffi_src/openssl/ec.py
+++ b/src/_cffi_src/openssl/ec.py
@@ -45,11 +45,14 @@ const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *);
int EC_KEY_set_public_key(EC_KEY *, const EC_POINT *);
void EC_KEY_set_asn1_flag(EC_KEY *, int);
int EC_KEY_generate_key(EC_KEY *);
-int EC_KEY_set_public_key_affine_coordinates(EC_KEY *, BIGNUM *, BIGNUM *);
EC_POINT *EC_POINT_new(const EC_GROUP *);
void EC_POINT_free(EC_POINT *);
+int EC_POINT_cmp(const EC_GROUP *, const EC_POINT *, const EC_POINT *,
+ BN_CTX *);
+int EC_POINT_set_affine_coordinates(const EC_GROUP *, EC_POINT *,
+ const BIGNUM *, const BIGNUM *, BN_CTX *);
int EC_POINT_get_affine_coordinates(const EC_GROUP *, const EC_POINT *,
BIGNUM *, BIGNUM *, BN_CTX *);