openssl-signature_algorithm 1.1.1 → 1.3.0

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: c5b527f33fd6b399b9b6c6baaebc173be1a848e3de4249dfc12c2640fbecf964
4
- data.tar.gz: ad5361e7381c7aa34f66dbe94e32c7a5e54fcedd9a536897588728fd7f8e2771
3
+ metadata.gz: 05b32cb5c229b287708d0931b8ac52b8c90c98f53d31e146df38406870300e95
4
+ data.tar.gz: 0b35e770ff3342d8d7d7008f8a76a4cb40e63dfe756676276e84e72da0af6677
5
5
  SHA512:
6
- metadata.gz: 1e532e2f5ae196cc3136f7eefaee626bfb80454cd581c80f067e6c237769a262d0188c9c82a32a40193b7218238c979231861e64445074264eebf5d03dc16f5f
7
- data.tar.gz: 2dcfffdf4680abeb725c4f15a36ac8fa80e49061d3408fba763270701ccc70c7982c6630ac26c8dcb56cd77f0b303e0431c1f923202d8eaccb0c01ede519d14d
6
+ metadata.gz: f5bfe46225bf0fa061ef6046d94e7297bfd124be0b95cd4fc3cc125f8fcd58a288a8945a64f9af8f50ff3fdd22c148e3495bd643c9de5b535ca8ecb14c266649
7
+ data.tar.gz: 34a46fea3bde198cdbbc3b9e024dec9d635aa8c15484a819d8350bdd3b3a996dff75b6f64b6f9971f890c2796873594c555e0970f83a0e72adce9b22bf54c992
@@ -16,22 +16,39 @@ jobs:
16
16
  fail-fast: false
17
17
  matrix:
18
18
  ruby-version:
19
- - 3.0.0
20
- - 2.7.2
19
+ - 3.2.0
20
+ - 3.1.3
21
+ - 3.0.5
22
+ - 2.7.7
21
23
  - 2.6.6
22
24
  - 2.5.8
23
25
  - 2.4.10
24
26
  gemfile:
27
+ - openssl_3_1
28
+ - openssl_3_0
25
29
  - openssl_2_2
26
30
  - openssl_2_1
27
- - openssl_2_0
31
+ exclude:
32
+ - ruby-version: '2.4.10'
33
+ gemfile: openssl_3_0
34
+ - ruby-version: '2.5.8'
35
+ gemfile: openssl_3_0
36
+ - ruby-version: '2.4.10'
37
+ gemfile: openssl_3_1
38
+ - ruby-version: '2.5.8'
39
+ gemfile: openssl_3_1
28
40
  env:
29
41
  BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
30
42
  steps:
31
43
  - uses: actions/checkout@v2
32
44
  - run: rm Gemfile.lock
33
- - uses: ruby/setup-ruby@v1
45
+ - name: Set up Ruby ${{ matrix.ruby }}
46
+ uses: ruby/setup-ruby@v1
34
47
  with:
35
48
  ruby-version: ${{ matrix.ruby-version }}
36
49
  bundler-cache: true
37
- - run: bundle exec rake
50
+ - name: Run rubocop
51
+ run: bundle exec rubocop
52
+ if: ${{ matrix.ruby == '3.2.0' }}
53
+ - name: Run tests
54
+ run: bundle exec rspec
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.4
3
3
  DisabledByDefault: true
4
+ NewCops: disable
4
5
  Exclude:
5
6
  - "gemfiles/**/*"
6
7
  - "vendor/bundle/**/*"
@@ -20,6 +21,9 @@ Layout/LineLength:
20
21
  Lint:
21
22
  Enabled: true
22
23
 
24
+ Lint/MissingSuper:
25
+ Enabled: false
26
+
23
27
  Naming:
24
28
  Enabled: true
25
29
 
data/Appraisals CHANGED
@@ -1,5 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ appraise "openssl_3_1" do
4
+ gem "openssl", "~> 3.1.0"
5
+ end
6
+
7
+ appraise "openssl_3_0" do
8
+ gem "openssl", "~> 3.0.0"
9
+ end
10
+
3
11
  appraise "openssl_2_2" do
4
12
  gem "openssl", "~> 2.2.0"
5
13
  end
@@ -7,7 +15,3 @@ end
7
15
  appraise "openssl_2_1" do
8
16
  gem "openssl", "~> 2.1.0"
9
17
  end
10
-
11
- appraise "openssl_2_0" do
12
- gem "openssl", "~> 2.0.0"
13
- end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.3.0] - 2023-02-15
4
+
5
+ - Loose OpenSSL dependency to support 3.1 users. Thanks @bdewater <3
6
+
7
+ ## [v1.2.1] - 2022-06-05
8
+
9
+ - Support OpenSSL ~>3.0.0. Credits to @ClearlyClaire <3
10
+
3
11
  ## [v1.1.1] - 2021-02-11
4
12
 
5
13
  ### Fixed
@@ -84,6 +92,8 @@
84
92
  - `OpenSSL::SignatureAlgorithm::RSAPSS`
85
93
  - `OpenSSL::SignatureAlgorithm::RSAPKCS1`
86
94
 
95
+ [v1.3.0]: https://github.com/cedarcode/openssl-signature_algorithm/compare/v1.2.1...v1.3.0/
96
+ [v1.2.1]: https://github.com/cedarcode/openssl-signature_algorithm/compare/v1.1.1...v1.2.1/
87
97
  [v1.1.1]: https://github.com/cedarcode/openssl-signature_algorithm/compare/v1.1.0...v1.1.1/
88
98
  [v1.1.0]: https://github.com/cedarcode/openssl-signature_algorithm/compare/v1.0.0...v1.1.0/
89
99
  [v1.0.0]: https://github.com/cedarcode/openssl-signature_algorithm/compare/v0.4.0...v1.0.0/
@@ -94,3 +104,5 @@
94
104
  [v0.1.0]: https://github.com/cedarcode/openssl-signature_algorithm/compare/41887c277dc7fa0c884ccf8924cf990ff76784d9...v0.1.0/
95
105
 
96
106
  [@santiagorodriguez96]: https://github.com/santiagorodriguez96
107
+ [@ClearlyClaire]: https://github.com/clearlyclaire
108
+ [@bdewater]: https://github.com/bdewater
data/Gemfile CHANGED
@@ -10,4 +10,4 @@ gem "byebug", "~> 11.0"
10
10
  gem "ed25519", "~> 1.2"
11
11
  gem "rake", "~> 13.0"
12
12
  gem "rspec", "~> 3.0"
13
- gem "rubocop", "~> 0.80.1"
13
+ gem "rubocop", "~> 1.0"
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openssl-signature_algorithm (1.1.1)
5
- openssl (~> 2.0)
4
+ openssl-signature_algorithm (1.2.1)
5
+ openssl (> 2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -11,18 +11,19 @@ GEM
11
11
  bundler
12
12
  rake
13
13
  thor (>= 0.14.0)
14
- ast (2.4.0)
14
+ ast (2.4.2)
15
15
  byebug (11.1.1)
16
16
  diff-lcs (1.3)
17
17
  ed25519 (1.2.4)
18
- jaro_winkler (1.5.4)
19
- openssl (2.2.0)
20
- parallel (1.19.1)
21
- parser (2.7.0.5)
22
- ast (~> 2.4.0)
23
- rainbow (3.0.0)
18
+ json (2.6.3)
19
+ openssl (3.0.0)
20
+ parallel (1.22.1)
21
+ parser (3.2.1.0)
22
+ ast (~> 2.4.1)
23
+ rainbow (3.1.1)
24
24
  rake (13.0.1)
25
- rexml (3.2.4)
25
+ regexp_parser (2.7.0)
26
+ rexml (3.2.5)
26
27
  rspec (3.9.0)
27
28
  rspec-core (~> 3.9.0)
28
29
  rspec-expectations (~> 3.9.0)
@@ -36,17 +37,21 @@ GEM
36
37
  diff-lcs (>= 1.2.0, < 2.0)
37
38
  rspec-support (~> 3.9.0)
38
39
  rspec-support (3.9.2)
39
- rubocop (0.80.1)
40
- jaro_winkler (~> 1.5.1)
40
+ rubocop (1.45.1)
41
+ json (~> 2.3)
41
42
  parallel (~> 1.10)
42
- parser (>= 2.7.0.1)
43
+ parser (>= 3.2.0.0)
43
44
  rainbow (>= 2.2.2, < 4.0)
44
- rexml
45
+ regexp_parser (>= 1.8, < 3.0)
46
+ rexml (>= 3.2.5, < 4.0)
47
+ rubocop-ast (>= 1.24.1, < 2.0)
45
48
  ruby-progressbar (~> 1.7)
46
- unicode-display_width (>= 1.4.0, < 1.7)
47
- ruby-progressbar (1.10.1)
49
+ unicode-display_width (>= 2.4.0, < 3.0)
50
+ rubocop-ast (1.24.1)
51
+ parser (>= 3.1.1.0)
52
+ ruby-progressbar (1.11.0)
48
53
  thor (1.0.1)
49
- unicode-display_width (1.6.1)
54
+ unicode-display_width (2.4.2)
50
55
 
51
56
  PLATFORMS
52
57
  ruby
@@ -58,7 +63,7 @@ DEPENDENCIES
58
63
  openssl-signature_algorithm!
59
64
  rake (~> 13.0)
60
65
  rspec (~> 3.0)
61
- rubocop (~> 0.80.1)
66
+ rubocop (~> 1.0)
62
67
 
63
68
  BUNDLED WITH
64
- 2.2.8
69
+ 2.3.26
@@ -4,10 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.2"
6
6
  gem "byebug", "~> 11.0"
7
+ gem "ed25519", "~> 1.2"
7
8
  gem "rake", "~> 13.0"
8
9
  gem "rspec", "~> 3.0"
9
- gem "rubocop", "~> 0.80.1"
10
- gem "ed25519", "~> 1.2"
10
+ gem "rubocop", "~> 1.0"
11
11
  gem "openssl", "~> 2.1.0"
12
12
 
13
13
  gemspec path: "../"
@@ -4,10 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.2"
6
6
  gem "byebug", "~> 11.0"
7
+ gem "ed25519", "~> 1.2"
7
8
  gem "rake", "~> 13.0"
8
9
  gem "rspec", "~> 3.0"
9
- gem "rubocop", "~> 0.80.1"
10
- gem "ed25519", "~> 1.2"
10
+ gem "rubocop", "~> 1.0"
11
11
  gem "openssl", "~> 2.2.0"
12
12
 
13
13
  gemspec path: "../"
@@ -4,10 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.2"
6
6
  gem "byebug", "~> 11.0"
7
+ gem "ed25519", "~> 1.2"
7
8
  gem "rake", "~> 13.0"
8
9
  gem "rspec", "~> 3.0"
9
- gem "rubocop", "~> 0.80.1"
10
- gem "ed25519", "~> 1.2"
11
- gem "openssl", "~> 2.0.0"
10
+ gem "rubocop", "~> 1.0"
11
+ gem "openssl", "~> 3.0.0"
12
12
 
13
13
  gemspec path: "../"
@@ -0,0 +1,13 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 2.2"
6
+ gem "byebug", "~> 11.0"
7
+ gem "ed25519", "~> 1.2"
8
+ gem "rake", "~> 13.0"
9
+ gem "rspec", "~> 3.0"
10
+ gem "rubocop", "~> 1.0"
11
+ gem "openssl", "~> 3.1.0"
12
+
13
+ gemspec path: "../"
@@ -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,20 @@ 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
+ [
41
+ OpenSSL::ASN1::Sequence(
42
+ [
43
+ OpenSSL::ASN1::ObjectId("id-ecPublicKey"),
44
+ OpenSSL::ASN1::ObjectId(group.curve_name),
45
+ ]
46
+ ),
47
+ OpenSSL::ASN1::BitString(to_octet_string(:uncompressed))
48
+ ]
49
+ )
50
+
51
+ OpenSSL::PKey::EC.new(asn1.to_der)
37
52
  end
38
53
  end
39
54
 
@@ -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.3.0"
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"
32
32
  end
metadata CHANGED
@@ -1,27 +1,27 @@
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.3.0
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: 2023-02-15 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
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
27
  description: ECDSA, EdDSA, RSA-PSS and RSA-PKCS#1 algorithms for ruby
@@ -45,9 +45,10 @@ files:
45
45
  - bin/console
46
46
  - bin/setup
47
47
  - gemfiles/.bundle/config
48
- - gemfiles/openssl_2_0.gemfile
49
48
  - gemfiles/openssl_2_1.gemfile
50
49
  - gemfiles/openssl_2_2.gemfile
50
+ - gemfiles/openssl_3_0.gemfile
51
+ - gemfiles/openssl_3_1.gemfile
51
52
  - lib/openssl/signature_algorithm.rb
52
53
  - lib/openssl/signature_algorithm/base.rb
53
54
  - lib/openssl/signature_algorithm/ecdsa.rb
@@ -65,7 +66,7 @@ metadata:
65
66
  homepage_uri: https://github.com/cedarcode/openssl-signature_algorithm
66
67
  source_code_uri: https://github.com/cedarcode/openssl-signature_algorithm
67
68
  changelog_uri: https://github.com/cedarcode/openssl-signature_algorithm/blob/master/CHANGELOG.md
68
- post_install_message:
69
+ post_install_message:
69
70
  rdoc_options: []
70
71
  require_paths:
71
72
  - lib
@@ -80,8 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  - !ruby/object:Gem::Version
81
82
  version: '0'
82
83
  requirements: []
83
- rubygems_version: 3.2.8
84
- signing_key:
84
+ rubygems_version: 3.2.32
85
+ signing_key:
85
86
  specification_version: 4
86
87
  summary: ECDSA, EdDSA, RSA-PSS and RSA-PKCS#1 algorithms for ruby
87
88
  test_files: []