json-jwt 1.8.0 → 1.8.1.pre
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.
Potentially problematic release.
This version of json-jwt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/json/jwk.rb +3 -3
- data/lib/json/jwk/jwkizable.rb +6 -6
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 102dbba889fe34efc39f6b4b90083a3a905cfac3
|
4
|
+
data.tar.gz: ef469a5b43fe571f1085c7c1c5839f9f7d6b2ce5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ff44af89770c369d2fe15b545f355e30abbb79b0d93daf2b46dd4b7de479efd1e90527f73e94df349341b71f7df4810f0a2e66e0da2e90974e0c50034cd635e
|
7
|
+
data.tar.gz: e87f88f116806fe1bbcbb5840ded8e78c4a1f2de540217dee97b9fb2975ce116ac12bc99df28ba65e673f14365eec920d9950349854dfcbc455c0c0ae3bcc947
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.8.
|
1
|
+
1.8.1.pre
|
data/lib/json/jwk.rb
CHANGED
@@ -132,14 +132,14 @@ module JSON
|
|
132
132
|
end
|
133
133
|
x, y, d = [:x, :y, :d].collect do |key|
|
134
134
|
if self[key]
|
135
|
-
|
135
|
+
UrlSafeBase64.decode64(self[key])
|
136
136
|
end
|
137
137
|
end
|
138
138
|
key = OpenSSL::PKey::EC.new curve_name
|
139
|
-
key.private_key = d if d
|
139
|
+
key.private_key = OpenSSL::BN.new(d, 2) if d
|
140
140
|
key.public_key = OpenSSL::PKey::EC::Point.new(
|
141
141
|
OpenSSL::PKey::EC::Group.new(curve_name),
|
142
|
-
OpenSSL::BN.new(['04' + x.
|
142
|
+
OpenSSL::BN.new(['04' + x.unpack('H*').first + y.unpack('H*').first].pack('H*'), 2)
|
143
143
|
)
|
144
144
|
key
|
145
145
|
end
|
data/lib/json/jwk/jwkizable.rb
CHANGED
@@ -27,10 +27,10 @@ module JSON
|
|
27
27
|
params = {
|
28
28
|
kty: :EC,
|
29
29
|
crv: curve_name,
|
30
|
-
x: UrlSafeBase64.encode64(coordinates[:x].
|
31
|
-
y: UrlSafeBase64.encode64(coordinates[:y].
|
30
|
+
x: UrlSafeBase64.encode64([coordinates[:x]].pack('H*')),
|
31
|
+
y: UrlSafeBase64.encode64([coordinates[:y]].pack('H*'))
|
32
32
|
}.merge ex_params
|
33
|
-
params[:d] = UrlSafeBase64.encode64(coordinates[:d].
|
33
|
+
params[:d] = UrlSafeBase64.encode64([coordinates[:d]].pack('H*')) if private_key?
|
34
34
|
JWK.new params
|
35
35
|
end
|
36
36
|
|
@@ -56,10 +56,10 @@ module JSON
|
|
56
56
|
hex_x = hex[2, data_len / 2]
|
57
57
|
hex_y = hex[2 + data_len / 2, data_len / 2]
|
58
58
|
@coordinates = {
|
59
|
-
x:
|
60
|
-
y:
|
59
|
+
x: hex_x,
|
60
|
+
y: hex_y
|
61
61
|
}
|
62
|
-
@coordinates[:d] = private_key if private_key?
|
62
|
+
@coordinates[:d] = private_key.to_s(16) if private_key?
|
63
63
|
end
|
64
64
|
@coordinates
|
65
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-jwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov matake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: url_safe_base64
|
@@ -183,12 +183,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
183
183
|
version: '0'
|
184
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
|
-
- - "
|
186
|
+
- - ">"
|
187
187
|
- !ruby/object:Gem::Version
|
188
|
-
version:
|
188
|
+
version: 1.3.1
|
189
189
|
requirements: []
|
190
190
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.6.
|
191
|
+
rubygems_version: 2.6.13
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: JSON Web Token and its family (JSON Web Signature, JSON Web Encryption and
|