123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- (require 'sasl)
- (require 'hmac-md5)
- (defconst sasl-cram-md5-steps
- '(ignore ;no initial response
- sasl-cram-md5-response))
- (defun sasl-cram-md5-response (client step)
- (let ((passphrase
- (sasl-read-passphrase
- (format "CRAM-MD5 passphrase for %s: "
- (sasl-client-name client)))))
- (unwind-protect
- (concat (sasl-client-name client) " "
- (encode-hex-string
- (hmac-md5 (sasl-step-data step) passphrase)))
- (fillarray passphrase 0))))
- (put 'sasl-cram 'sasl-mechanism
- (sasl-make-mechanism "CRAM-MD5" sasl-cram-md5-steps))
- (provide 'sasl-cram)
|