YubiRuby 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG ADDED
@@ -0,0 +1,3 @@
1
+ v0.1.0. modhex installed as binary.
2
+
3
+ v0.0.1. First release
data/LICENSE ADDED
@@ -0,0 +1,34 @@
1
+ RubyRuby --- Ruby wrapper for low-level Yubikey OTP functions.
2
+
3
+ Written by Alessio Caiazza <nolith@abisso.org>.
4
+ Copyright (c) 2010 Alessio Caiazza
5
+ All rights reserved.
6
+
7
+ The core library is written by Simon Josefsson <simon@josefsson.org>.
8
+ Copyright (c) 2006, 2007, 2008, 2009 Yubico AB
9
+ All rights reserved.
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are
13
+ met:
14
+
15
+ * Redistributions of source code must retain the above copyright
16
+ notice, this list of conditions and the following disclaimer.
17
+
18
+ * Redistributions in binary form must reproduce the above
19
+ copyright notice, this list of conditions and the following
20
+ disclaimer in the documentation and/or other materials provided
21
+ with the distribution.
22
+
23
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+
data/Manifest ADDED
@@ -0,0 +1,19 @@
1
+ CHANGELOG
2
+ LICENSE
3
+ Manifest
4
+ README
5
+ Rakefile
6
+ YubiRuby.gemspec
7
+ bin/modhex
8
+ ext/libyubikey/extconf.rb
9
+ ext/libyubikey/libyubikey.c
10
+ ext/libyubikey/ykaes.c
11
+ ext/libyubikey/ykcrc.c
12
+ ext/libyubikey/ykhex.c
13
+ ext/libyubikey/ykmodhex.c
14
+ ext/libyubikey/ykparse.c
15
+ ext/libyubikey/yubikey.h
16
+ lib/hex.rb
17
+ lib/yubiruby.rb
18
+ tests/tc_modhex.rb
19
+ tests/ts_yubiruby.rb
data/Rakefile ADDED
@@ -0,0 +1,48 @@
1
+ # Rakefile
2
+ require 'rubygems'
3
+ require 'rake'
4
+ require 'echoe'
5
+
6
+ Echoe.new('YubiRuby') do |p|
7
+ p.description = <<-EOF
8
+ Yubikey integration -
9
+
10
+ Includes Prototypes for low-level Yubikey OTP functions
11
+ witten by Simon Josefsson <simon@josefsson.org>.
12
+ Copyright (c) 2006, 2007, 2008, 2009 Yubico AB
13
+ All rights reserved.
14
+
15
+ Redistribution and use in source and binary forms, with or without
16
+ modification, are permitted provided that the following conditions are
17
+ met:
18
+
19
+ * Redistributions of source code must retain the above copyright
20
+ notice, this list of conditions and the following disclaimer.
21
+
22
+ * Redistributions in binary form must reproduce the above
23
+ copyright notice, this list of conditions and the following
24
+ disclaimer in the documentation and/or other materials provided
25
+ with the distribution.
26
+
27
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
+ EOF
39
+ p.url = "http://bitbucket.org/nolith/yubiruby"
40
+ p.author = "Alessio Caiazza"
41
+ p.email = "nolith@abisso.org"
42
+ p.platform = Gem::Platform::RUBY
43
+ p.ignore_pattern = ["tmp/**/*", "script/*"]
44
+ p.development_dependencies = []
45
+ end
46
+
47
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
48
+
data/YubiRuby.gemspec ADDED
@@ -0,0 +1,63 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{YubiRuby}
5
+ s.version = "0.1.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Alessio Caiazza"]
9
+ s.date = %q{2010-02-03}
10
+ s.default_executable = %q{modhex}
11
+ s.description = %q{Yubikey integration -
12
+
13
+ Includes Prototypes for low-level Yubikey OTP functions
14
+ witten by Simon Josefsson <simon@josefsson.org>.
15
+ Copyright (c) 2006, 2007, 2008, 2009 Yubico AB
16
+ All rights reserved.
17
+
18
+ Redistribution and use in source and binary forms, with or without
19
+ modification, are permitted provided that the following conditions are
20
+ met:
21
+
22
+ * Redistributions of source code must retain the above copyright
23
+ notice, this list of conditions and the following disclaimer.
24
+
25
+ * Redistributions in binary form must reproduce the above
26
+ copyright notice, this list of conditions and the following
27
+ disclaimer in the documentation and/or other materials provided
28
+ with the distribution.
29
+
30
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41
+ }
42
+ s.email = %q{nolith@abisso.org}
43
+ s.executables = ["modhex"]
44
+ s.extensions = ["ext/libyubikey/extconf.rb"]
45
+ s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "bin/modhex", "ext/libyubikey/extconf.rb", "ext/libyubikey/libyubikey.c", "ext/libyubikey/ykaes.c", "ext/libyubikey/ykcrc.c", "ext/libyubikey/ykhex.c", "ext/libyubikey/ykmodhex.c", "ext/libyubikey/ykparse.c", "ext/libyubikey/yubikey.h", "lib/hex.rb", "lib/yubiruby.rb"]
46
+ s.files = ["CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "YubiRuby.gemspec", "bin/modhex", "ext/libyubikey/extconf.rb", "ext/libyubikey/libyubikey.c", "ext/libyubikey/ykaes.c", "ext/libyubikey/ykcrc.c", "ext/libyubikey/ykhex.c", "ext/libyubikey/ykmodhex.c", "ext/libyubikey/ykparse.c", "ext/libyubikey/yubikey.h", "lib/hex.rb", "lib/yubiruby.rb", "tests/tc_modhex.rb", "tests/ts_yubiruby.rb"]
47
+ s.homepage = %q{http://bitbucket.org/nolith/yubiruby}
48
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "YubiRuby", "--main", "README"]
49
+ s.require_paths = ["lib", "ext"]
50
+ s.rubyforge_project = %q{yubiruby}
51
+ s.rubygems_version = %q{1.3.5}
52
+ s.summary = %q{Yubikey integration - Includes Prototypes for low-level Yubikey OTP functions witten by Simon Josefsson <simon@josefsson.org>. Copyright (c) 2006, 2007, 2008, 2009 Yubico AB All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}
53
+
54
+ if s.respond_to? :specification_version then
55
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
56
+ s.specification_version = 3
57
+
58
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
59
+ else
60
+ end
61
+ else
62
+ end
63
+ end
data/bin/modhex CHANGED
@@ -1,48 +1,45 @@
1
1
  #!/usr/bin/env ruby -wKU
2
- $:.unshift File.join(File.dirname(__FILE__),'..','lib')
3
- $:.unshift File.join(File.dirname(__FILE__),'..','ext')
4
2
 
5
3
  require 'yubiruby'
6
4
 
7
- if __FILE__ == $PROGRAM_NAME
8
- if ARGV.length < 1
9
- msg=<<-EOF
5
+
6
+ if ARGV.length < 1
7
+ msg=<<-EOF
10
8
  Usage: #{$PROGRAM_NAME} [-dh] <data>
11
-
9
+
12
10
  Convert input DATA as specified and print output to STDOUT.
13
11
 
14
- -d: Decode data (the default is to encode data).
15
- -h: Use hex encoding for all non-modhex data.
16
- DATA: string with data to encode
12
+ -d: Decode data (the default is to encode data).
13
+ -h: Use hex encoding for all non-modhex data.
14
+ DATA: string with data to encode
17
15
 
18
16
  Examples:
19
17
 
20
- ModHex encode ASCII-string \"test\":
21
- #{$PROGRAM_NAME} test
18
+ ModHex encode ASCII-string \"test\":
19
+ #{$PROGRAM_NAME} test
22
20
 
23
- Decode ModHex data \"ifhgieif\" into ASCII string:
24
- #{$PROGRAM_NAME} -d ifhgieif
21
+ Decode ModHex data \"ifhgieif\" into ASCII string:
22
+ #{$PROGRAM_NAME} -d ifhgieif
25
23
 
26
- ModHex encode hex-encoded data \"b565716f\":
27
- #{$PROGRAM_NAME} -h b565716f
24
+ ModHex encode hex-encoded data \"b565716f\":
25
+ #{$PROGRAM_NAME} -h b565716f
28
26
 
29
- Decode ModHex data \"nghgibhv\" and print hex-encode data:
30
- #{$PROGRAM_NAME} -d -h nghgibhv
27
+ Decode ModHex data \"nghgibhv\" and print hex-encode data:
28
+ #{$PROGRAM_NAME} -d -h nghgibhv
31
29
  EOF
32
- abort msg
33
- end
34
-
35
- hex = ARGV.include? "-h"
36
- decode = ARGV.include? "-d"
37
- data = ARGV.last
38
-
39
- if decode
40
- out = data.modhex_decode
41
- out = YubiRuby::HEX.encode(out) if hex
42
- puts out
43
- else
44
- data = YubiRuby::HEX.decode(data) if hex
45
- puts data.modhex_encode
46
- end
30
+ abort msg
31
+ end
32
+
33
+ hex = ARGV.include? "-h"
34
+ decode = ARGV.include? "-d"
35
+ data = ARGV.last
36
+
37
+ if decode
38
+ out = data.modhex_decode
39
+ out = YubiRuby::HEX.encode(out) if hex
40
+ puts out
41
+ else
42
+ data = YubiRuby::HEX.decode(data) if hex
43
+ puts data.modhex_encode
44
+ end
47
45
 
48
- end
File without changes
@@ -260,6 +260,7 @@ static VALUE yubikey_init_copy(VALUE copy, VALUE orig)
260
260
  * yubikey.parse(otp) -> true or false
261
261
  *
262
262
  * Checks the +otp+ for a valid SSO.
263
+ * Replay attack aren't detected.
263
264
  */
264
265
  static VALUE yubikey_check(VALUE self, VALUE otp)
265
266
  {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: YubiRuby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Alessio \"nolith\" Caiazza
8
- autorequire: yubiruby
7
+ - Alessio Caiazza
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-02 00:00:00 +01:00
12
+ date: 2010-02-03 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -46,34 +46,57 @@ description: |
46
46
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47
47
 
48
48
  email: nolith@abisso.org
49
- executables: []
50
-
49
+ executables:
50
+ - modhex
51
51
  extensions:
52
- - ext/extconf.rb
52
+ - ext/libyubikey/extconf.rb
53
53
  extra_rdoc_files:
54
+ - CHANGELOG
55
+ - LICENSE
54
56
  - README
55
- files:
56
- - tests/tc_modhex.rb
57
- - tests/ts_yubiruby.rb
57
+ - bin/modhex
58
+ - ext/libyubikey/extconf.rb
59
+ - ext/libyubikey/libyubikey.c
60
+ - ext/libyubikey/ykaes.c
61
+ - ext/libyubikey/ykcrc.c
62
+ - ext/libyubikey/ykhex.c
63
+ - ext/libyubikey/ykmodhex.c
64
+ - ext/libyubikey/ykparse.c
65
+ - ext/libyubikey/yubikey.h
58
66
  - lib/hex.rb
59
67
  - 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
68
+ files:
69
+ - CHANGELOG
70
+ - LICENSE
71
+ - Manifest
69
72
  - README
73
+ - Rakefile
74
+ - YubiRuby.gemspec
75
+ - bin/modhex
76
+ - ext/libyubikey/extconf.rb
77
+ - ext/libyubikey/libyubikey.c
78
+ - ext/libyubikey/ykaes.c
79
+ - ext/libyubikey/ykcrc.c
80
+ - ext/libyubikey/ykhex.c
81
+ - ext/libyubikey/ykmodhex.c
82
+ - ext/libyubikey/ykparse.c
83
+ - ext/libyubikey/yubikey.h
84
+ - lib/hex.rb
85
+ - lib/yubiruby.rb
86
+ - tests/tc_modhex.rb
87
+ - tests/ts_yubiruby.rb
70
88
  has_rdoc: true
71
- homepage: http://bitbucket.org/nolith/yubiruby/
89
+ homepage: http://bitbucket.org/nolith/yubiruby
72
90
  licenses: []
73
91
 
74
92
  post_install_message:
75
- rdoc_options: []
76
-
93
+ rdoc_options:
94
+ - --line-numbers
95
+ - --inline-source
96
+ - --title
97
+ - YubiRuby
98
+ - --main
99
+ - README
77
100
  require_paths:
78
101
  - lib
79
102
  - ext
@@ -87,14 +110,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
110
  requirements:
88
111
  - - ">="
89
112
  - !ruby/object:Gem::Version
90
- version: "0"
113
+ version: "1.2"
91
114
  version:
92
115
  requirements: []
93
116
 
94
- rubyforge_project:
117
+ rubyforge_project: yubiruby
95
118
  rubygems_version: 1.3.5
96
119
  signing_key:
97
120
  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
121
+ summary: "Yubikey integration - Includes Prototypes for low-level Yubikey OTP functions witten by Simon Josefsson <simon@josefsson.org>. Copyright (c) 2006, 2007, 2008, 2009 Yubico AB All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
122
+ test_files: []
123
+