radiustar 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/README.rdoc +1 -0
- data/lib/radiustar/packet.rb +25 -23
- data/radiustar.gemspec +2 -2
- data/version.txt +1 -1
- metadata +8 -15
data/History.txt
CHANGED
data/README.rdoc
CHANGED
data/lib/radiustar/packet.rb
CHANGED
@@ -16,9 +16,9 @@ module Radiustar
|
|
16
16
|
'CoA-ACK' => 44, 'CoA-NAK' => 45 }
|
17
17
|
|
18
18
|
|
19
|
-
HDRLEN = 1 + 1 + 2 + 16
|
20
|
-
P_HDR = "CCna16a*"
|
21
|
-
P_ATTR = "CCa*"
|
19
|
+
HDRLEN = 1 + 1 + 2 + 16 # size of packet header
|
20
|
+
P_HDR = "CCna16a*" # pack template for header
|
21
|
+
P_ATTR = "CCa*" # pack template for attribute
|
22
22
|
|
23
23
|
attr_accessor :code
|
24
24
|
attr_reader :id, :attributes, :authenticator
|
@@ -160,29 +160,31 @@ module Radiustar
|
|
160
160
|
if attribute_type == 26 # Vendor Specific Attribute
|
161
161
|
vid, attribute_type, attribute_value = attribute_data.unpack("xxNCxa#{length-6}")
|
162
162
|
vendor = @dict.vendors.find_by_id(vid)
|
163
|
-
attribute = vendor.find_attribute_by_id(attribute_type)
|
163
|
+
attribute = vendor.find_attribute_by_id(attribute_type) if vendor
|
164
164
|
else
|
165
165
|
vendor = nil
|
166
166
|
attribute = @dict.find_attribute_by_id(attribute_type)
|
167
167
|
end
|
168
168
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
169
|
+
if attribute
|
170
|
+
attribute_value = case attribute.type
|
171
|
+
when 'string'
|
172
|
+
attribute_value
|
173
|
+
when 'integer'
|
174
|
+
attribute.has_values? ? attribute.find_values_by_id(attribute_value.unpack("N")[0]).name : attribute_value.unpack("N")[0]
|
175
|
+
when 'ipaddr'
|
176
|
+
attribute_value.unpack("N")[0].to_ip.to_s
|
177
|
+
when 'time'
|
178
|
+
attribute_value.unpack("N")[0]
|
179
|
+
when 'date'
|
180
|
+
attribute_value.unpack("N")[0]
|
181
|
+
end
|
182
|
+
|
183
|
+
if vendor
|
184
|
+
set_attribute(vendor.name+"/"+attribute.name, attribute_value) if attribute
|
185
|
+
else
|
186
|
+
set_attribute(attribute.name, attribute_value) if attribute
|
187
|
+
end
|
186
188
|
end
|
187
189
|
|
188
190
|
attribute_data[0, length] = ""
|
@@ -216,8 +218,8 @@ module Radiustar
|
|
216
218
|
decoded_value = ""
|
217
219
|
lastround = @authenticator
|
218
220
|
0.step(value.length-1, 16) do |i|
|
219
|
-
|
220
|
-
|
221
|
+
decoded_value += xor_str(value[i, 16], Digest::MD5.digest(secret + lastround))
|
222
|
+
lastround = value[i, 16]
|
221
223
|
end
|
222
224
|
|
223
225
|
decoded_value.gsub!(/\000+/, "") if decoded_value
|
data/radiustar.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "radiustar"
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.7"
|
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-07-23"
|
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"]
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiustar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
8
|
+
- 7
|
9
|
+
version: 0.0.7
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- PJ Davis
|
@@ -15,17 +14,16 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2012-
|
17
|
+
date: 2012-07-23 00:00:00 -05:00
|
18
|
+
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: ipaddr_extensions
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
-
none: false
|
25
24
|
requirements:
|
26
25
|
- - ">="
|
27
26
|
- !ruby/object:Gem::Version
|
28
|
-
hash: 16097
|
29
27
|
segments:
|
30
28
|
- 2012
|
31
29
|
- 1
|
@@ -37,11 +35,9 @@ dependencies:
|
|
37
35
|
name: bones
|
38
36
|
prerelease: false
|
39
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
38
|
requirements:
|
42
39
|
- - ">="
|
43
40
|
- !ruby/object:Gem::Version
|
44
|
-
hash: 29
|
45
41
|
segments:
|
46
42
|
- 3
|
47
43
|
- 7
|
@@ -82,6 +78,7 @@ files:
|
|
82
78
|
- templates/gandalf.dictionary
|
83
79
|
- test/test_radiustar.rb
|
84
80
|
- version.txt
|
81
|
+
has_rdoc: true
|
85
82
|
homepage: http://github.com/pjdavis/radiustar
|
86
83
|
licenses: []
|
87
84
|
|
@@ -92,29 +89,25 @@ rdoc_options:
|
|
92
89
|
require_paths:
|
93
90
|
- lib
|
94
91
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
92
|
requirements:
|
97
93
|
- - ">="
|
98
94
|
- !ruby/object:Gem::Version
|
99
|
-
hash: 3
|
100
95
|
segments:
|
101
96
|
- 0
|
102
97
|
version: "0"
|
103
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
|
-
none: false
|
105
99
|
requirements:
|
106
100
|
- - ">="
|
107
101
|
- !ruby/object:Gem::Version
|
108
|
-
hash: 3
|
109
102
|
segments:
|
110
103
|
- 0
|
111
104
|
version: "0"
|
112
105
|
requirements: []
|
113
106
|
|
114
107
|
rubyforge_project: radiustar
|
115
|
-
rubygems_version: 1.
|
108
|
+
rubygems_version: 1.3.6
|
116
109
|
signing_key:
|
117
110
|
specification_version: 3
|
118
|
-
summary:
|
111
|
+
summary: .
|
119
112
|
test_files:
|
120
113
|
- test/test_radiustar.rb
|