diff options
author | Reiner Steib <Reiner.Steib@gmx.de> | 2006-03-21 21:24:27 +0000 |
---|---|---|
committer | Reiner Steib <Reiner.Steib@gmx.de> | 2006-03-21 21:24:27 +0000 |
commit | 7b97a7a56cafd4d955039c38e5cdfc3868488356 (patch) | |
tree | 9f22ff1ec2a5a432815e16d8f2bf9bf4727e70c5 /lisp/pgg-gpg.el | |
parent | 6c3ba92180c2195d109f52f3c9654c749f3cd645 (diff) | |
download | emacs-7b97a7a56cafd4d955039c38e5cdfc3868488356.tar.gz |
Sync with version from Gnus (only whitespace changes).
Diffstat (limited to 'lisp/pgg-gpg.el')
-rw-r--r-- | lisp/pgg-gpg.el | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/lisp/pgg-gpg.el b/lisp/pgg-gpg.el index 28512dce8fc..a9608b7f4f2 100644 --- a/lisp/pgg-gpg.el +++ b/lisp/pgg-gpg.el @@ -163,24 +163,22 @@ Optional ALL non-nil means search all keys, including secret keys." (let ((args (list "--with-colons" "--no-greeting" "--batch" (if all "--list-secret-keys" "--list-keys") string)) - (key-regexp (concat "^\\(sec\\|pub\\)" - ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):[^:]*" - ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):")) - ) + (key-regexp (concat "^\\(sec\\|pub\\)" + ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):[^:]*" + ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):"))) (with-temp-buffer (apply #'call-process pgg-gpg-program nil t nil args) (goto-char (point-min)) (if (re-search-forward key-regexp - nil t) - (match-string 3))))) + nil t) + (match-string 3))))) (defun pgg-gpg-key-id-from-key-owner (key-owner) (cond ((not key-owner) nil) - ;; Extract bare key id from outermost paired angle brackets, if any: - ((string-match "[^<]*<\\(.+\\)>[^>]*" key-owner) - (substring key-owner (match-beginning 1)(match-end 1))) - (key-owner)) - ) + ;; Extract bare key id from outermost paired angle brackets, if any: + ((string-match "[^<]*<\\(.+\\)>[^>]*" key-owner) + (substring key-owner (match-beginning 1)(match-end 1))) + (key-owner))) (defun pgg-gpg-encrypt-region (start end recipients &optional sign passphrase) "Encrypt the current region between START and END. @@ -242,15 +240,15 @@ passphrase cache or user." (insert-buffer-substring current-buffer) (pgg-decode-armor-region (point-min) (point-max)))) (secret-keys (pgg-gpg-lookup-all-secret-keys)) - ;; XXX the user is stuck if they need to use the passphrase for - ;; any but the first secret key for which the message is - ;; encrypted. ideally, we would incrementally give them a - ;; chance with subsequent keys each time they fail with one. + ;; XXX the user is stuck if they need to use the passphrase for + ;; any but the first secret key for which the message is + ;; encrypted. ideally, we would incrementally give them a + ;; chance with subsequent keys each time they fail with one. (key (pgg-gpg-select-matching-key message-keys secret-keys)) - (key-owner (and key (pgg-gpg-lookup-key-owner key t))) + (key-owner (and key (pgg-gpg-lookup-key-owner key t))) (key-id (pgg-gpg-key-id-from-key-owner key-owner)) (pgg-gpg-user-id (or key-id key - pgg-gpg-user-id pgg-default-user-id)) + pgg-gpg-user-id pgg-default-user-id)) (passphrase (or passphrase (when (not pgg-gpg-use-agent) (pgg-read-passphrase @@ -280,7 +278,7 @@ passphrase cache or user." (loop for message-key in message-keys for message-key-id = (and (equal (car message-key) 1) (cdr (assq 'key-identifier - (cdr message-key)))) + (cdr message-key)))) for key = (and message-key-id (pgg-lookup-key message-key-id 'encrypt)) when (and key (member key secret-keys)) return key)) |