From: okada Date: Mon, 22 Nov 1999 16:34:44 +0000 (+0000) Subject: * smtp.el (smtp-auth-cram-md5): Update to delete X-Git-Tag: slim-1_13_2~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3d1f6403ac7d9d408252f79a187925cf2c41b928;p=elisp%2Fflim.git * smtp.el (smtp-auth-cram-md5): Update to delete insecure sequences at plain. (smtp-auth-login): Update to delete insecure sequences at plain. --- diff --git a/ChangeLog b/ChangeLog index c274c19..1c0cb7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 1999-10-23 Kenichi OKADA + * smtp.el (smtp-auth-cram-md5): Update to delete + insecure sequences at plain. + (smtp-auth-login): Update to delete + insecure sequences at plain. + +1999-10-23 Kenichi OKADA + * smtp.el (smtp-auth-cram-md5): New function. (smtp-auth-plain): New function. (smtp-auth-login): New function. diff --git a/smtp.el b/smtp.el index 4c378c7..9fcad89 100644 --- a/smtp.el +++ b/smtp.el @@ -471,7 +471,8 @@ don't define this value." (kill-buffer smtp-address-buffer)))) (defun smtp-auth-cram-md5 (process) - (let (response) + (let ((secure-word (copy-sequence smtp-authentication-passphrase)) + response) (smtp-send-command process "AUTH CRAM-MD5") (setq response (smtp-read-response process)) (if (or (null (car response)) @@ -480,11 +481,16 @@ don't define this value." (throw 'done (car (cdr response)))) (smtp-send-command process - (base64-encode-string - (sasl-cram-md5 - smtp-authentication-user smtp-authentication-passphrase - (base64-decode-string - (substring (car (cdr response)) 4))))) + (setq secure-word (unwind-protect + (sasl-cram-md5 + smtp-authentication-user secure-word + (base64-decode-string + (substring (car (cdr response)) 4))) + (fillarray secure-word 0)) + secure-word (unwind-protect + (base64-encode-string secure-word) + (fillarray secure-word 0)))) + (fillarray secure-word 0) (setq response (smtp-read-response process)) (if (or (null (car response)) (not (integerp (car response))) @@ -492,28 +498,29 @@ don't define this value." (throw 'done (car (cdr response)))))) (defun smtp-auth-plain (process) - (let ((enc-word (copy-sequence smtp-authentication-passphrase)) + (let ((secure-word (copy-sequence smtp-authentication-passphrase)) response) (smtp-send-command process - (setq enc-word (unwind-protect - (sasl-plain "" smtp-authentication-user enc-word) - (fillarray enc-word 0)) - enc-word (unwind-protect - (base64-encode-string enc-word) - (fillarray enc-word 0)) - enc-word (unwind-protect - (concat "AUTH PLAIN " enc-word) - (fillarray enc-word 0)))) - (fillarray enc-word 0)) - (setq response (smtp-read-response process)) - (if (or (null (car response)) - (not (integerp (car response))) - (>= (car response) 400)) - (throw 'done (car (cdr response))))) + (setq secure-word (unwind-protect + (sasl-plain "" smtp-authentication-user secure-word) + (fillarray secure-word 0)) + secure-word (unwind-protect + (base64-encode-string secure-word) + (fillarray secure-word 0)) + secure-word (unwind-protect + (concat "AUTH PLAIN " secure-word) + (fillarray secure-word 0)))) + (fillarray secure-word 0) + (setq response (smtp-read-response process)) + (if (or (null (car response)) + (not (integerp (car response))) + (>= (car response) 400)) + (throw 'done (car (cdr response)))))) (defun smtp-auth-login (process) - (let (response) + (let ((secure-word (copy-sequence smtp-authentication-passphrase)) + response) (smtp-send-command process (concat "AUTH LOGIN " smtp-authentication-user)) @@ -524,7 +531,10 @@ don't define this value." (throw 'done (car (cdr response)))) (smtp-send-command process - (base64-encode-string smtp-authentication-passphrase)) + (setq secure-word (unwind-protect + (base64-encode-string secure-word) + (fillarray secure-word 0)))) + (fillarray secure-word 0) (setq response (smtp-read-response process)) (if (or (null (car response)) (not (integerp (car response)))