[前][次][番号順一覧][スレッド一覧]

ruby-changes:2810

From: ko1@a...
Date: 18 Dec 2007 22:26:18 +0900
Subject: [ruby-changes:2810] usa - Ruby:r14301 (trunk): * dl/win32/lib/win32/sspi.rb: use pack/unpack("m") instead of base64

usa	2007-12-18 22:12:56 +0900 (Tue, 18 Dec 2007)

  New Revision: 14301

  Modified files:
    trunk/ChangeLog
    trunk/ext/dl/win32/lib/win32/sspi.rb

  Log:
    * dl/win32/lib/win32/sspi.rb: use pack/unpack("m") instead of base64
      library which was already removed.
    


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14301&r2=14300
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/dl/win32/lib/win32/sspi.rb?r1=14301&r2=14300

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14300)
+++ ChangeLog	(revision 14301)
@@ -1,3 +1,8 @@
+Tue Dec 18 22:11:23 2007  NAKAMURA Usaku  <usa@r...>
+
+	* 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@a...>
 
 	* vm.c (invoke_block): merge 2 stack overflow checks.
Index: ext/dl/win32/lib/win32/sspi.rb
===================================================================
--- ext/dl/win32/lib/win32/sspi.rb	(revision 14300)
+++ ext/dl/win32/lib/win32/sspi.rb	(revision 14301)
@@ -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 @@
 			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 @@
 
 				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 @@
 
 			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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]