Gnus development mailing list
 help / color / mirror / Atom feed
* pgp/mime encryption with specified public-key
@ 2002-01-18  6:29 Karra
  2002-01-18 11:55 ` Simon Josefsson
  0 siblings, 1 reply; 2+ messages in thread
From: Karra @ 2002-01-18  6:29 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 436 bytes --]


[ using mailcrypt 3.5.5 ]   

By default, the public keys that are looked up are the based on the
recipient email ids in the message.  I want to specify another key
instead (say because I am sending a message to a friend who uses the
same gpg key pair on different acounts).  If there is a legit way of
doing this, pray explain it and ignore the rest of this mail.

As I could not get to do the above, I executed the following patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: message.diff --]
[-- Type: text/x-patch, Size: 355 bytes --]

--- message.el.old	Fri Jan 18 11:27:41 2002
+++ message.el	Fri Jan 18 11:27:45 2002
@@ -2573,7 +2573,7 @@
 	(success t)
 	elem sent dont-barf-on-no-method
 	(message-options message-options))
-    (message-options-set-recipient)
+;    (message-options-set-recipient)
     (while (and success
 		(setq elem (pop alist)))
       (when (funcall (cadr elem))

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]


Now, when I C-c C-c a message, I was queried for a list of
recipients.  I entered one word : "rajiv" and I was greeted by the
following backtrace:


[-- Attachment #4: Type: text/plain, Size: 5011 bytes --]

  signal(error ("mc-encrypt-generic: recipients not string or nil"))
  error("mc-encrypt-generic: recipients not string or nil")
  mc-encrypt-generic(("rajiv") nil nil nil nil)
  (let (default-enable-multibyte-characters) (mc-encrypt-generic (or ... ...) nil nil nil (message-options-get ...)))
  (if mm-mule4-p (let (... ...) (unwind-protect ... ... ...)) (let (default-enable-multibyte-characters) (mc-encrypt-generic ... nil nil nil ...)))
  (mm-with-unibyte-current-buffer-mule4 (mc-encrypt-generic (or ... ...) nil nil nil (message-options-get ...)))
  (let ((mc-pgp-always-sign ...)) (mm-with-unibyte-current-buffer-mule4 (mc-encrypt-generic ... nil nil nil ...)))
  mml2015-mailcrypt-encrypt((part (encrypt . "pgpmime") (tag-location . 358) (contents . "\n;alskdf;lsakf\n\n-- \n\"Have you ever fought an IDEA, Picard?\"\n      -- Gowron, Star Trek TNG.\n")))
  mml2015-encrypt((part (encrypt . "pgpmime") (tag-location . 358) (contents . "\n;alskdf;lsakf\n\n-- \n\"Have you ever fought an IDEA, Picard?\"\n      -- Gowron, Star Trek TNG.\n")))
  mml-pgpmime-encrypt-buffer((part (encrypt . "pgpmime") (tag-location . 358) (contents . "\n;alskdf;lsakf\n\n-- \n\"Have you ever fought an IDEA, Picard?\"\n      -- Gowron, Star Trek TNG.\n")))
  mml-generate-mime-1((part (encrypt . "pgpmime") (tag-location . 358) (contents . "\n;alskdf;lsakf\n\n-- \n\"Have you ever fought an IDEA, Picard?\"\n      -- Gowron, Star Trek TNG.\n")))
  mml-generate-mime()
  (let ((new ...)) (when new (delete-region ... ...) (insert new) (goto-char ...) (if ... ... ... ... ...)))
  (save-restriction (narrow-to-region (point) (point-max)) (let (...) (when new ... ... ... ...)))
  (let ((mail-parse-charset ...) (case-fold-search t) lines content-type-p) (message-goto-body) (save-restriction (narrow-to-region ... ...) (let ... ...)) (save-restriction (message-narrow-to-headers-or-head) (message-remove-header "Mime-Version") (goto-char ...) (insert "MIME-Version: 1.0\n") (when lines ...) (setq content-type-p ...)) (save-restriction (message-narrow-to-headers-or-head) (message-remove-first-header "Content-Type") (message-remove-first-header "Content-Transfer-Encoding")) (unless content-type-p (goto-char ...) (when ... ... ...)))
  (if message-inhibit-body-encoding nil (let (... ... lines content-type-p) (message-goto-body) (save-restriction ... ...) (save-restriction ... ... ... ... ... ...) (save-restriction ... ... ...) (unless content-type-p ... ...)))
  (unless message-inhibit-body-encoding (let (... ... lines content-type-p) (message-goto-body) (save-restriction ... ...) (save-restriction ... ... ... ... ... ...) (save-restriction ... ... ...) (unless content-type-p ... ...)))
  message-encode-message-body()
  (save-excursion (set-buffer tembuf) (erase-buffer) (insert (with-current-buffer mailbuf ...)) (message-encode-message-body) (save-restriction (message-narrow-to-headers) (when ... ...) (message-remove-header message-ignored-mail-headers t) (let ... ...)) (goto-char (point-max)) (or (= ... 10) (insert 10)) (when (save-restriction ... ...) (message-insert-courtesy-copy)) (if (or ... ... ...) (mm-with-unibyte-current-buffer ... ...) (message-send-mail-partially)))
  (unwind-protect (save-excursion (set-buffer tembuf) (erase-buffer) (insert ...) (message-encode-message-body) (save-restriction ... ... ... ...) (goto-char ...) (or ... ...) (when ... ...) (if ... ... ...)) (kill-buffer tembuf))
  (let* ((tembuf ...) (case-fold-search nil) (news ...) (mailbuf ...) (message-this-is-mail t) (message-posting-charset ...) (headers message-required-mail-headers)) (save-restriction (message-narrow-to-headers) (if ... ... ...) (let ... ...) (run-hooks ...)) (unwind-protect (save-excursion ... ... ... ... ... ... ... ... ...) (kill-buffer tembuf)) (set-buffer mailbuf) (push (quote mail) message-sent-message-via))
  message-send-mail(nil)
  message-send-via-mail(nil)
  funcall(message-send-via-mail nil)
  (setq success (funcall (caddr elem) arg))
  (and (or (not ...) (if ... ... ...)) (setq success (funcall ... arg)))
  (if (and (or ... ...) (setq success ...)) (progn (setq sent t)))
  (when (and (or ... ...) (setq success ...)) (setq sent t))
  (progn (when (and ... ...) (setq sent t)))
  (if (funcall (cadr elem)) (progn (when ... ...)))
  (when (funcall (cadr elem)) (when (and ... ...) (setq sent t)))
  (while (and success (setq elem ...)) (when (funcall ...) (when ... ...)))
  (let ((alist message-send-method-alist) (success t) elem sent dont-barf-on-no-method (message-options message-options)) (while (and success ...) (when ... ...)) (unless (or sent ... ...) (error "No methods specified to send by")) (when (or dont-barf-on-no-method ...) (message-do-fcc) (save-excursion ...) (message "Sending...done") (set-buffer-modified-p nil) (delete-auto-save-file-if-necessary t) (message-disassociate-draft) (message-do-send-housekeeping) (message-do-actions message-send-actions) t))
  message-send(nil)
  message-send-and-exit(nil)
  call-interactively(message-send-and-exit)

[-- Attachment #5: Type: text/plain, Size: 559 bytes --]


It appears the problem is because mailcrypt expects a single string
of comma separated id, but it was given a list -- because
message-recipients is a list.

It is interesting to note that using the above patch, vanilla pgp
encryption works, as in I get queried for a list of recipients and the
corresponding public keys are fetched etc.  Perhaps, this is because
mml2015-mailcrypt-encrypt is invoked more than once on a message, but
mml1991-mailcrypt-encrypt is invoked only once.

-- 
"Have you ever fought an IDEA, Picard?"
      -- Gowron, Star Trek TNG.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: pgp/mime encryption with specified public-key
  2002-01-18  6:29 pgp/mime encryption with specified public-key Karra
@ 2002-01-18 11:55 ` Simon Josefsson
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Josefsson @ 2002-01-18 11:55 UTC (permalink / raw)
  Cc: ding

Karra <karra@cs.utah.edu> writes:

> By default, the public keys that are looked up are the based on the
> recipient email ids in the message.  I want to specify another key
> instead (say because I am sending a message to a friend who uses the
> same gpg key pair on different acounts).  If there is a legit way of
> doing this, pray explain it and ignore the rest of this mail.

You can specify a `recipients' tag in the MML tag:

To: bob@example.org
...
<#part sign=pgpmime recipients=alice@example.org>

It will be encrypted to alice but sent to bob.

There should be key and menu bindings for this, and documentation in
english instead of elisp.  Maybe tonight.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-18 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-18  6:29 pgp/mime encryption with specified public-key Karra
2002-01-18 11:55 ` Simon Josefsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).