From: okada Date: Fri, 16 Feb 2001 19:02:46 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: slim-1_14_6-0217~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=93deec7a3fd495543171abe75cbe64f8fb57e42f;p=elisp%2Fflim.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index 0404e55..e674389 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2001-02-17 Kenichi OKADA + * sasl-scram.el(sasl-scram-md5-parse-server-msg-1): Error + if server's response cannot be parsed. + +2001-02-17 Kenichi OKADA + * sasl-scram.el(sasl-scram-md5-server-salt): New function. (sasl-scram-md5-response-2): Use `sasl-scram-md5-server-salt' diff --git a/sasl-scram.el b/sasl-scram.el index 708fd9c..bcd46a9 100644 --- a/sasl-scram.el +++ b/sasl-scram.el @@ -122,12 +122,13 @@ If AUTHORIZE-ID is the same as AUTHENTICATE-ID, it may be omitted." (defun sasl-scram-md5-parse-server-msg-1 (server-msg-1) "Parse SERVER-MSG-1 and return a list of (SALT SECURITY-INFO SERVICE-ID)." - (when (and (> (length server-msg-1) 16) - (eq (string-match "[^@]+@[^\0]+\0" server-msg-1 12) 12)) - (list (substring server-msg-1 0 8) ; salt - (substring server-msg-1 8 12) ; server-security-info - (substring server-msg-1 ; service-id - 12 (1- (match-end 0)))))) + (if (and (> (length server-msg-1) 16) + (eq (string-match "[^@]+@[^\0]+\0" server-msg-1 12) 12)) + (list (substring server-msg-1 0 8) ; salt + (substring server-msg-1 8 12) ; server-security-info + (substring server-msg-1 ; service-id + 12 (1- (match-end 0)))) + (sasl-error (format "Unexpected response: %s" server-msg-1)))) (defun sasl-scram-md5-server-salt (server-msg-1) (car (sasl-scram-md5-parse-server-msg-1 server-msg-1)))