web_authn 0.0.3 → 0.0.4

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: ae734c58dcaf2aec7da75436de6611077577ddedf5b5321377892c1d5c50e928
4
- data.tar.gz: 2a4084397e852119fcc22f3d3c8491f2fa520d8ceed71de56bf7e07af162c77c
3
+ metadata.gz: f7e325092186081a22bf56445bed75ee6b1ee61915bad3867b4254851c1c4eba
4
+ data.tar.gz: '041690712347e54ffa6ee757b5199f1f8fa541bbc9b1f092354c11041ee70074'
5
5
  SHA512:
6
- metadata.gz: 15e45bc2f3da9bc91409cb9db0bb9151144f223ec1d880802588a0cf6a7cb882f4aae9830db6465882ebeb2469a7ef88fa2e532208448f629b2c47b32734ee81
7
- data.tar.gz: 05d6c10d89ba105db10dc83dec3b61465fd26d1328a01039c682bfd42c536d5206cb95b06afac40a4ddebb3e68c485dbebc29db2bce4369c8d924ec116437206
6
+ metadata.gz: 4e69686eee65065db0c0480c3438d787f0d520d414b938c32eb9fcedc70c195679073d152807347769584b3c87984ba30c819fcc992eec41da7b112bb6c38a18
7
+ data.tar.gz: ce5f15bfb0b5d4c5cb5b61386e7e40bb1cf9bb7df1b1a6658b00b1047f956682a8df3d28cfefb26fb35f5bf9c5f5bc2daeb4e929b543dc95d963e136c3475da5
data/.travis.yml CHANGED
@@ -3,5 +3,7 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.5.0
6
+ - 2.3.7
7
+ - 2.4.4
8
+ - 2.5.1
7
9
  before_install: gem install bundler -v 1.16.4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -22,26 +22,29 @@ module WebAuthn
22
22
  attested_credential_data.byteslice((18 + length)..-1),
23
23
  ]
24
24
  cose_key = COSE::Key::EC2.from_cbor(_encoded_cose_key_)
25
- crv = case cose_key.curve
25
+ curve_name = case cose_key.curve
26
26
  when 1
27
- :'P-256'
27
+ 'prime256v1'
28
28
  when 2
29
- :'P-384'
29
+ 'secp384r1'
30
30
  when 3
31
- :'P-521'
31
+ 'secp521r1'
32
32
  else
33
33
  raise NotImplementedError, 'Non-supported EC curve'
34
34
  end
35
- jwk = JSON::JWK.new(
36
- kty: :EC,
37
- crv: crv,
38
- x: Base64.urlsafe_encode64(cose_key.x_coordinate, padding: false),
39
- y: Base64.urlsafe_encode64(cose_key.y_coordinate, padding: false),
35
+ ec_key = OpenSSL::PKey::EC.new curve_name
36
+ ec_key.public_key = OpenSSL::PKey::EC::Point.new(
37
+ OpenSSL::PKey::EC::Group.new(curve_name),
38
+ OpenSSL::BN.new([
39
+ '04' +
40
+ cose_key.x_coordinate.unpack('H*').first +
41
+ cose_key.y_coordinate.unpack('H*').first
42
+ ].pack('H*'), 2)
40
43
  )
41
44
  new(
42
45
  aaguid: Base64.urlsafe_encode64(aaguid, padding: false),
43
46
  credential_id: Base64.urlsafe_encode64(credential_id, padding: false),
44
- public_key: jwk.to_key
47
+ public_key: ec_key
45
48
  )
46
49
  end
47
50
  end
data/lib/web_authn.rb CHANGED
@@ -1,9 +1,9 @@
1
+ require 'openssl'
1
2
  require 'active_support'
2
3
  require 'active_support/core_ext'
3
4
  require 'cbor'
4
5
  require 'cose'
5
6
  require 'cose/key/ec2'
6
- require 'json/jwt'
7
7
 
8
8
  module WebAuthn
9
9
  class Exception < StandardError; end
data/web_authn.gemspec CHANGED
@@ -15,7 +15,6 @@ Gem::Specification.new do |gem|
15
15
  gem.add_runtime_dependency 'activesupport'
16
16
  gem.add_runtime_dependency 'cbor'
17
17
  gem.add_runtime_dependency 'cose'
18
- gem.add_runtime_dependency 'json-jwt'
19
18
  gem.add_development_dependency 'rake', '~> 10.0'
20
19
  gem.add_development_dependency 'simplecov'
21
20
  gem.add_development_dependency 'rspec'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_authn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov matake
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: json-jwt
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rake
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -176,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
162
  version: '0'
177
163
  requirements: []
178
164
  rubyforge_project:
179
- rubygems_version: 2.7.3
165
+ rubygems_version: 2.7.6
180
166
  signing_key:
181
167
  specification_version: 4
182
168
  summary: W3C WebAuthn (a.k.a. FIDO2) RP library in Ruby