X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fcanlock.el;h=cb88eed0a5f430e9f9777abe07cfb4a2de45ac2c;hb=8047583c8c86a5c6a61bddc27b391042e39e1ce5;hp=ef62579dde16e397bec4d293b3998c9ed76fbd24;hpb=3c985cb96ceca73017981fbaf2f5fdddd7bac31d;p=elisp%2Fgnus.git- diff --git a/lisp/canlock.el b/lisp/canlock.el index ef62579..cb88eed 100644 --- a/lisp/canlock.el +++ b/lisp/canlock.el @@ -1,7 +1,7 @@ ;;; canlock.el --- functions for Cancel-Lock feature ;; Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004 -;; Free Software Foundation, Inc. +;; Free Software Foundation, Inc. ;; Author: Katsumi Yamaoka ;; Keywords: news, cancel-lock, hmac, sha1, rfc2104 @@ -44,10 +44,8 @@ (eval-when-compile (require 'cl)) -(autoload 'sha1 "sha1-el") -(autoload 'sha1-binary "sha1-el") -(autoload 'base64-encode-string "base64") -(autoload 'mail-fetch-field "mail-utils") +(require 'sha1) + (defvar mail-header-separator) (defgroup canlock nil @@ -82,8 +80,9 @@ buffer does not look like a news message." (defun canlock-sha1 (message) "Make a SHA-1 digest of MESSAGE as a unibyte string of length 20 bytes." (condition-case nil - (sha1 message nil nil 'binary) - (error + (let (sha1-maximum-internal-length) + (sha1 message nil nil 'binary)) + (wrong-number-of-arguments (canlock-string-as-unibyte (sha1-binary message))))) (defun canlock-make-cancel-key (message-id password) @@ -163,9 +162,8 @@ message." (unless id-for-key (setq id-for-key (canlock-fetch-id-for-key))) (if (and (setq control (mail-fetch-field "Control")) - (string-match - "^cancel[\t ]+\\(<[^\t\n @<>]+@[^\t\n @<>]+>\\)" - control)) + (string-match "^cancel[\t ]+<[^\t\n @<>]+@[^\t\n @<>]+>" + control)) (setq id-for-lock nil) (unless id-for-lock (setq id-for-lock (mail-fetch-field "Message-ID"))))