summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/openssl_missing.h4
-rw-r--r--ext/openssl/ossl_pkey.h2
-rw-r--r--ext/openssl/ossl_pkey_dh.c8
-rw-r--r--ext/openssl/ossl_pkey_dsa.c8
-rw-r--r--ext/openssl/ossl_pkey_rsa.c12
5 files changed, 17 insertions, 17 deletions
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index 6e9be395c1..769c7c2d24 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -179,7 +179,7 @@ void X509_REQ_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg, X509_REQ
static inline _type *EVP_PKEY_get0_##_type(EVP_PKEY *pkey) { \
return pkey->pkey._name; }
#define IMPL_KEY_ACCESSOR2(_type, _group, a1, a2, _fail_cond) \
-static inline void _type##_get0_##_group(_type *obj, BIGNUM **a1, BIGNUM **a2) { \
+static inline void _type##_get0_##_group(_type *obj, const BIGNUM **a1, const BIGNUM **a2) { \
if (a1) *a1 = obj->a1; \
if (a2) *a2 = obj->a2; } \
static inline int _type##_set0_##_group(_type *obj, BIGNUM *a1, BIGNUM *a2) { \
@@ -188,7 +188,7 @@ static inline int _type##_set0_##_group(_type *obj, BIGNUM *a1, BIGNUM *a2) { \
BN_clear_free(obj->a2); obj->a2 = a2; \
return 1; }
#define IMPL_KEY_ACCESSOR3(_type, _group, a1, a2, a3, _fail_cond) \
-static inline void _type##_get0_##_group(_type *obj, BIGNUM **a1, BIGNUM **a2, BIGNUM **a3) { \
+static inline void _type##_get0_##_group(_type *obj, const BIGNUM **a1, const BIGNUM **a2, const BIGNUM **a3) { \
if (a1) *a1 = obj->a1; \
if (a2) *a2 = obj->a2; \
if (a3) *a3 = obj->a3; } \
diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h
index 6f9555e563..1f68352cdc 100644
--- a/ext/openssl/ossl_pkey.h
+++ b/ext/openssl/ossl_pkey.h
@@ -103,7 +103,7 @@ void Init_ossl_ec(void);
static VALUE ossl_##_keytype##_get_##_name(VALUE self) \
{ \
_type *obj; \
- BIGNUM *bn; \
+ const BIGNUM *bn; \
\
Get##_type(self, obj); \
_get; \
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c
index 74402fb95e..654d47973f 100644
--- a/ext/openssl/ossl_pkey_dh.c
+++ b/ext/openssl/ossl_pkey_dh.c
@@ -249,7 +249,7 @@ static VALUE
ossl_dh_is_public(VALUE self)
{
DH *dh;
- BIGNUM *bn;
+ const BIGNUM *bn;
GetDH(self, dh);
DH_get0_key(dh, &bn, NULL);
@@ -268,7 +268,7 @@ static VALUE
ossl_dh_is_private(VALUE self)
{
DH *dh;
- BIGNUM *bn;
+ const BIGNUM *bn;
GetDH(self, dh);
DH_get0_key(dh, NULL, &bn);
@@ -352,7 +352,7 @@ ossl_dh_get_params(VALUE self)
{
DH *dh;
VALUE hash;
- BIGNUM *p, *q, *g, *pub_key, *priv_key;
+ const BIGNUM *p, *q, *g, *pub_key, *priv_key;
GetDH(self, dh);
DH_get0_pqg(dh, &p, &q, &g);
@@ -498,7 +498,7 @@ static VALUE
ossl_dh_compute_key(VALUE self, VALUE pub)
{
DH *dh;
- BIGNUM *pub_key, *dh_p;
+ const BIGNUM *pub_key, *dh_p;
VALUE str;
int len;
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index 2824679053..333beae844 100644
--- a/ext/openssl/ossl_pkey_dsa.c
+++ b/ext/openssl/ossl_pkey_dsa.c
@@ -26,7 +26,7 @@
static inline int
DSA_HAS_PRIVATE(DSA *dsa)
{
- BIGNUM *bn;
+ const BIGNUM *bn;
DSA_get0_key(dsa, NULL, &bn);
return !!bn;
}
@@ -280,7 +280,7 @@ static VALUE
ossl_dsa_is_public(VALUE self)
{
DSA *dsa;
- BIGNUM *bn;
+ const BIGNUM *bn;
GetDSA(self, dsa);
DSA_get0_key(dsa, &bn, NULL);
@@ -402,7 +402,7 @@ ossl_dsa_get_params(VALUE self)
{
DSA *dsa;
VALUE hash;
- BIGNUM *p, *q, *g, *pub_key, *priv_key;
+ const BIGNUM *p, *q, *g, *pub_key, *priv_key;
GetDSA(self, dsa);
DSA_get0_pqg(dsa, &p, &q, &g);
@@ -509,7 +509,7 @@ static VALUE
ossl_dsa_sign(VALUE self, VALUE data)
{
DSA *dsa;
- BIGNUM *dsa_q;
+ const BIGNUM *dsa_q;
unsigned int buf_len;
VALUE str;
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 1ee45d0f17..60fa146b16 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -26,7 +26,7 @@
static inline int
RSA_HAS_PRIVATE(RSA *rsa)
{
- BIGNUM *p, *q;
+ const BIGNUM *p, *q;
RSA_get0_factors(rsa, &p, &q);
return p && q; /* d? why? */
@@ -398,7 +398,7 @@ static VALUE
ossl_rsa_public_encrypt(int argc, VALUE *argv, VALUE self)
{
RSA *rsa;
- BIGNUM *rsa_n;
+ const BIGNUM *rsa_n;
int buf_len, pad;
VALUE str, buffer, padding;
@@ -430,7 +430,7 @@ static VALUE
ossl_rsa_public_decrypt(int argc, VALUE *argv, VALUE self)
{
RSA *rsa;
- BIGNUM *rsa_n;
+ const BIGNUM *rsa_n;
int buf_len, pad;
VALUE str, buffer, padding;
@@ -462,7 +462,7 @@ static VALUE
ossl_rsa_private_encrypt(int argc, VALUE *argv, VALUE self)
{
RSA *rsa;
- BIGNUM *rsa_n;
+ const BIGNUM *rsa_n;
int buf_len, pad;
VALUE str, buffer, padding;
@@ -496,7 +496,7 @@ static VALUE
ossl_rsa_private_decrypt(int argc, VALUE *argv, VALUE self)
{
RSA *rsa;
- BIGNUM *rsa_n;
+ const BIGNUM *rsa_n;
int buf_len, pad;
VALUE str, buffer, padding;
@@ -534,7 +534,7 @@ ossl_rsa_get_params(VALUE self)
{
RSA *rsa;
VALUE hash;
- BIGNUM *n, *e, *d, *p, *q, *dmp1, *dmq1, *iqmp;
+ const BIGNUM *n, *e, *d, *p, *q, *dmp1, *dmq1, *iqmp;
GetRSA(self, rsa);
RSA_get0_key(rsa, &n, &e, &d);