* canlock.el (canlock): Change the parent group to news.
[gnus] / lisp / canlock.el
index f291706..126ec0c 100644 (file)
@@ -1,7 +1,7 @@
 ;;; canlock.el --- functions for Cancel-Lock feature
 
-;; Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2005
+;;        Free Software Foundation, Inc.
 
 ;; Author: Katsumi Yamaoka <yamaoka@jpl.org>
 ;; Keywords: news, cancel-lock, hmac, sha1, rfc2104
 (eval-when-compile
   (require 'cl))
 
-(autoload 'sha1 "sha1-el")
-(autoload 'base64-encode-string "base64")
-(autoload 'mail-fetch-field "mail-utils")
+(require 'sha1)
+
 (defvar mail-header-separator)
 
 (defgroup canlock nil
   "The Cancel-Lock feature."
-  :group 'applications)
+  :group 'news)
 
 (defcustom canlock-password nil
   "Password to use when signing a Cancel-Lock or a Cancel-Key header."
   :type '(radio (const :format "Not specified " nil)
-               (string :tag "Password" :size 0))
+               (string :tag "Password"))
   :group 'canlock)
 
 (defcustom canlock-password-for-verify canlock-password
   "Password to use when verifying a Cancel-Lock or a Cancel-Key header."
   :type '(radio (const :format "Not specified " nil)
-               (string :tag "Password" :size 0))
+               (string :tag "Password"))
   :group 'canlock)
 
 (defcustom canlock-force-insert-header nil
@@ -80,7 +79,8 @@ 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."
-  (sha1 message nil nil 'binary))
+  (let (sha1-maximum-internal-length)
+    (sha1 message nil nil 'binary)))
 
 (defun canlock-make-cancel-key (message-id password)
   "Make a Cancel-Key header."
@@ -159,9 +159,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"))))
@@ -248,4 +247,5 @@ it fails."
 
 (provide 'canlock)
 
+;;; arch-tag: 033c4f09-b9f1-459d-bd0d-254430283f78
 ;;; canlock.el ends here