From 2364c5e6e768531586bff33653206ce18a26d3ca Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 18 Dec 2007 13:12:56 +0000 Subject: * 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 --- ext/dl/win32/lib/win32/sspi.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ext/dl') 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 -- cgit v1.2.3