(signal 'wrong-type-argument (list 'epg-context-p context)))
(aref (cdr context) 9))
-(defun epg-context-signature-notations (context)
+(defun epg-context-sig-notations (context)
"Return the list of notations for singning."
(unless (eq (car-safe context) 'epg-context)
(signal 'wrong-type-argument (list 'epg-context-p context)))
(signal 'wrong-type-argument (list 'epg-context-p context)))
(aset (cdr context) 9 signers))
-(defun epg-context-set-signature-notations (context notations)
+(defun epg-context-set-sig-notations (context notations)
"Set the list of notations for singning."
(unless (eq (car-safe context) 'epg-context)
(signal 'wrong-type-argument (list 'epg-context-p context)))
(defun epg-make-signature (status &optional key-id)
"Return a signature object."
- (cons 'epg-signature (vector status key-id nil nil nil nil nil nil nil nil)))
+ (cons 'epg-signature (vector status key-id nil nil nil nil nil nil nil nil
+ nil)))
(defun epg-signature-status (signature)
"Return the status code of SIGNATURE."
(signal 'wrong-type-argument (list 'epg-signature-p signature)))
(aref (cdr signature) 9))
+(defun epg-signature-notations (signature)
+ "Return the list of notations of SIGNATURE."
+ (unless (eq (car-safe signature) 'epg-signature)
+ (signal 'wrong-type-argument (list 'epg-signature-p signature)))
+ (aref (cdr signature) 10))
+
(defun epg-signature-set-status (signature status)
"Set the status code of SIGNATURE."
(unless (eq (car-safe signature) 'epg-signature)
(signal 'wrong-type-argument (list 'epg-signature-p signature)))
(aset (cdr signature) 9 version))
+(defun epg-signature-set-notations (signature notations)
+ "Set the list of notations of SIGNATURE."
+ (unless (eq (car-safe signature) 'epg-signature)
+ (signal 'wrong-type-argument (list 'epg-signature-p signature)))
+ (aset (cdr signature) 10 notations))
+
(defun epg-make-new-signature (type pubkey-algorithm digest-algorithm
class creation-time fingerprint)
"Return a new signature object."
(signal 'wrong-type-argument (list 'epg-key-signature-p key-signature)))
(aref (cdr key-signature) 7))
-(defun epg-make-signature-notation (name value &optional human-readable
+(defun epg-make-sig-notation (name value &optional human-readable
critical)
"Return a notation object."
- (cons 'epg-signature-notation (vector name value human-readable critical)))
-
-(defun epg-signature-notation-name (signature-notation)
- "Return the name of SIGNATURE-NOTATION."
- (unless (eq (car-safe signature-notation) 'epg-signature-notation)
- (signal 'wrong-type-argument (list 'epg-signature-notation-p
- signature-notation)))
- (aref (cdr signature-notation) 0))
-
-(defun epg-signature-notation-value (signature-notation)
- "Return the value of SIGNATURE-NOTATION."
- (unless (eq (car-safe signature-notation) 'epg-signature-notation)
- (signal 'wrong-type-argument (list 'epg-signature-notation-p
- signature-notation)))
- (aref (cdr signature-notation) 1))
-
-(defun epg-signature-notation-human-readable (signature-notation)
- "Return the human-readable of SIGNATURE-NOTATION."
- (unless (eq (car-safe signature-notation) 'epg-signature-notation)
- (signal 'wrong-type-argument (list 'epg-signature-notation-p
- signature-notation)))
- (aref (cdr signature-notation) 2))
-
-(defun epg-signature-notation-critical (signature-notation)
- "Return the critical of SIGNATURE-NOTATION."
- (unless (eq (car-safe signature-notation) 'epg-signature-notation)
- (signal 'wrong-type-argument (list 'epg-signature-notation-p
- signature-notation)))
- (aref (cdr signature-notation) 3))
+ (cons 'epg-sig-notation (vector name value human-readable critical)))
+
+(defun epg-sig-notation-name (sig-notation)
+ "Return the name of SIG-NOTATION."
+ (unless (eq (car-safe sig-notation) 'epg-sig-notation)
+ (signal 'wrong-type-argument (list 'epg-sig-notation-p
+ sig-notation)))
+ (aref (cdr sig-notation) 0))
+
+(defun epg-sig-notation-value (sig-notation)
+ "Return the value of SIG-NOTATION."
+ (unless (eq (car-safe sig-notation) 'epg-sig-notation)
+ (signal 'wrong-type-argument (list 'epg-sig-notation-p
+ sig-notation)))
+ (aref (cdr sig-notation) 1))
+
+(defun epg-sig-notation-human-readable (sig-notation)
+ "Return the human-readable of SIG-NOTATION."
+ (unless (eq (car-safe sig-notation) 'epg-sig-notation)
+ (signal 'wrong-type-argument (list 'epg-sig-notation-p
+ sig-notation)))
+ (aref (cdr sig-notation) 2))
+
+(defun epg-sig-notation-critical (sig-notation)
+ "Return the critical of SIG-NOTATION."
+ (unless (eq (car-safe sig-notation) 'epg-sig-notation)
+ (signal 'wrong-type-argument (list 'epg-sig-notation-p
+ sig-notation)))
+ (aref (cdr sig-notation) 3))
+
+(defun epg-sig-notation-set-value (sig-notation value)
+ "Set the value of SIG-NOTATION."
+ (unless (eq (car-safe sig-notation) 'epg-sig-notation)
+ (signal 'wrong-type-argument (list 'epg-sig-notation-p
+ sig-notation)))
+ (aset (cdr sig-notation) 1 value))
(defun epg-context-result-for (context name)
"Return the result of CONTEXT associated with NAME."
(eq (epg-signature-status signature) 'good))
(epg-signature-set-validity signature 'ultimate))))
+(defun epg--status-NOTATION_NAME (context string)
+ (let ((signature (car (epg-context-result-for context 'verify))))
+ (if signature
+ (epg-signature-set-notations
+ signature
+ (cons (epg-make-sig-notation string nil t nil)
+ (epg-sig-notations signature))))))
+
+(defun epg--status-NOTATION_DATA (context string)
+ (let ((signature (car (epg-context-result-for context 'verify)))
+ notation)
+ (if (and signature
+ (setq notation (car (epg-sig-notations signature))))
+ (epg-sig-notation-set-value notation string))))
+
+(defun epg--status-POLICY_URL (context string)
+ (let ((signature (car (epg-context-result-for context 'verify))))
+ (if signature
+ (epg-signature-set-notations
+ signature
+ (cons (epg-make-sig-notation nil string t nil)
+ (epg-sig-notations signature))))))
+
(defun epg--status-PROGRESS (context string)
(if (string-match "\\`\\([^ ]+\\) \\([^ ]\\) \\([0-9]+\\) \\([0-9]+\\)"
string)
(defun epg--clear-string (string)
(fillarray string 0)))
-(defun epg--args-from-signature-notations (notations)
+(defun epg--args-from-sig-notations (notations)
(apply #'nconc
(mapcar
(lambda (notation)
- (if (and (epg-signature-notation-name notation)
- (not (epg-signature-notation-human-readable notation)))
+ (if (and (epg-sig-notation-name notation)
+ (not (epg-sig-notation-human-readable notation)))
(error "Unreadable"))
- (if (epg-signature-notation-name notation)
+ (if (epg-sig-notation-name notation)
(list "--sig-notation"
- (if (epg-signature-notation-critical notation)
- (concat "!" (epg-signature-notation-name notation)
- "=" (epg-signature-notation-value notation))
- (concat (epg-signature-notation-name notation)
- "=" (epg-signature-notation-value notation))))
+ (if (epg-sig-notation-critical notation)
+ (concat "!" (epg-sig-notation-name notation)
+ "=" (epg-sig-notation-value notation))
+ (concat (epg-sig-notation-name notation)
+ "=" (epg-sig-notation-value notation))))
(list "--sig-policy-url"
- (epg-signature-notation-value notation))))
- notations))
+ (if (epg-sig-notation-critical notation)
+ (concat "!" (epg-sig-notation-value notation))
+ (epg-sig-notation-value notation))))
+ notations))
;;;###autoload
(defun epg-cancel (context)
(epg-sub-key-id
(car (epg-key-sub-key-list signer)))))
(epg-context-signers context)))
- (epg--args-from-signature-notations
- (epg-context-signature-notations context))
+ (epg--args-from-sig-notations
+ (epg-context-sig-notations context))
(if (epg-data-file plain)
(list "--" (epg-data-file plain)))))
;; `gpgsm' does not read passphrase from stdin, so waiting is not needed.
signer)))))
(epg-context-signers context))))
(if sign
- (epg--args-from-signature-notations
- (epg-context-signature-notations context)))
+ (epg--args-from-sig-notations
+ (epg-context-sig-notations context)))
(apply #'nconc
(mapcar
(lambda (recipient)