cert-to-cwt 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cert-to-cwt.rb +16 -2
- data/cert-to-cwt.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb0d2612512bce82fd2fd95a7af7c9bbe517d980
|
4
|
+
data.tar.gz: 178dcde6fb0f0b18fdde5b7dd9c1c8acb94576e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 501472717dc2f0274d35050a9d8e60cf12e34f8a1b9cf1c44c91a63a9502ffd11c9f1c77cc9a9d8693b4c88048f7cd653afb5dc86c4cdab5a8844b1a604dbb92
|
7
|
+
data.tar.gz: 6d245d894362c6b926625c83680aeb5654e92adc43d1f44f0a9fa8a722bfc701511d0c629fd783a4778d7aef8e3633f56ff0ec63cacb3f3c2ad0b85dffbc22ab
|
data/bin/cert-to-cwt.rb
CHANGED
@@ -30,7 +30,7 @@ if ARGV[0] == "-b"
|
|
30
30
|
end
|
31
31
|
f = ARGF.read.b
|
32
32
|
|
33
|
-
def numbertobytes(n)
|
33
|
+
def numbertobytes(n)
|
34
34
|
if n == 0
|
35
35
|
"".b
|
36
36
|
else
|
@@ -130,6 +130,9 @@ y -3
|
|
130
130
|
pk -100001
|
131
131
|
).each_slice(2).map{ |x, y| SYMLOOKUP[x.intern] = y.to_i}
|
132
132
|
|
133
|
+
StopDS = Struct.new(:value)
|
134
|
+
Bits = Struct.new(:bits)
|
135
|
+
|
133
136
|
def desymbolicate(o)
|
134
137
|
case o
|
135
138
|
when Symbol
|
@@ -138,6 +141,8 @@ def desymbolicate(o)
|
|
138
141
|
Hash[o.map {|k, v| [desymbolicate(k), desymbolicate(v)]}]
|
139
142
|
when Array
|
140
143
|
o.map {|x| desymbolicate(x)}
|
144
|
+
when StopDS
|
145
|
+
o.value
|
141
146
|
else
|
142
147
|
o
|
143
148
|
end
|
@@ -217,7 +222,16 @@ exp3[0].fetch(:seq).each do |e3|
|
|
217
222
|
crit = false
|
218
223
|
end
|
219
224
|
val = val.fetch(:b)
|
220
|
-
|
225
|
+
val = ASN1.decode(val)
|
226
|
+
# warn "@@ #{val.inspect}"
|
227
|
+
if Hash === val && val.keys == [:bits]
|
228
|
+
s = val[:bits]
|
229
|
+
ignore_bits = s.getbyte(0)
|
230
|
+
bits = s[1..-1].bytes.map {|b| (b+0x100).to_s(2)[1..-1] }.join
|
231
|
+
bits[-1-ignore_bits+1..-1] = '' if ignore_bits > 0
|
232
|
+
val = {bits: bits}
|
233
|
+
end
|
234
|
+
val = StopDS.new(val)
|
221
235
|
claimset[name] = val # er, ignoring crit right now
|
222
236
|
end
|
223
237
|
|
data/cert-to-cwt.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cert-to-cwt"
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.4"
|
4
4
|
s.summary = "Convert an X.509 cert into a CWT claim set"
|
5
5
|
s.description = %q{cert-to-cwt is a highly experimental converter for X.509 certificates into CWT claim sets.}
|
6
6
|
s.author = "Carsten Bormann"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cert-to-cwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.6.
|
85
|
+
rubygems_version: 2.6.14
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Convert an X.509 cert into a CWT claim set
|