Function: sasl-digest-md5-response-value

sasl-digest-md5-response-value is a byte-compiled function defined in sasl-digest.el.gz.

Signature

(sasl-digest-md5-response-value USERNAME REALM NONCE CNONCE NONCE-COUNT QOP DIGEST-URI AUTHZID)

Source Code

;; Defined in /usr/src/emacs/lisp/net/sasl-digest.el.gz
(defun sasl-digest-md5-response-value (username
				       realm
				       nonce
				       cnonce
				       nonce-count
				       qop
				       digest-uri
				       authzid)
  (let ((passphrase
	 (sasl-read-passphrase
	  (format "DIGEST-MD5 passphrase for %s: "
		  username))))
    (unwind-protect
	(encode-hex-string
	 (md5-binary
	  (concat
	   (encode-hex-string
	    (md5-binary (concat (md5-binary
				 (concat username ":" realm ":" passphrase))
				":" nonce ":" cnonce
				(if authzid
				    (concat ":" authzid)))))
	   ":" nonce
	   ":" (format "%08x" nonce-count) ":" cnonce ":" qop ":"
	   (encode-hex-string
	    (md5-binary
	     (concat "AUTHENTICATE:" digest-uri
		     (if (member qop '("auth-int" "auth-conf"))
			 ":00000000000000000000000000000000")))))))
      (clear-string passphrase))))