X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=ntlm.el;h=7b2182bb5d7c12f6382b6efc238a54e854a88185;hb=802330e14c105cc9728cd705794df87bf93b5b77;hp=399cb1aaa175f0998c4fa450072cb372439f635b;hpb=4054fe97e489a28daf21cb0b283520d7df2114b7;p=elisp%2Fflim.git diff --git a/ntlm.el b/ntlm.el index 399cb1a..7b2182b 100644 --- a/ntlm.el +++ b/ntlm.el @@ -63,6 +63,7 @@ ;;; Code: +(require 'poem) (require 'md4) ;;; @@ -81,7 +82,6 @@ is not given." (request-flags (concat (make-string 1 7) (make-string 1 178) (make-string 2 0))) ;0x07 0xb2 0x00 0x00 - (request-bufIndex 0) lu ld off-d off-u) (when (string-match "@" user) (unless domain @@ -112,18 +112,15 @@ the NTLM based server for the user USER and the password hash list PASSWORD-HASHES. NTLM uses two hash values which are represented by PASSWORD-HASHES. PASSWORD-HASHES should be a return value of (list (smb-passwd-hash password) (ntlm-md4hash password))" - (let* ((rchallenge (if (functionp 'string-as-unibyte) - (string-as-unibyte challenge) - challenge)) + (let* ((rchallenge (string-as-unibyte challenge)) ;; get fields within challenge struct - (ident (substring rchallenge 0 8)) ;ident, 8 bytes - (msgType (substring rchallenge 8 12)) ;msgType, 4 bytes + ;;(ident (substring rchallenge 0 8)) ;ident, 8 bytes + ;;(msgType (substring rchallenge 8 12)) ;msgType, 4 bytes (uDomain (substring rchallenge 12 20)) ;uDomain, 8 bytes (flags (substring rchallenge 20 24)) ;flags, 4 bytes (challengeData (substring rchallenge 24 32)) ;challengeData, 8 bytes uDomain-len uDomain-offs ;; response struct and its fields - response lmRespData ;lmRespData, 24 bytes ntRespData ;ntRespData, 24 bytes domain ;ascii domain string @@ -229,8 +226,7 @@ little-endian utf16." utf)) (defun ntlm-unicode2ascii (str len) - "Extract 7 bits ASCII part of a little endian utf16 string STR of length -LEN." + "Extract 7 bits ASCII part of a little endian utf16 string STR of length LEN." (let ((buf (make-string len 0)) (i 0) (j 0)) (while (< i len) (aset buf i (logand (aref str j) 127)) ;(string-to-number "7f" 16)