From dd9d49213e55a755d4eedf00b6c4f62303fde615 Mon Sep 17 00:00:00 2001 From: Nick Pink Date: Tue, 15 Nov 2011 14:46:23 -0800 Subject: [PATCH 1/4] Fix encoding bug --- lib/radiustar/packet.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/radiustar/packet.rb b/lib/radiustar/packet.rb index db03797..52ad8bb 100644 --- a/lib/radiustar/packet.rb +++ b/lib/radiustar/packet.rb @@ -145,7 +145,7 @@ def xor_str(str1, str2) i = 0 newstr = "" str1.each_byte do |c1| - c2 = str2[i] + c2 = str2.getbyte(i) newstr = newstr << (c1 ^ c2) i = i+1 end From fd06a02ecae019cc0b56995e58f7f9ea9137cb2c Mon Sep 17 00:00:00 2001 From: Nick Pink Date: Sun, 1 Jan 2012 14:33:46 -0800 Subject: [PATCH 2/4] Add backward compatibility to encoding fix --- lib/radiustar/packet.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/radiustar/packet.rb b/lib/radiustar/packet.rb index 52ad8bb..fd747b4 100644 --- a/lib/radiustar/packet.rb +++ b/lib/radiustar/packet.rb @@ -144,13 +144,26 @@ def inet_ntoa(iaddr) def xor_str(str1, str2) i = 0 newstr = "" + str2 = str2.bytes.to_a str1.each_byte do |c1| - c2 = str2.getbyte(i) + c2 = str2[i] newstr = newstr << (c1 ^ c2) i = i+1 end newstr end + + def xor_str(str1, str2) + 145 i = 0 + 146 newstr = "" + 147 str2 = str2.bytes.to_a + 148 str1.each_byte do |c1| + 149 c2 = str2[i] + 150 newstr = newstr << (c1 ^ c2) + 151 i = i+1 + 152 end + 153 newstr + 154 end def encode(value, secret) lastround = @authenticator From 610ea4e73cf549d6fb71be72f4832940de6238fb Mon Sep 17 00:00:00 2001 From: Nick Pink Date: Tue, 3 Jan 2012 12:20:20 -0800 Subject: [PATCH 3/4] Bug fix --- .gitignore | 0 History.txt | 0 README.rdoc | 0 Rakefile | 0 lib/radiustar.rb | 0 lib/radiustar/dictionary.rb | 0 lib/radiustar/dictionary/attributes.rb | 0 lib/radiustar/dictionary/values.rb | 0 lib/radiustar/packet.rb | 12 ------------ lib/radiustar/radiustar.rb | 0 lib/radiustar/request.rb | 0 lib/radiustar/vendor.rb | 0 radiustar.gemspec | 0 spec/radiustar_spec.rb | 0 spec/spec_helper.rb | 0 templates/default.txt | 0 templates/dictionary.digium | 0 templates/gandalf.dictionary | 0 test/test_radiustar.rb | 0 version.txt | 0 20 files changed, 12 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 History.txt mode change 100644 => 100755 README.rdoc mode change 100644 => 100755 Rakefile mode change 100644 => 100755 lib/radiustar.rb mode change 100644 => 100755 lib/radiustar/dictionary.rb mode change 100644 => 100755 lib/radiustar/dictionary/attributes.rb mode change 100644 => 100755 lib/radiustar/dictionary/values.rb mode change 100644 => 100755 lib/radiustar/packet.rb mode change 100644 => 100755 lib/radiustar/radiustar.rb mode change 100644 => 100755 lib/radiustar/request.rb mode change 100644 => 100755 lib/radiustar/vendor.rb mode change 100644 => 100755 radiustar.gemspec mode change 100644 => 100755 spec/radiustar_spec.rb mode change 100644 => 100755 spec/spec_helper.rb mode change 100644 => 100755 templates/default.txt mode change 100644 => 100755 templates/dictionary.digium mode change 100644 => 100755 templates/gandalf.dictionary mode change 100644 => 100755 test/test_radiustar.rb mode change 100644 => 100755 version.txt diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/History.txt b/History.txt old mode 100644 new mode 100755 diff --git a/README.rdoc b/README.rdoc old mode 100644 new mode 100755 diff --git a/Rakefile b/Rakefile old mode 100644 new mode 100755 diff --git a/lib/radiustar.rb b/lib/radiustar.rb old mode 100644 new mode 100755 diff --git a/lib/radiustar/dictionary.rb b/lib/radiustar/dictionary.rb old mode 100644 new mode 100755 diff --git a/lib/radiustar/dictionary/attributes.rb b/lib/radiustar/dictionary/attributes.rb old mode 100644 new mode 100755 diff --git a/lib/radiustar/dictionary/values.rb b/lib/radiustar/dictionary/values.rb old mode 100644 new mode 100755 diff --git a/lib/radiustar/packet.rb b/lib/radiustar/packet.rb old mode 100644 new mode 100755 index fd747b4..ecbc39b --- a/lib/radiustar/packet.rb +++ b/lib/radiustar/packet.rb @@ -152,18 +152,6 @@ def xor_str(str1, str2) end newstr end - - def xor_str(str1, str2) - 145 i = 0 - 146 newstr = "" - 147 str2 = str2.bytes.to_a - 148 str1.each_byte do |c1| - 149 c2 = str2[i] - 150 newstr = newstr << (c1 ^ c2) - 151 i = i+1 - 152 end - 153 newstr - 154 end def encode(value, secret) lastround = @authenticator diff --git a/lib/radiustar/radiustar.rb b/lib/radiustar/radiustar.rb old mode 100644 new mode 100755 diff --git a/lib/radiustar/request.rb b/lib/radiustar/request.rb old mode 100644 new mode 100755 diff --git a/lib/radiustar/vendor.rb b/lib/radiustar/vendor.rb old mode 100644 new mode 100755 diff --git a/radiustar.gemspec b/radiustar.gemspec old mode 100644 new mode 100755 diff --git a/spec/radiustar_spec.rb b/spec/radiustar_spec.rb old mode 100644 new mode 100755 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb old mode 100644 new mode 100755 diff --git a/templates/default.txt b/templates/default.txt old mode 100644 new mode 100755 diff --git a/templates/dictionary.digium b/templates/dictionary.digium old mode 100644 new mode 100755 diff --git a/templates/gandalf.dictionary b/templates/gandalf.dictionary old mode 100644 new mode 100755 diff --git a/test/test_radiustar.rb b/test/test_radiustar.rb old mode 100644 new mode 100755 diff --git a/version.txt b/version.txt old mode 100644 new mode 100755 From 7cfd64b561753ffe8813921efdd39c95a8a6920d Mon Sep 17 00:00:00 2001 From: Nick Pink Date: Mon, 20 Feb 2012 20:13:05 -0800 Subject: [PATCH 4/4] Testing push --- README.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index fae7b42..be31de5 100755 --- a/README.rdoc +++ b/README.rdoc @@ -28,7 +28,7 @@ http://github.com/pjdavis/radiustar == DESCRIPTION: -Ruby Radius Library +Ruby Radius Library == FEATURES