cose 0.6.0 → 0.6.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: 32030549359b2c5afe6862546965c13f4071b55c9ace03a6385ce5c62c3af7bc
4
- data.tar.gz: 46e4769b04dadb56b998ae807a2cfe80e73c95c131c93b8b6424d5752f1aae0a
3
+ metadata.gz: 5417c864087ecc89f9f82bb341050b831b1854de193d0e9724e2a6105cf492ce
4
+ data.tar.gz: f74cfbcca9261e14fb1e170d981d18d0281bb817663a7df9484673b22d41da42
5
5
  SHA512:
6
- metadata.gz: 907c461c040d4e80b19403922557a7098e30cb348a829f9252ed74ab4c9f8d3ca62ba24f75ddc6e4df6c19de95f900be53483dbc4c97ded66927433513a38ce0
7
- data.tar.gz: 8142ebaaf7c32486f60f29243e689ae5bf96a4a39eed87838c55eeed8a13cc102e7dbd14d489749da9cff5ac149aa4a97c172f113e69f70e0658d285f3571063
6
+ metadata.gz: 6377547f6db9eb87814455f4d48a8f84d8fc5df26df0b7d1a0c72f423a0ccbdb1e0f6367fcecf4e34db6025a145479088d89e79abdda7519849d12e4e62b7b48
7
+ data.tar.gz: 5227f43154bb5225c2a7354dcd5d0d271df281335e2dcab600c86c5910d37618b6b69473c6d04ee9f9cee1b76b85f789b50852fb2a88a9ae7aa63ed5bd1bb633
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.6.1] - 2019-04-06
4
+
5
+ ### Fixed
6
+
7
+ - Fix COSE::Key::RSA#to_pkey for a public key
8
+
3
9
  ## [v0.6.0] - 2019-04-03
4
10
 
5
11
  ### Added
@@ -67,6 +73,7 @@
67
73
  - EC2 key object
68
74
  - Works with ruby 2.5
69
75
 
76
+ [v0.6.1]: https://github.com/cedarcode/cose-ruby/compare/v0.6.0...v0.6.1/
70
77
  [v0.6.0]: https://github.com/cedarcode/cose-ruby/compare/v0.5.0...v0.6.0/
71
78
  [v0.5.0]: https://github.com/cedarcode/cose-ruby/compare/v0.4.1...v0.5.0/
72
79
  [v0.4.1]: https://github.com/cedarcode/cose-ruby/compare/v0.4.0...v0.4.1/
@@ -31,12 +31,12 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.required_ruby_version = ">= 2.2"
33
33
 
34
- spec.add_dependency "cbor", "~> 0.5.9.2"
34
+ spec.add_dependency "cbor", "~> 0.5.9"
35
35
 
36
36
  spec.add_development_dependency "appraisal", "~> 2.2.0"
37
37
  spec.add_development_dependency "bundler", ">= 1.17", "< 3"
38
38
  spec.add_development_dependency "byebug", ">= 10.0"
39
39
  spec.add_development_dependency "rake", "~> 12.3"
40
40
  spec.add_development_dependency "rspec", "~> 3.8"
41
- spec.add_development_dependency "rubocop", "0.65.0"
41
+ spec.add_development_dependency "rubocop", "0.66.0"
42
42
  end
@@ -100,19 +100,21 @@ module COSE
100
100
  pkey.d = bn(d)
101
101
  end
102
102
 
103
- if pkey.respond_to?(:set_factors)
104
- pkey.set_factors(bn(p), bn(q))
105
- else
106
- pkey.p = bn(p)
107
- pkey.q = bn(q)
108
- end
103
+ if private?
104
+ if pkey.respond_to?(:set_factors)
105
+ pkey.set_factors(bn(p), bn(q))
106
+ else
107
+ pkey.p = bn(p)
108
+ pkey.q = bn(q)
109
+ end
109
110
 
110
- if pkey.respond_to?(:set_crt_params)
111
- pkey.set_crt_params(bn(dp), bn(dq), bn(qinv))
112
- else
113
- pkey.dmp1 = bn(dp)
114
- pkey.dmq1 = bn(dq)
115
- pkey.iqmp = bn(qinv)
111
+ if pkey.respond_to?(:set_crt_params)
112
+ pkey.set_crt_params(bn(dp), bn(dq), bn(qinv))
113
+ else
114
+ pkey.dmp1 = bn(dp)
115
+ pkey.dmq1 = bn(dq)
116
+ pkey.iqmp = bn(qinv)
117
+ end
116
118
  end
117
119
 
118
120
  pkey
@@ -133,8 +135,14 @@ module COSE
133
135
 
134
136
  private
135
137
 
138
+ def private?
139
+ [d, p, q, dp, dq, qinv].none?(&:nil?)
140
+ end
141
+
136
142
  def bn(data)
137
- OpenSSL::BN.new(data, 2)
143
+ if data
144
+ OpenSSL::BN.new(data, 2)
145
+ end
138
146
  end
139
147
  end
140
148
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module COSE
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cose
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
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: 2019-04-03 00:00:00.000000000 Z
12
+ date: 2019-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cbor
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 0.5.9.2
20
+ version: 0.5.9
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 0.5.9.2
27
+ version: 0.5.9
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: appraisal
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -107,14 +107,14 @@ dependencies:
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 0.65.0
110
+ version: 0.66.0
111
111
  type: :development
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 0.65.0
117
+ version: 0.66.0
118
118
  description:
119
119
  email:
120
120
  - gonzalo@cedarcode.com