radiustar 0.0.5 → 0.0.6
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/History.txt +3 -0
- data/README.rdoc +2 -22
- data/lib/radiustar/old_hash.rb +12 -0
- data/lib/radiustar/packet.rb +9 -7
- data/radiustar.gemspec +3 -3
- data/version.txt +1 -1
- metadata +6 -5
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -1,27 +1,7 @@
|
|
1
1
|
== RADIUSTAR
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
.........................................................................HHH......................
|
6
|
-
........................................................................HHHHH.....................
|
7
|
-
......................................................................HHHHHHHH....................
|
8
|
-
...............................................................@_’’’@HHHHHHHHHHH3HdHdddHd’........
|
9
|
-
.......................................................dWE9p_^^&@d3HHHHHHHHHHHHHHHdHHHH@..........
|
10
|
-
....................................................z933333HHHHHHHHHHHHHHHHHHHHddHdddd’...........
|
11
|
-
..................................................pWp33Hdd@&&dHHHHHHHHHHHHHHHddHHHHd..............
|
12
|
-
............................................33p3p3H@&&_@&@&&__^&3HHHHHHHHHHHHddHdH^...............
|
13
|
-
........................................W3Hd&_&&_&@&_^@WN7WH3H_’.HHHHHHHHHHHHddHdd................
|
14
|
-
...................................WWpHd@&___’’^^@HpNW7JJEENppd’&3HHHHHHHHHHHHddHd&...............
|
15
|
-
................................pH@d&&&@&___^_&&d@HW7JzJEJJ7N3@’3HHHHHdHHHHHHHHHHHd...............
|
16
|
-
........................3ppW3d@^_&__^^&&_^^_d3d39QzEEEE97EENp3&H333HHHdddHHH33HdHdH^..............
|
17
|
-
.....................dd@@dd@&&_^^&__&&d@dHddH@@3EJEWWN7W7EN3H&^p3HHdddHdH&...&dHHHdd..............
|
18
|
-
................&&^__@&_@_^^_^^_&&dpWd3H&&&_HdpWW9EWppHWWHHH&^d3HHHHHHHH’........’_d’.............
|
19
|
-
............_&@@@&&_^’’^_&@&HH33HpWW3dHd^^_’33pp97NWWHHHd@@^’^3HdddHHd^...........................
|
20
|
-
........&d__@’’’’_^’’_&@&@&&3dH@@Hdd&_@____&@Hd@H@@_’’’’’....’^H&HHHH.............................
|
21
|
-
....@@____^’^__^’&&@@@@H3d&@ddd@d^^^@__^d&_’.’’.................HHH...............................
|
22
|
-
Hdd@@____^_&&dd@@d_d__&&__&@^’&__^_’’.’...........................................................
|
23
|
-
@__&&__@&&&_&@@dH&^&^^^’^^^_^’’...................................................................
|
24
|
-
&_ddd@@@&___&&_&’^^’.’’...........................................................................
|
3
|
+
Pretend this is ascii art of the "the more you know" star thing
|
4
|
+
---=====*
|
25
5
|
|
26
6
|
by pjdavis
|
27
7
|
http://github.com/pjdavis/radiustar
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#
|
2
|
+
# Monkey-patch the default ruby version < 1.9.0 Hash class to provide
|
3
|
+
# the same interface to the radiustar libs.
|
4
|
+
#
|
5
|
+
class Hash
|
6
|
+
# Implementation of the ruby-1.9.x key function:
|
7
|
+
# http://www.ruby-doc.org/core-1.9.3/Hash.html#method-i-key
|
8
|
+
def key(value)
|
9
|
+
self.index value
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
data/lib/radiustar/packet.rb
CHANGED
@@ -2,6 +2,8 @@ module Radiustar
|
|
2
2
|
|
3
3
|
require 'digest/md5'
|
4
4
|
require 'ipaddr_extensions'
|
5
|
+
require File.join(File.expand_path(File.dirname __FILE__), "old_hash") if RUBY_VERSION < '1.9.0'
|
6
|
+
|
5
7
|
|
6
8
|
class Packet
|
7
9
|
|
@@ -59,10 +61,10 @@ module Radiustar
|
|
59
61
|
def gen_acct_authenticator(secret)
|
60
62
|
# From RFC2866
|
61
63
|
# Request Authenticator
|
62
|
-
#
|
64
|
+
#
|
63
65
|
# In Accounting-Request Packets, the Authenticator value is a 16
|
64
66
|
# octet MD5 [5] checksum, called the Request Authenticator.
|
65
|
-
#
|
67
|
+
#
|
66
68
|
# The NAS and RADIUS accounting server share a secret. The Request
|
67
69
|
# Authenticator field in Accounting-Request packets contains a one-
|
68
70
|
# way MD5 hash calculated over a stream of octets consisting of the
|
@@ -70,12 +72,12 @@ module Radiustar
|
|
70
72
|
# shared secret (where + indicates concatenation). The 16 octet MD5
|
71
73
|
# hash value is stored in the Authenticator field of the
|
72
74
|
# Accounting-Request packet.
|
73
|
-
#
|
75
|
+
#
|
74
76
|
# Note that the Request Authenticator of an Accounting-Request can
|
75
77
|
# not be done the same way as the Request Authenticator of a RADIUS
|
76
78
|
# Access-Request, because there is no User-Password attribute in an
|
77
79
|
# Accounting-Request.
|
78
|
-
#
|
80
|
+
#
|
79
81
|
@authenticator = "\000"*16
|
80
82
|
@authenticator = Digest::MD5.digest(pack + secret)
|
81
83
|
@packed = nil
|
@@ -299,11 +301,11 @@ module Radiustar
|
|
299
301
|
""
|
300
302
|
end
|
301
303
|
begin
|
302
|
-
[anum,
|
303
|
-
val.length + 2,
|
304
|
+
[anum,
|
305
|
+
val.length + 2,
|
304
306
|
val
|
305
307
|
].pack(P_ATTR)
|
306
|
-
rescue
|
308
|
+
rescue
|
307
309
|
puts "#{@name} => #{@value}"
|
308
310
|
puts [anum, val.length + 2, val].inspect
|
309
311
|
end
|
data/radiustar.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "radiustar"
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.6"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["PJ Davis"]
|
9
|
-
s.date = "2012-
|
9
|
+
s.date = "2012-04-11"
|
10
10
|
s.description = "Ruby Radius Library"
|
11
11
|
s.email = "pj.davis@gmail.com"
|
12
12
|
s.extra_rdoc_files = ["History.txt", "README.rdoc", "templates/default.txt"]
|
13
|
-
s.files = ["History.txt", "README.rdoc", "Rakefile", "lib/radiustar.rb", "lib/radiustar/dictionary.rb", "lib/radiustar/dictionary/attributes.rb", "lib/radiustar/dictionary/values.rb", "lib/radiustar/packet.rb", "lib/radiustar/radiustar.rb", "lib/radiustar/request.rb", "lib/radiustar/vendor.rb", "radiustar.gemspec", "spec/radiustar_spec.rb", "spec/spec_helper.rb", "spec/value_spec.rb", "templates/default.txt", "templates/dictionary.digium", "templates/dictionary.rfc2865", "templates/gandalf.dictionary", "test/test_radiustar.rb", "version.txt"]
|
13
|
+
s.files = ["History.txt", "README.rdoc", "Rakefile", "lib/radiustar.rb", "lib/radiustar/dictionary.rb", "lib/radiustar/dictionary/attributes.rb", "lib/radiustar/dictionary/values.rb", "lib/radiustar/old_hash.rb", "lib/radiustar/packet.rb", "lib/radiustar/radiustar.rb", "lib/radiustar/request.rb", "lib/radiustar/vendor.rb", "radiustar.gemspec", "spec/radiustar_spec.rb", "spec/spec_helper.rb", "spec/value_spec.rb", "templates/default.txt", "templates/dictionary.digium", "templates/dictionary.rfc2865", "templates/gandalf.dictionary", "test/test_radiustar.rb", "version.txt"]
|
14
14
|
s.homepage = "http://github.com/pjdavis/radiustar"
|
15
15
|
s.rdoc_options = ["--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiustar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- PJ Davis
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-04-11 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: ipaddr_extensions
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/radiustar/dictionary.rb
|
68
68
|
- lib/radiustar/dictionary/attributes.rb
|
69
69
|
- lib/radiustar/dictionary/values.rb
|
70
|
+
- lib/radiustar/old_hash.rb
|
70
71
|
- lib/radiustar/packet.rb
|
71
72
|
- lib/radiustar/radiustar.rb
|
72
73
|
- lib/radiustar/request.rb
|
@@ -114,6 +115,6 @@ rubyforge_project: radiustar
|
|
114
115
|
rubygems_version: 1.8.15
|
115
116
|
signing_key:
|
116
117
|
specification_version: 3
|
117
|
-
summary:
|
118
|
+
summary: Pretend this is ascii art of the "the more you know" star thing ---=====*
|
118
119
|
test_files:
|
119
120
|
- test/test_radiustar.rb
|