* 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
This commit is contained in:
usa 2007-12-18 13:12:56 +00:00
Родитель 8394de7bfc
Коммит 2364c5e6e7
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Dec 18 22:11:23 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* 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 <ko1@atdot.net>
* vm.c (invoke_block): merge 2 stack overflow checks.

Просмотреть файл

@ -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