(t (y-or-n-p
(format "Decrypt (S/MIME) part? "))))
(mm-view-pkcs7 parts from))
+ (goto-char (point-min))
+ (insert "Content-type: text/plain\n\n")
(setq parts (mm-dissect-buffer t)))))
((equal subtype "signed")
(unless (and (setq protocol
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-details
(format "Unknown encrypt protocol (%s)" protocol)))))))
+ ;; Check the results (which are now in `parts').
(let ((info (get-text-property 0 'gnus-info (car mm-security-handle))))
(if (or (not info)
(equal info "")
(mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m")
(insert-buffer-substring (mm-handle-buffer handle))
(setq verified (smime-verify-region (point-min) (point-max))))
- (goto-char (point-min))
- (mm-insert-part handle)
- (if (search-forward "Content-Type: " nil t)
- (delete-region (point-min) (match-beginning 0)))
- (goto-char (point-max))
- (if (re-search-backward "--\r?\n?" nil t)
- (delete-region (match-end 0) (point-max)))
- (unless verified
+ (if verified
+ (insert verified)
(insert-buffer-substring smime-details-buffer)))
- (goto-char (point-min))
- (while (search-forward "\r\n" nil t)
- (replace-match "\n"))
t)
(autoload 'epg-decrypt-string "epg")
(expand-file-name smime-CA-file)))
(if smime-CA-directory
(list "-CApath"
- (expand-file-name smime-CA-directory))))))
+ (expand-file-name smime-CA-directory)))))
+ (input-buffer (current-buffer)))
(unless CAs
(error "No CA configured"))
(if smime-crl-check
(cl-pushnew smime-crl-check CAs :test #'equal))
- (if (apply 'smime-call-openssl-region b e (list smime-details-buffer t)
- "smime" "-verify" "-out" "/dev/null" CAs)
- t
- (insert-buffer-substring smime-details-buffer)
- nil)))
+ (with-temp-buffer
+ (let ((result-buffer (current-buffer)))
+ (with-current-buffer input-buffer
+ (if (apply 'smime-call-openssl-region b e (list result-buffer
+ smime-details-buffer)
+ "smime" "-verify" "-out" "-" CAs)
+ (with-current-buffer result-buffer
+ (buffer-string))
+ nil))))))
(defun smime-noverify-region (b e)
"Verify integrity of S/MIME message in region between B and E.