+2007-02-19 Daiki Ueno <ueno@unixuser.org>
+
+ * mime-edit.el (mime-edit-sign-pgp-mime): Create a signature for
+ binary document.
+
2006-12-02 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* mime-edit.el (mime-edit-process-multipart-1): Don't insert a
(encoding (nth 1 ret))
(pgp-boundary (concat "pgp-sign-" boundary))
(context (epg-make-context))
- signature micalg)
+ (index 0)
+ plain signature micalg)
(mime-edit-delete-trailing-whitespace) ; RFC3156
(goto-char beg)
(insert (format "Content-Type: %s\n" ctype))
(insert (format "Content-Transfer-Encoding: %s\n" encoding)))
(insert "\n")
(epg-context-set-armor context t)
- (epg-context-set-textmode context t)
+ (epg-context-set-textmode context nil)
(if mime-edit-pgp-verbose
(epg-context-set-signers
context
(mapcar (lambda (name)
(car (epg-list-keys context name t)))
mime-edit-pgp-signers))))
+ (setq plain (buffer-substring (point-min) (point-max)))
+ (while (string-match "\r?\n" plain index)
+ (if (eq (aref plain (match-beginning 0)) ?\r)
+ (setq index (match-end 0))
+ (setq plain (replace-match "\r\n" t t plain)
+ index (1+ (match-end 0)))))
(condition-case error
(setq signature
- (epg-sign-string context
- (buffer-substring (point-min) (point-max))
- 'detached))
+ (epg-sign-string context plain 'detached))
(error (signal 'mime-edit-error (cdr error))))
(setq micalg (epg-new-signature-digest-algorithm
(car (epg-context-result-for context 'sign))))