Commit 9e673321 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(pgg-pgp5-encrypt-region, pgg-pgp5-decrypt-region)

(pgg-pgp5-encrypt-symmetric-region, pgg-pgp5-encrypt-symmetric)
(pgg-pgp5-encrypt, pgg-pgp5-decrypt-region, pgg-pgp5-decrypt)
(pgg-pgp5-sign-region, pgg-pgp5-sign): Add optional 'passphrase'
argument to all these routines, so the passphrase can be managed
externally and passed in to the system.
(pgg-pgp5-sign-region): Use new name of	pgg-add-passphrase-to-cache
function.
parent c6037c00
2005-11-04 Ken Manheimer <ken.manheimer@gmail.com>
* pgg-pgp.el (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region)
(pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
(pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
(pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase'
argument to all these routines, so the passphrase can be managed
externally and passed in to the system.
(pgg-pgp-decrypt-region, pgg-pgp-sign-region): Use new name for
pgg-add-passphrase-to-cache function.
* pgg-pgp5.el (pgg-pgp5-encrypt-region, pgg-pgp5-decrypt-region)
(pgg-pgp5-encrypt-symmetric-region, pgg-pgp5-encrypt-symmetric)
(pgg-pgp5-encrypt, pgg-pgp5-decrypt-region, pgg-pgp5-decrypt)
(pgg-pgp5-sign-region, pgg-pgp5-sign): Add optional 'passphrase'
argument to all these routines, so the passphrase can be managed
externally and passed in to the system.
(pgg-pgp5-sign-region): Use new name of pgg-add-passphrase-to-cache
function.
2005-11-04 Edward O'Connor <hober0@gmail.com> (tiny change)
 
* net/goto-addr.el (goto-address-url-regexp): Remove `data:' URLs
......
......@@ -143,41 +143,51 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
(buffer-substring (match-end 0)(progn (end-of-line)(point)))))
2)))))
(defun pgg-pgp5-encrypt-region (start end recipients &optional sign)
(defun pgg-pgp5-encrypt-region (start end recipients &optional sign passphrase)
"Encrypt the current region between START and END."
(let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
(passphrase (or passphrase
(when sign
(pgg-read-passphrase
(format "PGP passphrase for %s: "
pgg-pgp5-user-id)
pgg-pgp5-user-id))))
(args
`("+NoBatchInvalidKeys=off" "-fat" "+batchmode=1"
,@(if recipients
(apply #'append
(mapcar (lambda (rcpt)
(list "-r"
(concat "\"" rcpt "\"")))
(append recipients
(if pgg-encrypt-for-me
(list pgg-pgp5-user-id)))))))))
(append
`("+NoBatchInvalidKeys=off" "-fat" "+batchmode=1"
,@(if recipients
(apply #'append
(mapcar (lambda (rcpt)
(list "-r"
(concat "\"" rcpt "\"")))
(append recipients
(if pgg-encrypt-for-me
(list pgg-pgp5-user-id)))))))
(if sign '("-s" "-u" pgg-pgp5-user-id)))))
(pgg-pgp5-process-region start end nil pgg-pgp5-pgpe-program args)
(pgg-process-when-success nil)))
(defun pgg-pgp5-decrypt-region (start end)
(defun pgg-pgp5-decrypt-region (start end &optional passphrase)
"Decrypt the current region between START and END."
(let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
(passphrase
(pgg-read-passphrase
(format "PGP passphrase for %s: " pgg-pgp5-user-id)
(pgg-pgp5-lookup-key pgg-pgp5-user-id 'encrypt)))
(or passphrase
(pgg-read-passphrase
(format "PGP passphrase for %s: " pgg-pgp5-user-id)
(pgg-pgp5-lookup-key pgg-pgp5-user-id 'encrypt))))
(args
'("+verbose=1" "+batchmode=1" "+language=us" "-f")))
(pgg-pgp5-process-region start end passphrase pgg-pgp5-pgpv-program args)
(pgg-process-when-success nil)))
(defun pgg-pgp5-sign-region (start end &optional clearsign)
(defun pgg-pgp5-sign-region (start end &optional clearsign passphrase)
"Make detached signature from text between START and END."
(let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
(passphrase
(pgg-read-passphrase
(format "PGP passphrase for %s: " pgg-pgp5-user-id)
(pgg-pgp5-lookup-key pgg-pgp5-user-id 'sign)))
(or passphrase
(pgg-read-passphrase
(format "PGP passphrase for %s: " pgg-pgp5-user-id)
(pgg-pgp5-lookup-key pgg-pgp5-user-id 'sign))))
(args
(list (if clearsign "-fat" "-fbat")
"+verbose=1" "+language=us" "+batchmode=1"
......@@ -191,7 +201,7 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
(point))
(point-max))))))
(if pgg-cache-passphrase
(pgg-add-passphrase-cache
(pgg-add-passphrase-to-cache
(cdr (assq 'key-identifier packet))
passphrase)))))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment