From 126320c881d64cdfd1851d359da363e83d5c0f6e Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Mon, 4 May 2015 17:43:00 -0700 Subject: [PATCH] Add dummy EC_GROUP_set_point_conversion_form. BoringSSL always uses uncompressed points. This function aborts if another form is requested or does nothing if uncompressed points are requested. Change-Id: I80bc01444cdf9c789c9c75312b5527bf4957361b --- crypto/ec/ec.c | 7 +++++++ include/openssl/ec.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/crypto/ec/ec.c b/crypto/ec/ec.c index 10220cbc..5426b8ff 100644 --- a/crypto/ec/ec.c +++ b/crypto/ec/ec.c @@ -858,3 +858,10 @@ const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group) { int EC_METHOD_get_field_type(const EC_METHOD *meth) { return NID_X9_62_prime_field; } + +void EC_GROUP_set_point_conversion_form(EC_GROUP *group, + point_conversion_form_t form) { + if (form != POINT_CONVERSION_UNCOMPRESSED) { + abort(); + } +} diff --git a/include/openssl/ec.h b/include/openssl/ec.h index beb8db1a..aeb2285f 100644 --- a/include/openssl/ec.h +++ b/include/openssl/ec.h @@ -299,6 +299,11 @@ OPENSSL_EXPORT const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group); /* EC_METHOD_get_field_type returns NID_X9_62_prime_field. */ OPENSSL_EXPORT int EC_METHOD_get_field_type(const EC_METHOD *meth); +/* EC_GROUP_set_point_conversion_form aborts the process if |form| is not + * |POINT_CONVERSION_UNCOMPRESSED| and otherwise does nothing. */ +OPENSSL_EXPORT void EC_GROUP_set_point_conversion_form( + EC_GROUP *group, point_conversion_form_t form); + /* Old code expects to get EC_KEY from ec.h. */ #if !defined(OPENSSL_HEADER_EC_KEY_H)