openssl 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b75bcd65f8742364f4a513c5ec991648ef6c859b185f2ae87b3eeb1551ab743b
4
- data.tar.gz: 1e9674192c66fd95a3c201d9afd0d2d755da24ae2847e5abfd68734ba262c811
3
+ metadata.gz: b8568ca84395c137b32a22127dcaa2125265d1f5b61a62ba1d56e2373b7a96c4
4
+ data.tar.gz: 1cef2e5798b482c3096826306a3264b82626f6d6cb23f53d9a71025f5afa46b3
5
5
  SHA512:
6
- metadata.gz: c28bc1d26bb1ae082481d1615d381bd2026b094eae39ddaadbe2791a9bade505bdc0431f19539254f66520feca5b073b675d93c53117b5df880460e029f2641c
7
- data.tar.gz: b815b33563ece86bc99f7112db593765c8bc32c887511ef5caff77725d64fb3f78e470e1ae4fbec131d04eda464159852aac3373e485d36c47ef32b35f59d99c
6
+ metadata.gz: 1bb9f6a40f535f4331097321296028fc2bdc8e5f90e6366c8db5c8e6dca771b55932c01479f667bd0751940917c83a9c98ca9ea70d7c622688cbb24432afdb36
7
+ data.tar.gz: d9905167ac9e1ffc3201155d39d947e5b0e923797a09ba172a443d4a4040a5d8663edfdb30c935a6d2fa71438e8f8a0fec025c21b5af9290eb76b02a8c100326
data/History.md CHANGED
@@ -1,3 +1,17 @@
1
+ Version 3.0.2
2
+ =============
3
+
4
+ Merged changes in 2.2.3. Additionally, the following issues are fixed by this
5
+ release.
6
+
7
+ Bug fixes
8
+ ---------
9
+
10
+ * Fix OpenSSL::PKey::EC#check_key not working correctly on OpenSSL 3.0.
11
+ [[GitHub #563]](https://github.com/ruby/openssl/issues/563)
12
+ [[GitHub #580]](https://github.com/ruby/openssl/pull/580)
13
+
14
+
1
15
  Version 3.0.1
2
16
  =============
3
17
 
@@ -124,6 +138,21 @@ Notable changes
124
138
  [[GitHub #342]](https://github.com/ruby/openssl/issues/342)
125
139
 
126
140
 
141
+ Version 2.2.3
142
+ =============
143
+
144
+ Bug fixes
145
+ ---------
146
+
147
+ * Fix serveral methods in OpenSSL::PKey::EC::Point attempting to raise an error
148
+ with an incorrect class, which would end up with a TypeError.
149
+ [[GitHub #570]](https://github.com/ruby/openssl/pull/570)
150
+ * Fix OpenSSL::PKey::EC::Point#eql? and OpenSSL::PKey::EC::Group#eql?
151
+ incorrectly treated OpenSSL's internal errors as "not equal".
152
+ [[GitHub #564]](https://github.com/ruby/openssl/pull/564)
153
+ * Fix build with LibreSSL 3.5 or later.
154
+
155
+
127
156
  Version 2.2.2
128
157
  =============
129
158
 
data/ext/openssl/ossl.h CHANGED
@@ -43,13 +43,13 @@
43
43
  #ifndef LIBRESSL_VERSION_NUMBER
44
44
  # define OSSL_IS_LIBRESSL 0
45
45
  # define OSSL_OPENSSL_PREREQ(maj, min, pat) \
46
- (OPENSSL_VERSION_NUMBER >= (maj << 28) | (min << 20) | (pat << 12))
46
+ (OPENSSL_VERSION_NUMBER >= ((maj << 28) | (min << 20) | (pat << 12)))
47
47
  # define OSSL_LIBRESSL_PREREQ(maj, min, pat) 0
48
48
  #else
49
49
  # define OSSL_IS_LIBRESSL 1
50
50
  # define OSSL_OPENSSL_PREREQ(maj, min, pat) 0
51
51
  # define OSSL_LIBRESSL_PREREQ(maj, min, pat) \
52
- (LIBRESSL_VERSION_NUMBER >= (maj << 28) | (min << 20) | (pat << 12))
52
+ (LIBRESSL_VERSION_NUMBER >= ((maj << 28) | (min << 20) | (pat << 12)))
53
53
  #endif
54
54
 
55
55
  #if !defined(OPENSSL_NO_ENGINE) && !OSSL_OPENSSL_PREREQ(3, 0, 0)
@@ -710,7 +710,7 @@ ossl_pkey_export_traditional(int argc, VALUE *argv, VALUE self, int to_der)
710
710
  }
711
711
  }
712
712
  else {
713
- #if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
713
+ #if OSSL_OPENSSL_PREREQ(1, 1, 0) || OSSL_LIBRESSL_PREREQ(3, 5, 0)
714
714
  if (!PEM_write_bio_PrivateKey_traditional(bio, pkey, enc, NULL, 0,
715
715
  ossl_pem_passwd_cb,
716
716
  (void *)pass)) {
@@ -483,16 +483,28 @@ static VALUE ossl_ec_key_check_key(VALUE self)
483
483
  #ifdef HAVE_EVP_PKEY_CHECK
484
484
  EVP_PKEY *pkey;
485
485
  EVP_PKEY_CTX *pctx;
486
- int ret;
486
+ EC_KEY *ec;
487
487
 
488
488
  GetPKey(self, pkey);
489
+ GetEC(self, ec);
489
490
  pctx = EVP_PKEY_CTX_new(pkey, /* engine */NULL);
490
491
  if (!pctx)
491
- ossl_raise(eDHError, "EVP_PKEY_CTX_new");
492
- ret = EVP_PKEY_public_check(pctx);
492
+ ossl_raise(eECError, "EVP_PKEY_CTX_new");
493
+
494
+ if (EC_KEY_get0_private_key(ec) != NULL) {
495
+ if (EVP_PKEY_check(pctx) != 1) {
496
+ EVP_PKEY_CTX_free(pctx);
497
+ ossl_raise(eECError, "EVP_PKEY_check");
498
+ }
499
+ }
500
+ else {
501
+ if (EVP_PKEY_public_check(pctx) != 1) {
502
+ EVP_PKEY_CTX_free(pctx);
503
+ ossl_raise(eECError, "EVP_PKEY_public_check");
504
+ }
505
+ }
506
+
493
507
  EVP_PKEY_CTX_free(pctx);
494
- if (ret != 1)
495
- ossl_raise(eECError, "EVP_PKEY_public_check");
496
508
  #else
497
509
  EC_KEY *ec;
498
510
 
@@ -668,10 +680,11 @@ static VALUE ossl_ec_group_eql(VALUE a, VALUE b)
668
680
  GetECGroup(a, group1);
669
681
  GetECGroup(b, group2);
670
682
 
671
- if (EC_GROUP_cmp(group1, group2, ossl_bn_ctx) == 1)
672
- return Qfalse;
673
-
674
- return Qtrue;
683
+ switch (EC_GROUP_cmp(group1, group2, ossl_bn_ctx)) {
684
+ case 0: return Qtrue;
685
+ case 1: return Qfalse;
686
+ default: ossl_raise(eEC_GROUP, "EC_GROUP_cmp");
687
+ }
675
688
  }
676
689
 
677
690
  /*
@@ -1232,10 +1245,13 @@ static VALUE ossl_ec_point_eql(VALUE a, VALUE b)
1232
1245
  GetECPoint(b, point2);
1233
1246
  GetECGroup(group_v1, group);
1234
1247
 
1235
- if (EC_POINT_cmp(group, point1, point2, ossl_bn_ctx) == 1)
1236
- return Qfalse;
1248
+ switch (EC_POINT_cmp(group, point1, point2, ossl_bn_ctx)) {
1249
+ case 0: return Qtrue;
1250
+ case 1: return Qfalse;
1251
+ default: ossl_raise(eEC_POINT, "EC_POINT_cmp");
1252
+ }
1237
1253
 
1238
- return Qtrue;
1254
+ UNREACHABLE;
1239
1255
  }
1240
1256
 
1241
1257
  /*
@@ -1253,7 +1269,7 @@ static VALUE ossl_ec_point_is_at_infinity(VALUE self)
1253
1269
  switch (EC_POINT_is_at_infinity(group, point)) {
1254
1270
  case 1: return Qtrue;
1255
1271
  case 0: return Qfalse;
1256
- default: ossl_raise(cEC_POINT, "EC_POINT_is_at_infinity");
1272
+ default: ossl_raise(eEC_POINT, "EC_POINT_is_at_infinity");
1257
1273
  }
1258
1274
 
1259
1275
  UNREACHABLE;
@@ -1274,7 +1290,7 @@ static VALUE ossl_ec_point_is_on_curve(VALUE self)
1274
1290
  switch (EC_POINT_is_on_curve(group, point, ossl_bn_ctx)) {
1275
1291
  case 1: return Qtrue;
1276
1292
  case 0: return Qfalse;
1277
- default: ossl_raise(cEC_POINT, "EC_POINT_is_on_curve");
1293
+ default: ossl_raise(eEC_POINT, "EC_POINT_is_on_curve");
1278
1294
  }
1279
1295
 
1280
1296
  UNREACHABLE;
@@ -1297,7 +1313,7 @@ static VALUE ossl_ec_point_make_affine(VALUE self)
1297
1313
  rb_warn("OpenSSL::PKey::EC::Point#make_affine! is deprecated");
1298
1314
  #if !OSSL_OPENSSL_PREREQ(3, 0, 0)
1299
1315
  if (EC_POINT_make_affine(group, point, ossl_bn_ctx) != 1)
1300
- ossl_raise(cEC_POINT, "EC_POINT_make_affine");
1316
+ ossl_raise(eEC_POINT, "EC_POINT_make_affine");
1301
1317
  #endif
1302
1318
 
1303
1319
  return self;
@@ -1316,7 +1332,7 @@ static VALUE ossl_ec_point_invert(VALUE self)
1316
1332
  GetECPointGroup(self, group);
1317
1333
 
1318
1334
  if (EC_POINT_invert(group, point, ossl_bn_ctx) != 1)
1319
- ossl_raise(cEC_POINT, "EC_POINT_invert");
1335
+ ossl_raise(eEC_POINT, "EC_POINT_invert");
1320
1336
 
1321
1337
  return self;
1322
1338
  }
@@ -1334,7 +1350,7 @@ static VALUE ossl_ec_point_set_to_infinity(VALUE self)
1334
1350
  GetECPointGroup(self, group);
1335
1351
 
1336
1352
  if (EC_POINT_set_to_infinity(group, point) != 1)
1337
- ossl_raise(cEC_POINT, "EC_POINT_set_to_infinity");
1353
+ ossl_raise(eEC_POINT, "EC_POINT_set_to_infinity");
1338
1354
 
1339
1355
  return self;
1340
1356
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenSSL
4
- VERSION = "3.0.1"
4
+ VERSION = "3.0.2"
5
5
  end
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: 3.0.1
4
+ version: 3.0.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: 2022-09-08 00:00:00.000000000 Z
14
+ date: 2022-12-23 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: It wraps the OpenSSL library.
17
17
  email:
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  requirements: []
120
- rubygems_version: 3.3.8
120
+ rubygems_version: 3.4.0.dev
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: OpenSSL provides SSL, TLS and general purpose cryptography.