openssl 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e17353c3f443f1f4ba2afd65319630911e93cd4204b71e0a50a0640ab50ee714
4
- data.tar.gz: 8a7b4d82c64a0a80198624fa96af48c03163205ec84331e9618b26ff764f6c4c
3
+ metadata.gz: 9a5ba46835caa91a77f80010c07b52e8532221c8a1b4726159584eb92a6ce204
4
+ data.tar.gz: ca5ba9b87ceb945ac1f312e00ceadae32c868e2659e89677ed534a22ed145cf8
5
5
  SHA512:
6
- metadata.gz: e7d48ecc23c6dabc5eb29ee78b605096bfed6d62e83f66d2cbb67316afdb68dafe5c1b9c8c0ced0fba6478d671fda75969e35d50b22051458ca237b470973a9c
7
- data.tar.gz: c349830b16d8a87f1563b5f25f6451889e323c7a9b7666e9769f5c412c3f412728586adb4b4cb1365e34c54cb0d931467388c8f0b37f140dbc825459af20bb64
6
+ metadata.gz: 0eb54df27a2aa1455fb18b6e5e05c40598ba3f342ad933fd035342596b55a1e68c3b9607cede2b955961805150ca8eb7dcfa2a046600614da1d80dc9d17db17b
7
+ data.tar.gz: 31ac63101df5218fa003477b130b07a32826f685e465c71cf43fc9db28d3ecbb275e5dcc4b685860f418ea893378c133009af92ff1a2293b3d91606a8055b70b
data/History.md CHANGED
@@ -1,3 +1,15 @@
1
+ Version 2.1.2
2
+ =============
3
+
4
+ Merged changes in 2.0.9.
5
+
6
+
7
+ Version 2.1.1
8
+ =============
9
+
10
+ Merged changes in 2.0.8.
11
+
12
+
1
13
  Version 2.1.0
2
14
  =============
3
15
 
@@ -55,6 +67,29 @@ Notable changes
55
67
  [[GitHub #177]](https://github.com/ruby/openssl/pull/177)
56
68
 
57
69
 
70
+ Version 2.0.9
71
+ =============
72
+
73
+ Security fixes
74
+ --------------
75
+
76
+ * OpenSSL::X509::Name#<=> could incorrectly return 0 (= equal) for non-equal
77
+ objects. CVE-2018-16395 is assigned for this issue.
78
+ https://hackerone.com/reports/387250
79
+
80
+ Bug fixes
81
+ ---------
82
+
83
+ * Fixed OpenSSL::PKey::*.{new,generate} immediately aborting if the thread is
84
+ interrupted.
85
+ [[Bug #14882]](https://bugs.ruby-lang.org/issues/14882)
86
+ [[GitHub #205]](https://github.com/ruby/openssl/pull/205)
87
+ * Fixed OpenSSL::X509::Name#to_s failing with OpenSSL::X509::NameError if
88
+ called against an empty instance.
89
+ [[GitHub #200]](https://github.com/ruby/openssl/issues/200)
90
+ [[GitHub #211]](https://github.com/ruby/openssl/pull/211)
91
+
92
+
58
93
  Version 2.0.8
59
94
  =============
60
95
 
@@ -33,6 +33,9 @@ end
33
33
  Logging::message "=== Checking for system dependent stuff... ===\n"
34
34
  have_library("nsl", "t_open")
35
35
  have_library("socket", "socket")
36
+ if $mswin || $mingw
37
+ have_library("ws2_32")
38
+ end
36
39
 
37
40
  Logging::message "=== Checking for required stuff... ===\n"
38
41
  result = pkg_config("openssl") && have_header("openssl/ssl.h")
@@ -111,6 +114,10 @@ engines.each { |name|
111
114
  OpenSSL.check_func_or_macro("ENGINE_load_#{name}", "openssl/engine.h")
112
115
  }
113
116
 
117
+ if ($mswin || $mingw) && have_macro("LIBRESSL_VERSION_NUMBER", "openssl/opensslv.h")
118
+ $defs.push("-DNOCRYPT")
119
+ end
120
+
114
121
  # added in 1.0.2
115
122
  have_func("EC_curve_nist2nid")
116
123
  have_func("X509_REVOKED_dup")
@@ -149,7 +149,7 @@ void ossl_X509_REQ_get0_signature(const X509_REQ *, const ASN1_BIT_STRING **, co
149
149
  static inline _type *EVP_PKEY_get0_##_type(EVP_PKEY *pkey) { \
150
150
  return pkey->pkey._name; }
151
151
  #define IMPL_KEY_ACCESSOR2(_type, _group, a1, a2, _fail_cond) \
152
- static inline void _type##_get0_##_group(_type *obj, const BIGNUM **a1, const BIGNUM **a2) { \
152
+ static inline void _type##_get0_##_group(const _type *obj, const BIGNUM **a1, const BIGNUM **a2) { \
153
153
  if (a1) *a1 = obj->a1; \
154
154
  if (a2) *a2 = obj->a2; } \
155
155
  static inline int _type##_set0_##_group(_type *obj, BIGNUM *a1, BIGNUM *a2) { \
@@ -158,7 +158,7 @@ static inline int _type##_set0_##_group(_type *obj, BIGNUM *a1, BIGNUM *a2) { \
158
158
  BN_clear_free(obj->a2); obj->a2 = a2; \
159
159
  return 1; }
160
160
  #define IMPL_KEY_ACCESSOR3(_type, _group, a1, a2, a3, _fail_cond) \
161
- static inline void _type##_get0_##_group(_type *obj, const BIGNUM **a1, const BIGNUM **a2, const BIGNUM **a3) { \
161
+ static inline void _type##_get0_##_group(const _type *obj, const BIGNUM **a1, const BIGNUM **a2, const BIGNUM **a3) { \
162
162
  if (a1) *a1 = obj->a1; \
163
163
  if (a2) *a2 = obj->a2; \
164
164
  if (a3) *a3 = obj->a3; } \
@@ -1099,6 +1099,7 @@ static void Init_ossl_locks(void)
1099
1099
  void
1100
1100
  Init_openssl(void)
1101
1101
  {
1102
+ #undef rb_intern
1102
1103
  /*
1103
1104
  * Init timezone info
1104
1105
  */
@@ -1360,6 +1360,7 @@ OSSL_ASN1_IMPL_FACTORY_METHOD(EndOfContent)
1360
1360
  void
1361
1361
  Init_ossl_asn1(void)
1362
1362
  {
1363
+ #undef rb_intern
1363
1364
  VALUE ary;
1364
1365
  int i;
1365
1366
 
@@ -232,6 +232,7 @@ ossl_pkcs12_to_der(VALUE self)
232
232
  void
233
233
  Init_ossl_pkcs12(void)
234
234
  {
235
+ #undef rb_intern
235
236
  #if 0
236
237
  mOSSL = rb_define_module("OpenSSL");
237
238
  eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
@@ -1042,6 +1042,7 @@ ossl_pkcs7ri_get_enc_key(VALUE self)
1042
1042
  void
1043
1043
  Init_ossl_pkcs7(void)
1044
1044
  {
1045
+ #undef rb_intern
1045
1046
  #if 0
1046
1047
  mOSSL = rb_define_module("OpenSSL");
1047
1048
  eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
@@ -20,6 +20,21 @@ static ID id_private_q;
20
20
  /*
21
21
  * callback for generating keys
22
22
  */
23
+ static VALUE
24
+ call_check_ints0(VALUE arg)
25
+ {
26
+ rb_thread_check_ints();
27
+ return Qnil;
28
+ }
29
+
30
+ static void *
31
+ call_check_ints(void *arg)
32
+ {
33
+ int state;
34
+ rb_protect(call_check_ints0, Qnil, &state);
35
+ return (void *)(VALUE)state;
36
+ }
37
+
23
38
  int
24
39
  ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
25
40
  {
@@ -38,11 +53,18 @@ ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
38
53
  */
39
54
  rb_protect(rb_yield, ary, &state);
40
55
  if (state) {
41
- arg->stop = 1;
42
56
  arg->state = state;
57
+ return 0;
58
+ }
59
+ }
60
+ if (arg->interrupted) {
61
+ arg->interrupted = 0;
62
+ state = (int)(VALUE)rb_thread_call_with_gvl(call_check_ints, NULL);
63
+ if (state) {
64
+ arg->state = state;
65
+ return 0;
43
66
  }
44
67
  }
45
- if (arg->stop) return 0;
46
68
  return 1;
47
69
  }
48
70
 
@@ -50,7 +72,7 @@ void
50
72
  ossl_generate_cb_stop(void *ptr)
51
73
  {
52
74
  struct ossl_generate_cb_arg *arg = (struct ossl_generate_cb_arg *)ptr;
53
- arg->stop = 1;
75
+ arg->interrupted = 1;
54
76
  }
55
77
 
56
78
  static void
@@ -389,6 +411,7 @@ ossl_pkey_verify(VALUE self, VALUE digest, VALUE sig, VALUE data)
389
411
  void
390
412
  Init_ossl_pkey(void)
391
413
  {
414
+ #undef rb_intern
392
415
  #if 0
393
416
  mOSSL = rb_define_module("OpenSSL");
394
417
  eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
@@ -37,7 +37,7 @@ extern const rb_data_type_t ossl_evp_pkey_type;
37
37
 
38
38
  struct ossl_generate_cb_arg {
39
39
  int yield;
40
- int stop;
40
+ int interrupted;
41
41
  int state;
42
42
  };
43
43
  int ossl_generate_cb_2(int p, int n, BN_GENCB *cb);
@@ -1649,6 +1649,7 @@ static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self)
1649
1649
 
1650
1650
  void Init_ossl_ec(void)
1651
1651
  {
1652
+ #undef rb_intern
1652
1653
  #if 0
1653
1654
  mPKey = rb_define_module_under(mOSSL, "PKey");
1654
1655
  cPKey = rb_define_class_under(mPKey, "PKey", rb_cObject);
@@ -10,6 +10,6 @@
10
10
  #if !defined(_OSSL_VERSION_H_)
11
11
  #define _OSSL_VERSION_H_
12
12
 
13
- #define OSSL_VERSION "2.1.1"
13
+ #define OSSL_VERSION "2.1.2"
14
14
 
15
15
  #endif /* _OSSL_VERSION_H_ */
@@ -437,6 +437,7 @@ ossl_x509ext_to_der(VALUE obj)
437
437
  void
438
438
  Init_ossl_x509ext(void)
439
439
  {
440
+ #undef rb_intern
440
441
  #if 0
441
442
  mOSSL = rb_define_module("OpenSSL");
442
443
  eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
@@ -250,14 +250,12 @@ ossl_x509name_to_s_old(VALUE self)
250
250
  {
251
251
  X509_NAME *name;
252
252
  char *buf;
253
- VALUE str;
254
253
 
255
254
  GetX509Name(self, name);
256
255
  buf = X509_NAME_oneline(name, NULL, 0);
257
- str = rb_str_new2(buf);
258
- OPENSSL_free(buf);
259
-
260
- return str;
256
+ if (!buf)
257
+ ossl_raise(eX509NameError, "X509_NAME_oneline");
258
+ return ossl_buf2str(buf, rb_long2int(strlen(buf)));
261
259
  }
262
260
 
263
261
  static VALUE
@@ -265,12 +263,14 @@ x509name_print(VALUE self, unsigned long iflag)
265
263
  {
266
264
  X509_NAME *name;
267
265
  BIO *out;
266
+ int ret;
268
267
 
269
268
  GetX509Name(self, name);
270
269
  out = BIO_new(BIO_s_mem());
271
270
  if (!out)
272
271
  ossl_raise(eX509NameError, NULL);
273
- if (!X509_NAME_print_ex(out, name, 0, iflag)) {
272
+ ret = X509_NAME_print_ex(out, name, 0, iflag);
273
+ if (ret < 0 || iflag == XN_FLAG_COMPAT && ret == 0) {
274
274
  BIO_free(out);
275
275
  ossl_raise(eX509NameError, "X509_NAME_print_ex");
276
276
  }
@@ -400,7 +400,7 @@ ossl_x509name_cmp(VALUE self, VALUE other)
400
400
 
401
401
  result = ossl_x509name_cmp0(self, other);
402
402
  if (result < 0) return INT2FIX(-1);
403
- if (result > 1) return INT2FIX(1);
403
+ if (result > 0) return INT2FIX(1);
404
404
 
405
405
  return INT2FIX(0);
406
406
  }
@@ -502,6 +502,7 @@ ossl_x509name_to_der(VALUE self)
502
502
  void
503
503
  Init_ossl_x509name(void)
504
504
  {
505
+ #undef rb_intern
505
506
  VALUE utf8str, ptrstr, ia5str, hash;
506
507
 
507
508
  #if 0
@@ -771,6 +771,7 @@ ossl_x509stctx_set_time(VALUE self, VALUE time)
771
771
  void
772
772
  Init_ossl_x509store(void)
773
773
  {
774
+ #undef rb_intern
774
775
  #if 0
775
776
  mOSSL = rb_define_module("OpenSSL");
776
777
  eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openssl
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Bosslet
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-05-12 00:00:00.000000000 Z
14
+ date: 2018-10-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake