openssl-signature_algorithm 1.1.1 → 1.2.1

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: c5b527f33fd6b399b9b6c6baaebc173be1a848e3de4249dfc12c2640fbecf964
4
- data.tar.gz: ad5361e7381c7aa34f66dbe94e32c7a5e54fcedd9a536897588728fd7f8e2771
3
+ metadata.gz: 829f2b6155e541e120828301a89ccf7dccdf850f6e0c011dd9f3a24d4c0481e3
4
+ data.tar.gz: eba31639c4813641c2eea718c96913534e4454388fdf6401eb3f4f189c2456bf
5
5
  SHA512:
6
- metadata.gz: 1e532e2f5ae196cc3136f7eefaee626bfb80454cd581c80f067e6c237769a262d0188c9c82a32a40193b7218238c979231861e64445074264eebf5d03dc16f5f
7
- data.tar.gz: 2dcfffdf4680abeb725c4f15a36ac8fa80e49061d3408fba763270701ccc70c7982c6630ac26c8dcb56cd77f0b303e0431c1f923202d8eaccb0c01ede519d14d
6
+ metadata.gz: 986c6f9e6593cb407f0023d80364257846281377d2b623066c006a13fb3c8543d72c0d4db6aaea11e626f16e0a7d4c9c7ff2e17f12d6f5409d84e8f40f328ebf
7
+ data.tar.gz: 36fba5619a93296702fa2656277926c5f8e26d08ba46938e7b73c39440542aaf4fa8d3f29da693880e954db7ae9b8733052d0a7e453cce6ca9c1cba7ed2c67aa
@@ -22,6 +22,7 @@ jobs:
22
22
  - 2.5.8
23
23
  - 2.4.10
24
24
  gemfile:
25
+ - openssl_3_0
25
26
  - openssl_2_2
26
27
  - openssl_2_1
27
28
  - openssl_2_0
data/Appraisals CHANGED
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ appraise "openssl_3_0" do
4
+ gem "openssl", "~> 3.0.0"
5
+ end
6
+
3
7
  appraise "openssl_2_2" do
4
8
  gem "openssl", "~> 2.2.0"
5
9
  end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.2.1] - 2022-06-05
4
+
5
+ - Support OpenSSL ~>3.0.0. Credits to @ClearlyClaire <3
6
+
3
7
  ## [v1.1.1] - 2021-02-11
4
8
 
5
9
  ### Fixed
@@ -84,6 +88,7 @@
84
88
  - `OpenSSL::SignatureAlgorithm::RSAPSS`
85
89
  - `OpenSSL::SignatureAlgorithm::RSAPKCS1`
86
90
 
91
+ [v1.2.1]: https://github.com/cedarcode/openssl-signature_algorithm/compare/v1.1.1...v1.2.1/
87
92
  [v1.1.1]: https://github.com/cedarcode/openssl-signature_algorithm/compare/v1.1.0...v1.1.1/
88
93
  [v1.1.0]: https://github.com/cedarcode/openssl-signature_algorithm/compare/v1.0.0...v1.1.0/
89
94
  [v1.0.0]: https://github.com/cedarcode/openssl-signature_algorithm/compare/v0.4.0...v1.0.0/
@@ -94,3 +99,4 @@
94
99
  [v0.1.0]: https://github.com/cedarcode/openssl-signature_algorithm/compare/41887c277dc7fa0c884ccf8924cf990ff76784d9...v0.1.0/
95
100
 
96
101
  [@santiagorodriguez96]: https://github.com/santiagorodriguez96
102
+ [@ClearlyClaire]: https://github.com/clearlyclaire
data/Gemfile.lock CHANGED
@@ -2,7 +2,7 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  openssl-signature_algorithm (1.1.1)
5
- openssl (~> 2.0)
5
+ openssl (> 2.0, < 3.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -16,7 +16,7 @@ GEM
16
16
  diff-lcs (1.3)
17
17
  ed25519 (1.2.4)
18
18
  jaro_winkler (1.5.4)
19
- openssl (2.2.0)
19
+ openssl (3.0.0)
20
20
  parallel (1.19.1)
21
21
  parser (2.7.0.5)
22
22
  ast (~> 2.4.0)
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "delegate"
3
4
  require "openssl"
4
5
  require "openssl/signature_algorithm/base"
5
6
 
@@ -8,9 +9,9 @@ module OpenSSL
8
9
  class ECDSA < Base
9
10
  BYTE_LENGTH = 8
10
11
 
11
- class SigningKey < OpenSSL::PKey::EC
12
+ class SigningKey < DelegateClass(OpenSSL::PKey::EC)
12
13
  def initialize(*args)
13
- super(*args).generate_key
14
+ super(OpenSSL::PKey::EC.generate(*args))
14
15
  end
15
16
 
16
17
  def verify_key
@@ -18,7 +19,11 @@ module OpenSSL
18
19
  end
19
20
  end
20
21
 
21
- class VerifyKey < OpenSSL::PKey::EC::Point
22
+ class VerifyKey < DelegateClass(OpenSSL::PKey::EC::Point)
23
+ def initialize(*args)
24
+ super(OpenSSL::PKey::EC::Point.new(*args))
25
+ end
26
+
22
27
  def self.deserialize(pem_string)
23
28
  new(OpenSSL::PKey::EC.new(pem_string).public_key)
24
29
  end
@@ -30,10 +35,16 @@ module OpenSSL
30
35
  def ec_key
31
36
  @ec_key ||=
32
37
  begin
33
- ec_key = OpenSSL::PKey::EC.new(group)
34
- ec_key.public_key = self
35
-
36
- ec_key
38
+ # RFC5480 SubjectPublicKeyInfo
39
+ asn1 = OpenSSL::ASN1::Sequence([
40
+ OpenSSL::ASN1::Sequence([
41
+ OpenSSL::ASN1::ObjectId("id-ecPublicKey"),
42
+ OpenSSL::ASN1::ObjectId(group.curve_name),
43
+ ]),
44
+ OpenSSL::ASN1::BitString(to_octet_string(:uncompressed))
45
+ ])
46
+
47
+ OpenSSL::PKey::EC.new(asn1.to_der)
37
48
  end
38
49
  end
39
50
 
@@ -1,22 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "delegate"
3
4
  require "openssl"
4
5
  require "openssl/signature_algorithm/base"
5
6
 
6
7
  module OpenSSL
7
8
  module SignatureAlgorithm
8
9
  class RSA < Base
9
- class SigningKey < OpenSSL::PKey::RSA
10
+ class SigningKey < DelegateClass(OpenSSL::PKey::RSA)
11
+ def initialize(*args)
12
+ super(OpenSSL::PKey::RSA.new(*args))
13
+ end
14
+
10
15
  def verify_key
11
16
  VerifyKey.new(public_key.to_pem)
12
17
  end
13
18
  end
14
19
 
15
- class VerifyKey < OpenSSL::PKey::RSA
20
+ class VerifyKey < DelegateClass(OpenSSL::PKey::RSA)
16
21
  class << self
17
22
  alias_method :deserialize, :new
18
23
  end
19
24
 
25
+ def initialize(*args)
26
+ super(OpenSSL::PKey::RSA.new(*args))
27
+ end
28
+
20
29
  def serialize
21
30
  to_pem
22
31
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OpenSSL
4
4
  module SignatureAlgorithm
5
- VERSION = "1.1.1"
5
+ VERSION = "1.2.1"
6
6
  end
7
7
  end
@@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_runtime_dependency "openssl", "~> 2.0"
31
+ spec.add_runtime_dependency "openssl", "> 2.0", "< 3.1"
32
32
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openssl-signature_algorithm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gonzalo Rodriguez
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-11 00:00:00.000000000 Z
11
+ date: 2022-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: openssl
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.1'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">"
25
28
  - !ruby/object:Gem::Version
26
29
  version: '2.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.1'
27
33
  description: ECDSA, EdDSA, RSA-PSS and RSA-PKCS#1 algorithms for ruby
28
34
  email:
29
35
  - gonzalo@cedarcode.com
@@ -65,7 +71,7 @@ metadata:
65
71
  homepage_uri: https://github.com/cedarcode/openssl-signature_algorithm
66
72
  source_code_uri: https://github.com/cedarcode/openssl-signature_algorithm
67
73
  changelog_uri: https://github.com/cedarcode/openssl-signature_algorithm/blob/master/CHANGELOG.md
68
- post_install_message:
74
+ post_install_message:
69
75
  rdoc_options: []
70
76
  require_paths:
71
77
  - lib
@@ -80,8 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
86
  - !ruby/object:Gem::Version
81
87
  version: '0'
82
88
  requirements: []
83
- rubygems_version: 3.2.8
84
- signing_key:
89
+ rubygems_version: 3.2.32
90
+ signing_key:
85
91
  specification_version: 4
86
92
  summary: ECDSA, EdDSA, RSA-PSS and RSA-PKCS#1 algorithms for ruby
87
93
  test_files: []