webauthn 1.4.0 → 1.5.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
- SHA256:
3
- metadata.gz: 14d13c4bce35ebbe6cde4332ab9f5af2b5e0a9592fdc1fcb6d902954764ff656
4
- data.tar.gz: 28f671cb2e1baeffa0f0662863867e6c12c05338fd5d4a780c2e8f6bc54344f1
2
+ SHA1:
3
+ metadata.gz: ff393d6958f8ac6c87687e9182713174b06c242e
4
+ data.tar.gz: 516c577085fd3cf07f2e52cb0f6055ba54dfcfa0
5
5
  SHA512:
6
- metadata.gz: c44f926b6046f13b9ff0b71646a8ce72ff87ac064b82cfc8e1a273889d1878567655455d874619361aa1c9906cdc06234e4e5502736c18148e3721e36c790fff
7
- data.tar.gz: ac6e06366d290ef51ad1257386d3a44a0b9eae9a3fd7e4071392c73a0a1cd39784da6bf942ac984fd84d0ef2100bff4cf0dbaf83df064cc6df5f2cdffa5ddc22
6
+ metadata.gz: 14ce284002cc748da915fa332e3fd99085c58a1a09b8b7d1f2a0866b9c224fe1975351b05e1221f1f4c40336f13141b1a03dfec8d374d53036c0d1c197e55032
7
+ data.tar.gz: aeb41c15771cdd16bd2654fd3ef1380b34c88e5f060c71eede3246cdc3576ae794f5b84860715e98ff528337dfbca0887a13134a3d8b4421ae11bb6107577970
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.4
2
+ TargetRubyVersion: 2.3
3
3
  DisabledByDefault: true
4
4
 
5
5
  Bundler:
data/.travis.yml CHANGED
@@ -3,10 +3,9 @@ language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
5
  - 2.6.0-preview2
6
- - 2.5.1
7
- - 2.4.4
8
- before_install: gem install bundler -v 1.16.2
9
-
6
+ - 2.5.3
7
+ - 2.4.5
8
+ - 2.3.8
10
9
  matrix:
11
10
  fast_finish: true
12
11
  allow_failures:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.5.0] - 2018-10-23
4
+
5
+ ### Added
6
+
7
+ - Works with ruby 2.3. Thank you @bdewater!
8
+
3
9
  ## [v1.4.0] - 2018-10-11
4
10
 
5
11
  ### Added
@@ -85,6 +91,7 @@ Note: Both additions should help making it compatible with Chrome for Android 70
85
91
  - `WebAuthn::AuthenticatorAttestationResponse.valid?` can be used to validate fido-u2f attestations returned by the browser
86
92
  - Works with ruby 2.5
87
93
 
94
+ [v1.5.0]: https://github.com/cedarcode/webauthn-ruby/compare/v1.4.0...v1.5.0/
88
95
  [v1.4.0]: https://github.com/cedarcode/webauthn-ruby/compare/v1.3.0...v1.4.0/
89
96
  [v1.3.0]: https://github.com/cedarcode/webauthn-ruby/compare/v1.2.0...v1.3.0/
90
97
  [v1.2.0]: https://github.com/cedarcode/webauthn-ruby/compare/v1.1.0...v1.2.0/
data/lib/webauthn.rb CHANGED
@@ -3,7 +3,6 @@
3
3
  require "cose/ecdsa"
4
4
  require "webauthn/authenticator_attestation_response"
5
5
  require "webauthn/authenticator_assertion_response"
6
- require "webauthn/utils"
7
6
  require "webauthn/version"
8
7
 
9
8
  require "base64"
@@ -58,7 +58,7 @@ module WebAuthn
58
58
  end
59
59
 
60
60
  def sign_count
61
- @sign_count ||= data_at(SIGN_COUNT_POSITION, SIGN_COUNT_LENGTH).unpack1('L>')
61
+ @sign_count ||= data_at(SIGN_COUNT_POSITION, SIGN_COUNT_LENGTH).unpack('L>')[0]
62
62
  end
63
63
 
64
64
  def attested_credential_data
@@ -67,7 +67,7 @@ module WebAuthn
67
67
  end
68
68
 
69
69
  def flags
70
- @flags ||= data_at(flags_position, FLAGS_LENGTH).unpack1("b*")
70
+ @flags ||= data_at(flags_position, FLAGS_LENGTH).unpack("b*")[0]
71
71
  end
72
72
 
73
73
  private
@@ -59,7 +59,7 @@ module WebAuthn
59
59
  end
60
60
 
61
61
  def id_length
62
- @id_length ||= data_at(id_length_position, ID_LENGTH_LENGTH).unpack1(UINT16_BIG_ENDIAN_FORMAT)
62
+ @id_length ||= data_at(id_length_position, ID_LENGTH_LENGTH).unpack(UINT16_BIG_ENDIAN_FORMAT)[0]
63
63
  end
64
64
 
65
65
  def id_length_position
@@ -28,7 +28,7 @@ module WebAuthn
28
28
  end
29
29
 
30
30
  def valid_challenge?(original_challenge)
31
- WebAuthn::Utils.authenticator_decode(client_data.challenge) == original_challenge
31
+ Base64.urlsafe_decode64(client_data.challenge) == original_challenge
32
32
  end
33
33
 
34
34
  def valid_origin?(original_origin)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebAuthn
4
- VERSION = "1.4.0"
4
+ VERSION = "1.5.0"
5
5
  end
data/webauthn.gemspec CHANGED
@@ -27,11 +27,12 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.required_ruby_version = ">= 2.4"
30
+ spec.required_ruby_version = ">= 2.3"
31
31
 
32
32
  spec.add_dependency "cbor", "~> 0.5.9.2"
33
33
  spec.add_dependency "cose", "~> 0.1.0"
34
34
  spec.add_dependency "jwt", [">= 1.5", "< 3.0"]
35
+ spec.add_dependency "openssl", "~> 2.0"
35
36
 
36
37
  spec.add_development_dependency "bundler", "~> 1.16"
37
38
  spec.add_development_dependency "byebug", "~> 10.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webauthn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gonzalo Rodriguez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-10-11 00:00:00.000000000 Z
12
+ date: 2018-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cbor
@@ -59,6 +59,20 @@ dependencies:
59
59
  - - "<"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: openssl
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ type: :runtime
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.0'
62
76
  - !ruby/object:Gem::Dependency
63
77
  name: bundler
64
78
  requirement: !ruby/object:Gem::Requirement
@@ -163,7 +177,6 @@ files:
163
177
  - lib/webauthn/authenticator_data/attested_credential_data/public_key_u2f.rb
164
178
  - lib/webauthn/authenticator_response.rb
165
179
  - lib/webauthn/client_data.rb
166
- - lib/webauthn/utils.rb
167
180
  - lib/webauthn/version.rb
168
181
  - webauthn.gemspec
169
182
  homepage: https://github.com/cedarcode/webauthn-ruby
@@ -181,7 +194,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
194
  requirements:
182
195
  - - ">="
183
196
  - !ruby/object:Gem::Version
184
- version: '2.4'
197
+ version: '2.3'
185
198
  required_rubygems_version: !ruby/object:Gem::Requirement
186
199
  requirements:
187
200
  - - ">="
@@ -189,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
202
  version: '0'
190
203
  requirements: []
191
204
  rubyforge_project:
192
- rubygems_version: 2.7.6
205
+ rubygems_version: 2.5.2.3
193
206
  signing_key:
194
207
  specification_version: 4
195
208
  summary: WebAuthn in ruby ― Ruby implementation of a WebAuthn Relying Party
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module WebAuthn
4
- module Utils
5
- def self.authenticator_decode(str)
6
- Base64.urlsafe_decode64(str)
7
- end
8
- end
9
- end