summaryrefslogtreecommitdiff
path: root/ext/dl
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-18 13:12:56 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-18 13:12:56 +0000
commit2364c5e6e768531586bff33653206ce18a26d3ca (patch)
treeed8a6157fde62204ab82596b8b7a730d074c850d /ext/dl
parent8394de7bfcb053019f96f7171c4f2f4ebbdfbe50 (diff)
* dl/win32/lib/win32/sspi.rb: use pack/unpack("m") instead of base64
library which was already removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl')
-rw-r--r--ext/dl/win32/lib/win32/sspi.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/dl/win32/lib/win32/sspi.rb b/ext/dl/win32/lib/win32/sspi.rb
index 60291d51ea..ef90ae35a7 100644
--- a/ext/dl/win32/lib/win32/sspi.rb
+++ b/ext/dl/win32/lib/win32/sspi.rb
@@ -11,7 +11,6 @@
#
require 'Win32API'
-require 'base64'
# Implements bindings to Win32 SSPI functions, focused on authentication to a proxy server over HTTP.
module Win32
@@ -213,7 +212,7 @@ module Win32
REQUEST_FLAGS = ISC_REQ_CONFIDENTIALITY | ISC_REQ_REPLAY_DETECT | ISC_REQ_CONNECTION
# NTLM tokens start with this header always. Encoding alone adds "==" and newline, so remove those
- B64_TOKEN_PREFIX = Base64.encode64("NTLMSSP").delete("=\n")
+ B64_TOKEN_PREFIX = ["NTLMSSP"].pack("m").delete("=\n")
# Given a connection and a request path, performs authentication as the current user and returns
# the response from a GET request. The connnection should be a Net::HTTP object, and it should
@@ -281,7 +280,7 @@ module Win32
if token.include? B64_TOKEN_PREFIX
# indicates base64 encoded token
- token = Base64.decode64(token.strip)
+ token = token.strip.unpack("m")[0]
end
outputBuffer = SecurityBuffer.new
@@ -324,7 +323,7 @@ module Win32
def encode_token(t)
# encode64 will add newlines every 60 characters so we need to remove those.
- Base64.encode64(t).delete("\n")
+ [t].pack("m").delete("\n")
end
end
end