From f71e7bdf4555b19c26514cc0040a0ab704fe93e0 Mon Sep 17 00:00:00 2001 From: okada Date: Thu, 18 Nov 1999 20:21:20 +0000 Subject: [PATCH] fixed hmac-md5 for XEmacs's md5. --- ChangeLog | 8 +++++++- hmac-md5.el | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb6e74c..e8e6c0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 1999-10-19 Kenichi OKADA + * hmac-md5.el (hmac-md5): fixed for XEmacs's md5. + +1999-10-19 Kenichi OKADA + * md5.el: New file. (import from hmac package) * md5-el.el: New file. (import from hmac package) * md5-dl.el: New file. (import from hmac package) @@ -10,6 +14,8 @@ * hmac-util.el: New file. (import from hmac package) * hmac-md5.el: New file. (import from hmac package) * hmac-sha1.el: New file. (import from hmac package) + * FLIM-ELS (flim-modules): Add `md5 md5-el md5-dl sha1 sha1-el + sha1-dl hmac-def hmac-util hmac-md5 hmac-sha1'. 1999-10-19 Kenichi OKADA @@ -19,7 +25,7 @@ 1999-10-19 Kenichi OKADA * sasl.el: New file. - * smtp.el: (smtp-via-smtp): Use sasl.el for SASL. + * smtp.el (smtp-via-smtp): Use sasl.el for SASL. * FLIM-ELS (flim-modules): Add `sasl'. 1999-08-17 MORIOKA Tomohiko diff --git a/hmac-md5.el b/hmac-md5.el index e1b37aa..9469cef 100644 --- a/hmac-md5.el +++ b/hmac-md5.el @@ -63,7 +63,22 @@ (eval-when-compile (require 'hmac-def)) (require 'md5) ; expects (md5 STRING) -(define-hmac-function hmac-md5 md5 64 16) ; => (hmac-md5 TEXT KEY) +(cond + ((and (fboundp 'md5) + (subrp (symbol-function 'md5))) + ;; recent XEmacs has `md5' as a built-in function. + ;; and default CODING is 'undecided. + ;; + (define-hmac-function hmac-md5 + (lambda + (object &optional start end) + (md5 object start end 'binary)) 64 16) + ) + (t + (define-hmac-function hmac-md5 md5 64 16) + )) +; => (hmac-md5 TEXT KEY) + ;; (define-hmac-function hmac-md5-96 md5 64 16 96) ;; => (hmac-md5-96 TEXT KEY) -- 1.7.10.4