yubioath 1.0.0 → 1.1.0
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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/yubioath.rb +7 -7
- data/yubioath.gemspec +2 -2
- 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: 45db1b97a74e59b31a8b0070d1722b18d548bb20
|
4
|
+
data.tar.gz: 81ea24c84fac5bf8d48d79a9c2a01939f234d305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37e6029de7cf3bde37755f1a7ab9d52a343ff3bddddb0160e3dccd4b2e6cf3d51d8b5cfacb61b0232c1ba7393ec61570033c989e234b7ef368c125f6f3551f92
|
7
|
+
data.tar.gz: 50f79cc8c96e6a53c199351b8c941f713dfc4afa52794aad6fd01cde1428cc4d8bde2c7bca58ee5a01e025e23922aa8e92e0320426239926fb0b27d9e0c1cf99
|
data/Gemfile
CHANGED
data/lib/yubioath.rb
CHANGED
@@ -4,8 +4,8 @@ require 'yubioath/response'
|
|
4
4
|
|
5
5
|
class YubiOATH
|
6
6
|
AID = [0xA0, 0x00, 0x00, 0x05, 0x27, 0x21, 0x01, 0x01]
|
7
|
-
ALGORITHMS = {
|
8
|
-
TYPES = {
|
7
|
+
ALGORITHMS = { SHA1: 0x1, SHA256: 0x2 }
|
8
|
+
TYPES = { HOTP: 0x1, TOTP: 0x2 }
|
9
9
|
|
10
10
|
RequestFailed = Class.new(StandardError)
|
11
11
|
|
@@ -14,7 +14,7 @@ class YubiOATH
|
|
14
14
|
select(AID)
|
15
15
|
end
|
16
16
|
|
17
|
-
def calculate(name:, timestamp:)
|
17
|
+
def calculate(name:, timestamp: Time.now)
|
18
18
|
data = Calculate::Request::Data.new(name: name, timestamp: timestamp.to_i / 30)
|
19
19
|
request = Calculate::Request.new(data: data.to_binary_s)
|
20
20
|
response = Response.read(@card.transmit(request.to_binary_s))
|
@@ -22,7 +22,7 @@ class YubiOATH
|
|
22
22
|
Calculate::Response.read(response.data).code.to_s
|
23
23
|
end
|
24
24
|
|
25
|
-
def calculate_all(timestamp:)
|
25
|
+
def calculate_all(timestamp: Time.now)
|
26
26
|
data = CalculateAll::Request::Data.new(timestamp: timestamp.to_i / 30)
|
27
27
|
request = CalculateAll::Request.new(data: data.to_binary_s)
|
28
28
|
response = Response.read(@card.transmit(request.to_binary_s))
|
@@ -50,7 +50,7 @@ class YubiOATH
|
|
50
50
|
end.to_h
|
51
51
|
end
|
52
52
|
|
53
|
-
def put(name:, secret:, algorithm
|
53
|
+
def put(name:, secret:, algorithm: :SHA256, type: :TOTP, digits: 6)
|
54
54
|
data = Put::Request::Data.new(
|
55
55
|
name: name,
|
56
56
|
type: TYPES.fetch(type),
|
@@ -62,8 +62,8 @@ class YubiOATH
|
|
62
62
|
Response.read(@card.transmit(request.to_binary_s))
|
63
63
|
end
|
64
64
|
|
65
|
-
def reset
|
66
|
-
Response.read(@card.transmit(Reset::Request.new.to_binary_s))
|
65
|
+
def reset(confirm: false)
|
66
|
+
Response.read(@card.transmit(Reset::Request.new.to_binary_s)) if confirm
|
67
67
|
end
|
68
68
|
|
69
69
|
private
|
data/yubioath.gemspec
CHANGED
@@ -4,10 +4,10 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'yubioath'
|
7
|
-
spec.version = '1.
|
7
|
+
spec.version = '1.1.0'
|
8
8
|
spec.authors = ['James Ottaway']
|
9
9
|
spec.email = ['yubioath@james.ottaway.io']
|
10
|
-
spec.summary = '
|
10
|
+
spec.summary = 'A mostly-complete Ruby implementation of the YubiOATH applet protocol'
|
11
11
|
spec.homepage = 'https://github.com/jamesottaway/yubioath'
|
12
12
|
spec.license = 'MIT'
|
13
13
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yubioath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Ottaway
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -75,5 +75,5 @@ rubyforge_project:
|
|
75
75
|
rubygems_version: 2.4.5
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
|
-
summary:
|
78
|
+
summary: A mostly-complete Ruby implementation of the YubiOATH applet protocol
|
79
79
|
test_files: []
|