* epg.el (epg-make-verify-result): Renamed epg-signature to
epg-verify-result.
2006-04-20 Daiki Ueno <ueno@unixuser.org>
2006-04-20 Daiki Ueno <ueno@unixuser.org>
+ * epa.el (epa-select-keys): Added "Cancel" button.
+ * epg.el (epg-make-verify-result): Renamed epg-signature to
+ epg-verify-result.
+
+2006-04-20 Daiki Ueno <ueno@unixuser.org>
+
* epg.el (epg-signature-to-string): New function.
2006-04-20 Daiki Ueno <ueno@unixuser.org>
* epg.el (epg-signature-to-string): New function.
2006-04-20 Daiki Ueno <ueno@unixuser.org>
(erase-buffer)
(insert prompt "\n")
(widget-create 'link
(erase-buffer)
(insert prompt "\n")
(widget-create 'link
+ :notify (lambda (&rest ignore) (abort-recursive-edit))
+ :help-echo
+ (substitute-command-keys
+ "Click here or \\[abort-recursive-edit] to cancel")
+ "Cancel")
+ (widget-create 'link
:notify (lambda (&rest ignore) (exit-recursive-edit))
:help-echo
(substitute-command-keys
:notify (lambda (&rest ignore) (exit-recursive-edit))
:help-echo
(substitute-command-keys
(epg-verify-file context file plain)
(message "Verifying %s...done" (file-name-nondirectory file))
(message "%s"
(epg-verify-file context file plain)
(message "Verifying %s...done" (file-name-nondirectory file))
(message "%s"
- (mapconcat #'epg-signature-to-string
+ (mapconcat #'epg-verify-result-to-string
(reverse (epg-context-result-for context 'verify))
"\n"))))
(reverse (epg-context-result-for context 'verify))
"\n"))))
"Set the result of the previous cryptographic operation."
(aset context 12 result))
"Set the result of the previous cryptographic operation."
(aset context 12 result))
-(defun epg-make-signature (status key-id user-id)
- "Return a signature object."
+(defun epg-make-verify-result (status key-id user-id)
+ "Return a verify-result object."
(vector status key-id user-id nil nil))
(vector status key-id user-id nil nil))
-(defun epg-signature-status (signature)
- "Return the status code of SIGNATURE."
- (aref signature 0))
+(defun epg-verify-result-status (verify-result)
+ "Return the status code of VERIFY-RESULT."
+ (aref verify-result 0))
-(defun epg-signature-key-id (signature)
- "Return the key-id of SIGNATURE."
- (aref signature 1))
+(defun epg-verify-result-key-id (verify-result)
+ "Return the key-id of VERIFY-RESULT."
+ (aref verify-result 1))
-(defun epg-signature-user-id (signature)
- "Return the user-id of SIGNATURE."
- (aref signature 2))
+(defun epg-verify-result-user-id (verify-result)
+ "Return the user-id of VERIFY-RESULT."
+ (aref verify-result 2))
-(defun epg-signature-validity (signature)
- "Return the validity of SIGNATURE."
- (aref signature 3))
+(defun epg-verify-result-validity (verify-result)
+ "Return the validity of VERIFY-RESULT."
+ (aref verify-result 3))
-(defun epg-signature-fingerprint (signature)
- "Return the fingerprint of SIGNATURE."
- (aref signature 4))
+(defun epg-verify-result-fingerprint (verify-result)
+ "Return the fingerprint of VERIFY-RESULT."
+ (aref verify-result 4))
-(defun epg-signature-set-status (signature status)
- "Set the status code of SIGNATURE."
- (aset signature 0 status))
+(defun epg-verify-result-set-status (verify-result status)
+ "Set the status code of VERIFY-RESULT."
+ (aset verify-result 0 status))
-(defun epg-signature-set-key-id (signature key-id)
- "Set the key-id of SIGNATURE."
- (aset signature 1 key-id))
+(defun epg-verify-result-set-key-id (verify-result key-id)
+ "Set the key-id of VERIFY-RESULT."
+ (aset verify-result 1 key-id))
-(defun epg-signature-set-user-id (signature user-id)
- "Set the user-id of SIGNATURE."
- (aset signature 2 user-id))
+(defun epg-verify-result-set-user-id (verify-result user-id)
+ "Set the user-id of VERIFY-RESULT."
+ (aset verify-result 2 user-id))
-(defun epg-signature-set-validity (signature validity)
- "Set the validity of SIGNATURE."
- (aset signature 3 validity))
+(defun epg-verify-result-set-validity (verify-result validity)
+ "Set the validity of VERIFY-RESULT."
+ (aset verify-result 3 validity))
-(defun epg-signature-set-fingerprint (signature fingerprint)
- "Set the fingerprint of SIGNATURE."
- (aset signature 4 fingerprint))
+(defun epg-verify-result-set-fingerprint (verify-result fingerprint)
+ "Set the fingerprint of VERIFY-RESULT."
+ (aset verify-result 4 fingerprint))
(defun epg-make-key (owner-trust)
"Return a key object."
(defun epg-make-key (owner-trust)
"Return a key object."
"Return the name of USER-ID."
(aref user-id 1))
"Return the name of USER-ID."
(aref user-id 1))
-(defun epg-user-id-signature-list (user-id)
- "Return the signature list of USER-ID."
+(defun epg-user-id-verify-result-list (user-id)
+ "Return the verify-result list of USER-ID."
-(defun epg-user-id-set-signature-list (user-id signature-list)
- "Set the signature list of USER-ID."
- (aset user-id 2 signature-list))
+(defun epg-user-id-set-verify-result-list (user-id verify-result-list)
+ "Set the verify-result list of USER-ID."
+ (aset user-id 2 verify-result-list))
(defun epg-context-result-for (context name)
(cdr (assq name (epg-context-result context))))
(defun epg-context-result-for (context name)
(cdr (assq name (epg-context-result context))))
(setcdr entry value)
(epg-context-set-result context (cons (cons name value) result)))))
(setcdr entry value)
(epg-context-set-result context (cons (cons name value) result)))))
-(defun epg-signature-to-string (signature)
- (format "%s signature from %s %s%s"
- (capitalize (symbol-name (epg-signature-status signature)))
- (epg-signature-key-id signature)
- (epg-signature-user-id signature)
- (if (epg-signature-validity signature)
+(defun epg-verify-result-to-string (verify-result)
+ (format "%s verify-result from %s %s%s"
+ (capitalize (symbol-name (epg-verify-result-status verify-result)))
+ (epg-verify-result-key-id verify-result)
+ (epg-verify-result-user-id verify-result)
+ (if (epg-verify-result-validity verify-result)
- (epg-signature-validity signature))
+ (epg-verify-result-validity verify-result))
"")))
(defun epg-start (context args)
"")))
(defun epg-start (context args)
(epg-context-set-result-for
epg-context
'verify
(epg-context-set-result-for
epg-context
'verify
- (cons (epg-make-signature 'good
+ (cons (epg-make-verify-result 'good
(match-string 1 string)
(match-string 2 string))
(epg-context-result-for epg-context 'verify)))))
(match-string 1 string)
(match-string 2 string))
(epg-context-result-for epg-context 'verify)))))
(epg-context-set-result-for
epg-context
'verify
(epg-context-set-result-for
epg-context
'verify
- (cons (epg-make-signature 'expired
+ (cons (epg-make-verify-result 'expired
(match-string 1 string)
(match-string 2 string))
(epg-context-result-for epg-context 'verify)))))
(match-string 1 string)
(match-string 2 string))
(epg-context-result-for epg-context 'verify)))))
(epg-context-set-result-for
epg-context
'verify
(epg-context-set-result-for
epg-context
'verify
- (cons (epg-make-signature 'expired-key
+ (cons (epg-make-verify-result 'expired-key
(match-string 1 string)
(match-string 2 string))
(epg-context-result-for epg-context 'verify)))))
(match-string 1 string)
(match-string 2 string))
(epg-context-result-for epg-context 'verify)))))
(epg-context-set-result-for
epg-context
'verify
(epg-context-set-result-for
epg-context
'verify
- (cons (epg-make-signature 'revoked-key
+ (cons (epg-make-verify-result 'revoked-key
(match-string 1 string)
(match-string 2 string))
(epg-context-result-for epg-context 'verify)))))
(match-string 1 string)
(match-string 2 string))
(epg-context-result-for epg-context 'verify)))))
(epg-context-set-result-for
epg-context
'verify
(epg-context-set-result-for
epg-context
'verify
- (cons (epg-make-signature 'bad
+ (cons (epg-make-verify-result 'bad
(match-string 1 string)
(match-string 2 string))
(epg-context-result-for epg-context 'verify)))))
(defun epg-status-VALIDSIG (process string)
(match-string 1 string)
(match-string 2 string))
(epg-context-result-for epg-context 'verify)))))
(defun epg-status-VALIDSIG (process string)
- (let ((signature (car (epg-context-result-for epg-context 'verify))))
- (if (and signature
- (eq (epg-signature-status signature) 'good)
+ (let ((verify-result (car (epg-context-result-for epg-context 'verify))))
+ (if (and verify-result
+ (eq (epg-verify-result-status verify-result) 'good)
(string-match "\\`\\([^ ]+\\) " string))
(string-match "\\`\\([^ ]+\\) " string))
- (epg-signature-set-fingerprint signature (match-string 1 string)))))
+ (epg-verify-result-set-fingerprint verify-result (match-string 1 string)))))
(defun epg-status-TRUST_UNDEFINED (process string)
(defun epg-status-TRUST_UNDEFINED (process string)
- (let ((signature (car (epg-context-result-for epg-context 'verify))))
- (if (and signature
- (eq (epg-signature-status signature) 'good))
- (epg-signature-set-validity signature 'undefined))))
+ (let ((verify-result (car (epg-context-result-for epg-context 'verify))))
+ (if (and verify-result
+ (eq (epg-verify-result-status verify-result) 'good))
+ (epg-verify-result-set-validity verify-result 'undefined))))
(defun epg-status-TRUST_NEVER (process string)
(defun epg-status-TRUST_NEVER (process string)
- (let ((signature (car (epg-context-result-for epg-context 'verify))))
- (if (and signature
- (eq (epg-signature-status signature) 'good))
- (epg-signature-set-validity signature 'never))))
+ (let ((verify-result (car (epg-context-result-for epg-context 'verify))))
+ (if (and verify-result
+ (eq (epg-verify-result-status verify-result) 'good))
+ (epg-verify-result-set-validity verify-result 'never))))
(defun epg-status-TRUST_MARGINAL (process string)
(defun epg-status-TRUST_MARGINAL (process string)
- (let ((signature (car (epg-context-result-for epg-context 'verify))))
- (if (and signature
- (eq (epg-signature-status signature) 'marginal))
- (epg-signature-set-validity signature 'marginal))))
+ (let ((verify-result (car (epg-context-result-for epg-context 'verify))))
+ (if (and verify-result
+ (eq (epg-verify-result-status verify-result) 'marginal))
+ (epg-verify-result-set-validity verify-result 'marginal))))
(defun epg-status-TRUST_FULLY (process string)
(defun epg-status-TRUST_FULLY (process string)
- (let ((signature (car (epg-context-result-for epg-context 'verify))))
- (if (and signature
- (eq (epg-signature-status signature) 'good))
- (epg-signature-set-validity signature 'full))))
+ (let ((verify-result (car (epg-context-result-for epg-context 'verify))))
+ (if (and verify-result
+ (eq (epg-verify-result-status verify-result) 'good))
+ (epg-verify-result-set-validity verify-result 'full))))
(defun epg-status-TRUST_ULTIMATE (process string)
(defun epg-status-TRUST_ULTIMATE (process string)
- (let ((signature (car (epg-context-result-for epg-context 'verify))))
- (if (and signature
- (eq (epg-signature-status signature) 'good))
- (epg-signature-set-validity signature 'ultimate))))
+ (let ((verify-result (car (epg-context-result-for epg-context 'verify))))
+ (if (and verify-result
+ (eq (epg-verify-result-status verify-result) 'good))
+ (epg-verify-result-set-validity verify-result 'ultimate))))
(defun epg-status-PROGRESS (process string)
(if (string-match "\\`\\([^ ]+\\) \\([^ ]\\) \\([0-9]+\\) \\([0-9]+\\)"
(defun epg-status-PROGRESS (process string)
(if (string-match "\\`\\([^ ]+\\) \\([^ ]\\) \\([0-9]+\\) \\([0-9]+\\)"
-(defvar pgg-epg-signature nil)
+(defvar pgg-epg-verify-results nil)
(defun pgg-epg-verify-region (start end &optional signature)
"This function is for internal use only.
Verify region between START and END as the detached signature SIGNATURE."
(let ((context (epg-make-context))
(defun pgg-epg-verify-region (start end &optional signature)
"This function is for internal use only.
Verify region between START and END as the detached signature SIGNATURE."
(let ((context (epg-make-context))
(epg-context-set-armor context t)
(epg-context-set-textmode context pgg-text-mode)
(if signature
(epg-context-set-armor context t)
(epg-context-set-textmode context pgg-text-mode)
(if signature
(buffer-string))
(buffer-substring start end))
(epg-verify-string context (buffer-substring start end)))
(buffer-string))
(buffer-substring start end))
(epg-verify-string context (buffer-substring start end)))
- (setq signature (reverse (epg-context-result-for context 'verify))
- pointer signature)
+ (setq verify-results (reverse (epg-context-result-for context 'verify)))
(save-excursion
(set-buffer (get-buffer-create pgg-errors-buffer))
(save-excursion
(set-buffer (get-buffer-create pgg-errors-buffer))
- (make-local-variable 'pgg-epg-signature)
- (setq pgg-epg-signature (car signature))
+ (make-local-variable 'pgg-epg-verify-results)
+ (setq pgg-epg-verify-results (car verify-results))
- (while pointer
- (insert (format "%s: %s %s %s\n"
- (epg-signature-status (car pointer))
- (epg-signature-key-id (car pointer))
- (epg-signature-user-id (car pointer))
- (epg-signature-validity (car pointer))))
- (setq pointer (cdr pointer))))
- signature))
+ (insert (mapconcat #'epg-verify-result-to-string verify-results "\n")))
+ t))
(defun pgg-epg-insert-key ()
"This function is for internal use only.
(defun pgg-epg-insert-key ()
"This function is for internal use only.
(epg-context-set-textmode context pgg-text-mode)
(epg-import-keys context (buffer-substring start end))))
(epg-context-set-textmode context pgg-text-mode)
(epg-import-keys context (buffer-substring start end))))
-(defun mml2015-gpg-extract-signature-details ()
- (if pgg-epg-signature
- (let* ((expired (eq (epg-signature-status pgg-epg-signature)
+(defun mml2015-gpg-extract-verify-result-details ()
+ (if pgg-epg-verify-result
+ (let* ((expired (eq (epg-verify-result-status pgg-epg-verify-result)
- (signer (cons (epg-signature-key-id pgg-epg-signature)
- (epg-signature-user-id pgg-epg-signature)))
- (fprint (epg-signature-fingerprint pgg-epg-signature))
+ (signer (cons (epg-verify-result-key-id pgg-epg-verify-result)
+ (epg-verify-result-user-id pgg-epg-verify-result)))
+ (fprint (epg-verify-result-fingerprint pgg-epg-verify-result))
- (memq (epg-signature-validity pgg-epg-signature)
+ (memq (epg-verify-result-validity pgg-epg-verify-result)
'(marginal fully ultimate))))
(cond ((and signer fprint)
(concat (cdr signer)
'(marginal fully ultimate))))
(cond ((and signer fprint)
(concat (cdr signer)