summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-19 05:31:28 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-19 05:31:28 +0000
commit31388c4a73fa4280b1e544648b35faf02ff4c2e2 (patch)
treed1dace073e93cb893796fb440a050fbf3e5de1ba
parent0ce3fab42233dad9a35573f1a702dabd1f1b6242 (diff)
openssl: add 'const's required in OpenSSL master
* ext/openssl/ossl_pkey.h, ext/openssl/ossl_pkey_dh.c, ext/openssl/ossl_pkey_dsa.c, ext/openssl/ossl_pkey_rsa.c: A few days ago, OpenSSL changed {DH,DSA,RSA}_get0_*() to take const BIGNUM **. https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=fd809cfdbd6e32b6b67b68c59f6d55fbed7a9327 [ruby-core:75225] [Feature #12324] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-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
6 files changed, 25 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 4e959a3..8d2875c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun Jun 19 14:31:07 2016 Kazuki Yamaguchi <k@rhe.jp>
+
+ * ext/openssl/ossl_pkey.h, ext/openssl/ossl_pkey_dh.c,
+ ext/openssl/ossl_pkey_dsa.c, ext/openssl/ossl_pkey_rsa.c: A few days
+ ago, OpenSSL changed {DH,DSA,RSA}_get0_*() to take const BIGNUM **.
+ https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=fd809cfdbd6e32b6b67b68c59f6d55fbed7a9327
+ [ruby-core:75225] [Feature #12324]
+
Sun Jun 19 11:19:43 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* variable.c (rb_path_to_class): consider the string length
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index 6e9be39..769c7c2 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 6f9555e..1f68352 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 74402fb..654d479 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 2824679..333beae 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 1ee45d0..60fa146 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);