YubiRuby 0.0.1

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.
data/lib/yubiruby.rb ADDED
@@ -0,0 +1,36 @@
1
+ # Author:: Alessio Caiazza (mailto:nolith@abisso.org)
2
+ # Copyright:: Copyright (c) 2010 Alessio Caiazza
3
+ # License:: New BSD License - http://www.opensource.org/licenses/bsd-license.php
4
+ # All rights reserved.
5
+ #
6
+ # Redistribution and use in source and binary forms, with or without
7
+ # modification, are permitted provided that the following conditions are
8
+ # met:
9
+ #
10
+ # * Redistributions of source code must retain the above copyright
11
+ # notice, this list of conditions and the following disclaimer.
12
+ #
13
+ # * Redistributions in binary form must reproduce the above
14
+ # copyright notice, this list of conditions and the following
15
+ # disclaimer in the documentation and/or other materials provided
16
+ # with the distribution.
17
+ #
18
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+
30
+ require 'libyubikey'
31
+ require 'hex'
32
+
33
+ module YubiRuby
34
+ # C code version
35
+ LIBYUBIKEY_VERSION = '1.5'
36
+ end
@@ -0,0 +1,13 @@
1
+ require "test/unit"
2
+
3
+ require "libyubikey"
4
+
5
+ class TestLibyubikey < Test::Unit::TestCase
6
+ def test_string
7
+ str = "pippo234strd"
8
+ assert_equal(enc = str.modhex_encode, YubiRuby::ModHex.encode(str))
9
+ assert_equal(enc.modhex_decode, YubiRuby::ModHex.decode(enc))
10
+ assert_equal(str, str.modhex_encode().modhex_decode())
11
+ assert(enc.modhex?)
12
+ end
13
+ end
@@ -0,0 +1,6 @@
1
+ $:.unshift File.join(File.dirname(__FILE__),'..','lib')
2
+ $:.unshift File.join(File.dirname(__FILE__),'..','ext')
3
+
4
+ require "test/unit"
5
+
6
+ require "tc_modhex"
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: YubiRuby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Alessio \"nolith\" Caiazza
8
+ autorequire: yubiruby
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-02-02 00:00:00 +01:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: |
17
+ Yubikey integration -
18
+
19
+ Includes Prototypes for low-level Yubikey OTP functions
20
+ witten by Simon Josefsson <simon@josefsson.org>.
21
+ Copyright (c) 2006, 2007, 2008, 2009 Yubico AB
22
+ All rights reserved.
23
+
24
+ Redistribution and use in source and binary forms, with or without
25
+ modification, are permitted provided that the following conditions are
26
+ met:
27
+
28
+ * Redistributions of source code must retain the above copyright
29
+ notice, this list of conditions and the following disclaimer.
30
+
31
+ * Redistributions in binary form must reproduce the above
32
+ copyright notice, this list of conditions and the following
33
+ disclaimer in the documentation and/or other materials provided
34
+ with the distribution.
35
+
36
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
37
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
38
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
39
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
40
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
43
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
45
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47
+
48
+ email: nolith@abisso.org
49
+ executables: []
50
+
51
+ extensions:
52
+ - ext/extconf.rb
53
+ extra_rdoc_files:
54
+ - README
55
+ files:
56
+ - tests/tc_modhex.rb
57
+ - tests/ts_yubiruby.rb
58
+ - lib/hex.rb
59
+ - lib/yubiruby.rb
60
+ - bin/modhex
61
+ - ext/libyubikey.c
62
+ - ext/ykaes.c
63
+ - ext/ykcrc.c
64
+ - ext/ykhex.c
65
+ - ext/ykmodhex.c
66
+ - ext/ykparse.c
67
+ - ext/yubikey.h
68
+ - ext/extconf.rb
69
+ - README
70
+ has_rdoc: true
71
+ homepage: http://bitbucket.org/nolith/yubiruby/
72
+ licenses: []
73
+
74
+ post_install_message:
75
+ rdoc_options: []
76
+
77
+ require_paths:
78
+ - lib
79
+ - ext
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: "0"
85
+ version:
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: "0"
91
+ version:
92
+ requirements: []
93
+
94
+ rubyforge_project:
95
+ rubygems_version: 1.3.5
96
+ signing_key:
97
+ specification_version: 3
98
+ summary: Yubikey integration - Based on Prototypes for low-level Yubikey OTP functions witten by Simon Josefsson <simon@josefsson.org>. Copyright (c) 2006, 2007, 2008, 2009 Yubico AB
99
+ test_files:
100
+ - tests/ts_yubiruby.rb