diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/dl/win32/lib/win32/sspi.rb | 7 |
2 files changed, 8 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Tue Dec 18 22:11:23 2007 NAKAMURA Usaku <[email protected]> + + * ext/dl/win32/lib/win32/sspi.rb: use pack/unpack("m") instead of + base64 library which was already removed. + Tue Dec 18 21:09:23 2007 Koichi Sasada <[email protected]> * vm.c (invoke_block): merge 2 stack overflow checks. 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 |