[前][次][番号順一覧][スレッド一覧]

ruby-changes:43376

From: rhe <ko1@a...>
Date: Sun, 19 Jun 2016 14:31:34 +0900 (JST)
Subject: [ruby-changes:43376] rhe:r55450 (trunk): openssl: add 'const's required in OpenSSL master

rhe	2016-06-19 14:31:28 +0900 (Sun, 19 Jun 2016)

  New Revision: 55450

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55450

  Log:
    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]

  Modified files:
    trunk/ChangeLog
    trunk/ext/openssl/openssl_missing.h
    trunk/ext/openssl/ossl_pkey.h
    trunk/ext/openssl/ossl_pkey_dh.c
    trunk/ext/openssl/ossl_pkey_dsa.c
    trunk/ext/openssl/ossl_pkey_rsa.c
Index: ext/openssl/openssl_missing.h
===================================================================
--- ext/openssl/openssl_missing.h	(revision 55449)
+++ ext/openssl/openssl_missing.h	(revision 55450)
@@ -179,7 +179,7 @@ void X509_REQ_get0_signature(ASN1_BIT_ST https://github.com/ruby/ruby/blob/trunk/ext/openssl/openssl_missing.h#L179
 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( https://github.com/ruby/ruby/blob/trunk/ext/openssl/openssl_missing.h#L188
 	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; } \
Index: ext/openssl/ossl_pkey_dsa.c
===================================================================
--- ext/openssl/ossl_pkey_dsa.c	(revision 55449)
+++ ext/openssl/ossl_pkey_dsa.c	(revision 55450)
@@ -26,7 +26,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_dsa.c#L26
 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 https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_dsa.c#L280
 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) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_dsa.c#L402
 {
     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 https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_dsa.c#L509
 ossl_dsa_sign(VALUE self, VALUE data)
 {
     DSA *dsa;
-    BIGNUM *dsa_q;
+    const BIGNUM *dsa_q;
     unsigned int buf_len;
     VALUE str;
 
Index: ext/openssl/ossl_pkey_rsa.c
===================================================================
--- ext/openssl/ossl_pkey_rsa.c	(revision 55449)
+++ ext/openssl/ossl_pkey_rsa.c	(revision 55450)
@@ -26,7 +26,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_rsa.c#L26
 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 https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_rsa.c#L398
 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 https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_rsa.c#L430
 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 https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_rsa.c#L462
 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 https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_rsa.c#L496
 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) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_rsa.c#L534
 {
     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);
Index: ext/openssl/ossl_pkey_dh.c
===================================================================
--- ext/openssl/ossl_pkey_dh.c	(revision 55449)
+++ ext/openssl/ossl_pkey_dh.c	(revision 55450)
@@ -249,7 +249,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_dh.c#L249
 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 https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_dh.c#L268
 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) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_dh.c#L352
 {
     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 https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_dh.c#L498
 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;
 
Index: ext/openssl/ossl_pkey.h
===================================================================
--- ext/openssl/ossl_pkey.h	(revision 55449)
+++ ext/openssl/ossl_pkey.h	(revision 55450)
@@ -103,7 +103,7 @@ void Init_ossl_ec(void); https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey.h#L103
 static VALUE ossl_##_keytype##_get_##_name(VALUE self)			\
 {									\
 	_type *obj;							\
-	BIGNUM *bn;							\
+	const BIGNUM *bn;						\
 									\
 	Get##_type(self, obj);						\
 	_get;								\
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55449)
+++ ChangeLog	(revision 55450)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Jun 19 14:31:07 2016  Kazuki Yamaguchi  <k@r...>
+
+	* 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@r...>
 
 	* variable.c (rb_path_to_class): consider the string length

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]