From 76164b1bc98a005e4cc01f4f35bc2f4dcd2098da Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Wed, 6 Jan 2021 16:34:01 -0800 Subject: [PATCH] Add some OpenSSL-compatibility aliases Change-Id: I808f37c2980e36843b5b5d29174b4f27a030738a Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/44924 Commit-Queue: David Benjamin Reviewed-by: David Benjamin --- crypto/fipsmodule/ec/ec.c | 6 ++++++ crypto/rand_extra/rand_extra.c | 4 ++++ decrepit/cfb/cfb.c | 2 ++ include/openssl/cipher.h | 8 ++++++++ include/openssl/ec.h | 8 ++++++++ include/openssl/rand.h | 3 +++ 6 files changed, 31 insertions(+) diff --git a/crypto/fipsmodule/ec/ec.c b/crypto/fipsmodule/ec/ec.c index ab2fd89a1..b25012357 100644 --- a/crypto/fipsmodule/ec/ec.c +++ b/crypto/fipsmodule/ec/ec.c @@ -879,6 +879,12 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, return 1; } +int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *point, + const BIGNUM *x, const BIGNUM *y, + BN_CTX *ctx) { + return EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx); +} + int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx) { if (EC_GROUP_cmp(group, r->group, NULL) != 0 || diff --git a/crypto/rand_extra/rand_extra.c b/crypto/rand_extra/rand_extra.c index bed9e1ef0..596605acc 100644 --- a/crypto/rand_extra/rand_extra.c +++ b/crypto/rand_extra/rand_extra.c @@ -63,6 +63,10 @@ RAND_METHOD *RAND_SSLeay(void) { return (RAND_METHOD*) &kSSLeayMethod; } +RAND_METHOD *RAND_OpenSSL(void) { + return RAND_SSLeay(); +} + const RAND_METHOD *RAND_get_rand_method(void) { return RAND_SSLeay(); } void RAND_set_rand_method(const RAND_METHOD *method) {} diff --git a/decrepit/cfb/cfb.c b/decrepit/cfb/cfb.c index 441ebe63f..380d4ee0d 100644 --- a/decrepit/cfb/cfb.c +++ b/decrepit/cfb/cfb.c @@ -65,4 +65,6 @@ static const EVP_CIPHER aes_256_cfb128 = { }; const EVP_CIPHER *EVP_aes_128_cfb128(void) { return &aes_128_cfb128; } +const EVP_CIPHER *EVP_aes_128_cfb(void) { return &aes_128_cfb128; } const EVP_CIPHER *EVP_aes_256_cfb128(void) { return &aes_256_cfb128; } +const EVP_CIPHER *EVP_aes_256_cfb(void) { return &aes_256_cfb128; } diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h index 31390a3f6..81018db60 100644 --- a/include/openssl/cipher.h +++ b/include/openssl/cipher.h @@ -431,9 +431,17 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void); // EVP_aes_128_cfb128 is only available in decrepit. OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb128(void); +// EVP_aes_128_cfb is an alias for |EVP_aes_128_cfb128| and is only available in +// decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb(void); + // EVP_aes_256_cfb128 is only available in decrepit. OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_cfb128(void); +// EVP_aes_256_cfb is an alias for |EVP_aes_256_cfb128| and is only available in +// decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_cfb(void); + // EVP_bf_ecb is Blowfish in ECB mode and is only available in decrepit. OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_ecb(void); diff --git a/include/openssl/ec.h b/include/openssl/ec.h index cfad93e14..bd0c0f37c 100644 --- a/include/openssl/ec.h +++ b/include/openssl/ec.h @@ -237,6 +237,14 @@ OPENSSL_EXPORT int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, const BIGNUM *y, BN_CTX *ctx); +// EC_POINT_set_affine_coordinates is an alias of +// |EC_POINT_set_affine_coordinates_GFp|. +OPENSSL_EXPORT int EC_POINT_set_affine_coordinates(const EC_GROUP *group, + EC_POINT *point, + const BIGNUM *x, + const BIGNUM *y, + BN_CTX *ctx); + // EC_POINT_point2oct serialises |point| into the X9.62 form given by |form| // into, at most, |len| bytes at |buf|. It returns the number of bytes written // or zero on error if |buf| is non-NULL, else the number of bytes needed. The diff --git a/include/openssl/rand.h b/include/openssl/rand.h index 4847eb753..b07015b32 100644 --- a/include/openssl/rand.h +++ b/include/openssl/rand.h @@ -97,6 +97,9 @@ struct rand_meth_st { // RAND_SSLeay returns a pointer to a dummy |RAND_METHOD|. OPENSSL_EXPORT RAND_METHOD *RAND_SSLeay(void); +// RAND_OpenSSL returns a pointer to a dummy |RAND_METHOD|. +OPENSSL_EXPORT RAND_METHOD *RAND_OpenSSL(void); + // RAND_get_rand_method returns |RAND_SSLeay()|. OPENSSL_EXPORT const RAND_METHOD *RAND_get_rand_method(void);