mml2015: Make sure to insert newline after the signed data
authorDaiki Ueno <ueno@gnu.org>
Wed, 22 May 2013 07:18:05 +0000 (16:18 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 22 May 2013 07:18:05 +0000 (16:18 +0900)
* mml2015.el (mml2015-epg-sign): Make sure to insert newline after the
signed data to conform the standard.  (Bug#14232)

lisp/ChangeLog
lisp/mml2015.el

index 4212f43..8456311 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-22  Daiki Ueno  <ueno@gnu.org>
+
+       * mml2015.el (mml2015-epg-sign): Make sure to insert newline after the
+       signed data to conform the standard.  (Bug#14232)
+
 2013-05-20  Adam Sjøgren  <asjo@koldfront.dk>
 
        * gnus-spec.el (gnus-parse-complex-format): Use unicode escape for left
index c3905b8..5d122df 100644 (file)
@@ -1085,6 +1085,10 @@ If no one is selected, default secret key is used.  "
        (epg-context-set-passphrase-callback
         context
         #'mml2015-epg-passphrase-callback))
+    ;; Signed data must end with a newline (RFC 3156, 5).
+    (goto-char (point-max))
+    (unless (bolp)
+      (insert "\n"))
     (condition-case error
        (setq signature (epg-sign-string context (buffer-string) t)
              mml2015-epg-secret-key-id-list nil)