Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions ext/openssl/ossl.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@
(LIBRESSL_VERSION_NUMBER >= ((maj << 28) | (min << 20) | (pat << 12)))
#endif

#if OSSL_OPENSSL_PREREQ(3, 0, 0)
# define OSSL_3_const const
#else
# define OSSL_3_const /* const */
#endif

#if !defined(OPENSSL_NO_ENGINE) && !OSSL_OPENSSL_PREREQ(3, 0, 0)
# define OSSL_USE_ENGINE
#endif
Expand Down
13 changes: 6 additions & 7 deletions ext/openssl/ossl_pkey_dh.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ static VALUE
ossl_dh_initialize_copy(VALUE self, VALUE other)
{
EVP_PKEY *pkey;
DH *dh;
OSSL_3_const DH *dh_other;
DH *dh, *dh_other;
const BIGNUM *pub, *priv;

TypedData_Get_Struct(self, EVP_PKEY, &ossl_evp_pkey_type, pkey);
Expand Down Expand Up @@ -188,7 +187,7 @@ ossl_dh_initialize_copy(VALUE self, VALUE other)
static VALUE
ossl_dh_is_public(VALUE self)
{
OSSL_3_const DH *dh;
const DH *dh;
const BIGNUM *bn;

GetDH(self, dh);
Expand All @@ -207,7 +206,7 @@ ossl_dh_is_public(VALUE self)
static VALUE
ossl_dh_is_private(VALUE self)
{
OSSL_3_const DH *dh;
const DH *dh;
const BIGNUM *bn;

GetDH(self, dh);
Expand Down Expand Up @@ -244,7 +243,7 @@ ossl_dh_is_private(VALUE self)
static VALUE
ossl_dh_export(VALUE self)
{
OSSL_3_const DH *dh;
const DH *dh;
BIO *out;
VALUE str;

Expand Down Expand Up @@ -277,7 +276,7 @@ ossl_dh_export(VALUE self)
static VALUE
ossl_dh_to_der(VALUE self)
{
OSSL_3_const DH *dh;
const DH *dh;
unsigned char *p;
long len;
VALUE str;
Expand Down Expand Up @@ -319,7 +318,7 @@ ossl_dh_check_params(VALUE self)
ret = EVP_PKEY_param_check(pctx);
EVP_PKEY_CTX_free(pctx);
#else
OSSL_3_const DH *dh;
const DH *dh;
int codes;

GetDH(self, dh);
Expand Down
12 changes: 6 additions & 6 deletions ext/openssl/ossl_pkey_dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
} while (0)

static inline int
DSA_HAS_PRIVATE(OSSL_3_const DSA *dsa)
DSA_HAS_PRIVATE(const DSA *dsa)
{
const BIGNUM *bn;
DSA_get0_key(dsa, NULL, &bn);
return !!bn;
}

static inline int
DSA_PRIVATE(VALUE obj, OSSL_3_const DSA *dsa)
DSA_PRIVATE(VALUE obj, const DSA *dsa)
{
return DSA_HAS_PRIVATE(dsa) || OSSL_PKEY_IS_PRIVATE(obj);
}
Expand Down Expand Up @@ -152,7 +152,7 @@ static VALUE
ossl_dsa_initialize_copy(VALUE self, VALUE other)
{
EVP_PKEY *pkey;
OSSL_3_const DSA *dsa;
const DSA *dsa;
DSA *dsa_new;

TypedData_Get_Struct(self, EVP_PKEY, &ossl_evp_pkey_type, pkey);
Expand Down Expand Up @@ -207,7 +207,7 @@ ossl_dsa_is_public(VALUE self)
static VALUE
ossl_dsa_is_private(VALUE self)
{
OSSL_3_const DSA *dsa;
const DSA *dsa;

GetDSA(self, dsa);

Expand Down Expand Up @@ -276,7 +276,7 @@ ossl_dsa_is_private(VALUE self)
static VALUE
ossl_dsa_export(int argc, VALUE *argv, VALUE self)
{
OSSL_3_const DSA *dsa;
const DSA *dsa;

GetDSA(self, dsa);
if (DSA_HAS_PRIVATE(dsa))
Expand All @@ -302,7 +302,7 @@ ossl_dsa_export(int argc, VALUE *argv, VALUE self)
static VALUE
ossl_dsa_to_der(VALUE self)
{
OSSL_3_const DSA *dsa;
const DSA *dsa;

GetDSA(self, dsa);
if (DSA_HAS_PRIVATE(dsa))
Expand Down
18 changes: 9 additions & 9 deletions ext/openssl/ossl_pkey_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static VALUE
ossl_ec_key_initialize_copy(VALUE self, VALUE other)
{
EVP_PKEY *pkey;
OSSL_3_const EC_KEY *ec;
const EC_KEY *ec;
EC_KEY *ec_new;

TypedData_Get_Struct(self, EVP_PKEY, &ossl_evp_pkey_type, pkey);
Expand Down Expand Up @@ -232,7 +232,7 @@ ossl_ec_key_initialize_copy(VALUE self, VALUE other)
static VALUE
ossl_ec_key_get_group(VALUE self)
{
OSSL_3_const EC_KEY *ec;
const EC_KEY *ec;
const EC_GROUP *group;

GetEC(self, ec);
Expand Down Expand Up @@ -277,7 +277,7 @@ ossl_ec_key_set_group(VALUE self, VALUE group_v)
*/
static VALUE ossl_ec_key_get_private_key(VALUE self)
{
OSSL_3_const EC_KEY *ec;
const EC_KEY *ec;
const BIGNUM *bn;

GetEC(self, ec);
Expand Down Expand Up @@ -328,7 +328,7 @@ static VALUE ossl_ec_key_set_private_key(VALUE self, VALUE private_key)
*/
static VALUE ossl_ec_key_get_public_key(VALUE self)
{
OSSL_3_const EC_KEY *ec;
const EC_KEY *ec;
const EC_POINT *point;

GetEC(self, ec);
Expand Down Expand Up @@ -380,7 +380,7 @@ static VALUE ossl_ec_key_set_public_key(VALUE self, VALUE public_key)
*/
static VALUE ossl_ec_key_is_public(VALUE self)
{
OSSL_3_const EC_KEY *ec;
const EC_KEY *ec;

GetEC(self, ec);

Expand All @@ -396,7 +396,7 @@ static VALUE ossl_ec_key_is_public(VALUE self)
*/
static VALUE ossl_ec_key_is_private(VALUE self)
{
OSSL_3_const EC_KEY *ec;
const EC_KEY *ec;

GetEC(self, ec);

Expand Down Expand Up @@ -464,7 +464,7 @@ static VALUE ossl_ec_key_is_private(VALUE self)
static VALUE
ossl_ec_key_export(int argc, VALUE *argv, VALUE self)
{
OSSL_3_const EC_KEY *ec;
const EC_KEY *ec;

GetEC(self, ec);
if (EC_KEY_get0_public_key(ec) == NULL)
Expand Down Expand Up @@ -492,7 +492,7 @@ ossl_ec_key_export(int argc, VALUE *argv, VALUE self)
static VALUE
ossl_ec_key_to_der(VALUE self)
{
OSSL_3_const EC_KEY *ec;
const EC_KEY *ec;

GetEC(self, ec);
if (EC_KEY_get0_public_key(ec) == NULL)
Expand Down Expand Up @@ -567,7 +567,7 @@ static VALUE ossl_ec_key_check_key(VALUE self)

EVP_PKEY_CTX_free(pctx);
#else
OSSL_3_const EC_KEY *ec;
const EC_KEY *ec;

GetEC(self, ec);
if (EC_KEY_check_key(ec) != 1)
Expand Down
12 changes: 6 additions & 6 deletions ext/openssl/ossl_pkey_rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
} while (0)

static inline int
RSA_HAS_PRIVATE(OSSL_3_const RSA *rsa)
RSA_HAS_PRIVATE(const RSA *rsa)
{
const BIGNUM *e, *d;

Expand All @@ -35,7 +35,7 @@ RSA_HAS_PRIVATE(OSSL_3_const RSA *rsa)
}

static inline int
RSA_PRIVATE(VALUE obj, OSSL_3_const RSA *rsa)
RSA_PRIVATE(VALUE obj, const RSA *rsa)
{
return RSA_HAS_PRIVATE(rsa) || OSSL_PKEY_IS_PRIVATE(obj);
}
Expand Down Expand Up @@ -148,7 +148,7 @@ static VALUE
ossl_rsa_initialize_copy(VALUE self, VALUE other)
{
EVP_PKEY *pkey;
OSSL_3_const RSA *rsa;
const RSA *rsa;
RSA *rsa_new;

TypedData_Get_Struct(self, EVP_PKEY, &ossl_evp_pkey_type, pkey);
Expand Down Expand Up @@ -183,7 +183,7 @@ ossl_rsa_initialize_copy(VALUE self, VALUE other)
static VALUE
ossl_rsa_is_public(VALUE self)
{
OSSL_3_const RSA *rsa;
const RSA *rsa;

GetRSA(self, rsa);
/*
Expand All @@ -202,7 +202,7 @@ ossl_rsa_is_public(VALUE self)
static VALUE
ossl_rsa_is_private(VALUE self)
{
OSSL_3_const RSA *rsa;
const RSA *rsa;

GetRSA(self, rsa);

Expand All @@ -212,7 +212,7 @@ ossl_rsa_is_private(VALUE self)
static int
can_export_rsaprivatekey(VALUE self)
{
OSSL_3_const RSA *rsa;
const RSA *rsa;
const BIGNUM *n, *e, *d, *p, *q, *dmp1, *dmq1, *iqmp;

GetRSA(self, rsa);
Expand Down
Loading