yubioath 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/lib/yubioath.rb +7 -7
  4. data/yubioath.gemspec +2 -2
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f3d7712ca20e86423b1dd55b26c6e8390bd9c08
4
- data.tar.gz: e81afd263ba2466f972568e4fe199bd9b9237b5f
3
+ metadata.gz: 45db1b97a74e59b31a8b0070d1722b18d548bb20
4
+ data.tar.gz: 81ea24c84fac5bf8d48d79a9c2a01939f234d305
5
5
  SHA512:
6
- metadata.gz: 903e5115d614d3cc777f6a2ea46a66561bdb2c7be8bebccc653a695c36449b970ff00dd56eed04bbdc879d18b34fb39ab0ffe36a18ed03798c5db3b45bca37b7
7
- data.tar.gz: 34215cf74eb5316b6728136df0106a0c74ec5610fc0e7c2bb5b643d7a3b1c66b45217f749c631f8303378c1ec7b3d36b85d894f94b31793381a606f10bf186ff
6
+ metadata.gz: 37e6029de7cf3bde37755f1a7ab9d52a343ff3bddddb0160e3dccd4b2e6cf3d51d8b5cfacb61b0232c1ba7393ec61570033c989e234b7ef368c125f6f3551f92
7
+ data.tar.gz: 50f79cc8c96e6a53c199351b8c941f713dfc4afa52794aad6fd01cde1428cc4d8bde2c7bca58ee5a01e025e23922aa8e92e0320426239926fb0b27d9e0c1cf99
data/Gemfile CHANGED
@@ -13,5 +13,5 @@ group :test do
13
13
  gem 'rspec', '~> 3.3'
14
14
  gem 'rspec-its', '~> 1.2'
15
15
  gem 'rspec-the', '~> 1.0'
16
- gem 'smartcard', '~> 0.5.5'
16
+ gem 'smartcard', '~> 0.5.6'
17
17
  end
@@ -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 = { sha1: 0x1, sha256: 0x2 }
8
- TYPES = { hotp: 0x1, totp: 0x2 }
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:, type:, digits:)
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
@@ -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.0.0'
7
+ spec.version = '1.1.0'
8
8
  spec.authors = ['James Ottaway']
9
9
  spec.email = ['yubioath@james.ottaway.io']
10
- spec.summary = 'Securely manage your 2FA tokens using your Yubikey NEO'
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.0.0
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-07-07 00:00:00.000000000 Z
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: Securely manage your 2FA tokens using your Yubikey NEO
78
+ summary: A mostly-complete Ruby implementation of the YubiOATH applet protocol
79
79
  test_files: []