akero 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -2
- data/README.md +8 -2
- data/lib/akero.rb +6 -2
- data/lib/akero/version.rb +1 -1
- data/spec/akero_spec.rb +1 -1
- metadata +3 -3
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -15,9 +15,16 @@ Akero does not try to be a substitute for a fully featured [PKI](http://en.wikip
|
|
15
15
|
* [100%](https://busyloop.net/oss/akero/coverage/) test coverage
|
16
16
|
|
17
17
|
|
18
|
+
## Installation
|
19
|
+
|
20
|
+
`gem install akero`
|
21
|
+
|
22
|
+
|
18
23
|
## Usage
|
19
24
|
|
20
25
|
```ruby
|
26
|
+
require 'akero'
|
27
|
+
|
21
28
|
# Alice, Bob and Charlie are Akero instances
|
22
29
|
alice = Akero.new
|
23
30
|
bob = Akero.new
|
@@ -64,13 +71,12 @@ new_alice = Akero.load(File.read('/tmp/alice.akr'))
|
|
64
71
|
* [API Docs](http://rubydoc.info/gems/akero/Akero)
|
65
72
|
* [Spec](https://github.com/busyloop/akero/blob/master/spec/akero_spec.rb)
|
66
73
|
|
67
|
-
|
68
74
|
## Benchmarks
|
69
75
|
|
70
76
|
![Throughput](http://github.com/busyloop/akero/raw/master/benchmark/bm_rate.png)
|
71
77
|
![Message size](http://github.com/busyloop/akero/raw/master/benchmark/bm_size.png)
|
72
78
|
|
73
|
-
The above charts were generated on an [AMD Turion II Neo N40L
|
79
|
+
The above charts were generated using MRI 1.9.3p362 (x86_64-linux) on an [AMD Turion II Neo N40L](http://www.cpubenchmark.net/cpu.php?cpu=AMD+Turion+II+Neo+N40L+Dual-Core) CPU.
|
74
80
|
You may run the benchmarks on your own machine with `rake benchmark`.
|
75
81
|
|
76
82
|
## License (MIT)
|
data/lib/akero.rb
CHANGED
@@ -27,6 +27,9 @@ require 'openssl'
|
|
27
27
|
require 'base64'
|
28
28
|
|
29
29
|
# Akero is an easy-to-use library for peer-to-peer public key cryptography.
|
30
|
+
#
|
31
|
+
# Tested on: MRI 1.8.7, MRI 1.9.2, MRI 1.9.3, RBX 1.8, RBX 1.9
|
32
|
+
# (JRuby may be added in the future but is currently NOT supported)
|
30
33
|
class Akero
|
31
34
|
# Akero::Message wraps a received message.
|
32
35
|
class Message
|
@@ -152,7 +155,7 @@ class Akero
|
|
152
155
|
out = [cert_der.length].pack('S')
|
153
156
|
out << cert_der
|
154
157
|
out << @key.to_der
|
155
|
-
out.
|
158
|
+
out.insert(0, OpenSSL::Digest::SHA512.new(out).digest)
|
156
159
|
PKEY_HEADER+Base64.encode64(out)+PKEY_FOOTER
|
157
160
|
end
|
158
161
|
|
@@ -342,7 +345,8 @@ class Akero
|
|
342
345
|
cert.subject = name
|
343
346
|
cert.issuer = name
|
344
347
|
cert.not_before = Time.now
|
345
|
-
|
348
|
+
# valid until 2038-01-19 04:14:06 +0100
|
349
|
+
cert.not_after = Time.at(2147483646)
|
346
350
|
cert.public_key = rsa.public_key
|
347
351
|
|
348
352
|
ef = OpenSSL::X509::ExtensionFactory.new(nil, cert)
|
data/lib/akero/version.rb
CHANGED
data/spec/akero_spec.rb
CHANGED
@@ -165,7 +165,7 @@ describe Akero do
|
|
165
165
|
it "raises RuntimeError on invalid message" do
|
166
166
|
lambda {
|
167
167
|
subject.receive("foobar")
|
168
|
-
}.should raise_error RuntimeError
|
168
|
+
}.should raise_error RuntimeError #, Akero::ERR_MSG_MALFORMED_ENV
|
169
169
|
end
|
170
170
|
|
171
171
|
it "raises RuntimeError when inner does not match outer signature" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: akero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -192,7 +192,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
segments:
|
194
194
|
- 0
|
195
|
-
hash:
|
195
|
+
hash: 2497079939017139128
|
196
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
197
|
none: false
|
198
198
|
requirements:
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
segments:
|
203
203
|
- 0
|
204
|
-
hash:
|
204
|
+
hash: 2497079939017139128
|
205
205
|
requirements: []
|
206
206
|
rubyforge_project:
|
207
207
|
rubygems_version: 1.8.23
|