From ec4a5572f1d61f2e436b479a5e7a59e925830507 Mon Sep 17 00:00:00 2001 From: ueno Date: Sun, 23 Apr 2006 01:08:40 +0000 Subject: [PATCH] Parse DN. --- epg.el | 62 ++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/epg.el b/epg.el index 74d673f..82de421 100644 --- a/epg.el +++ b/epg.el @@ -646,9 +646,14 @@ This function is for internal use only." (epg-context-set-result-for epg-context 'verify - (cons (epg-make-signature 'good - (match-string 1 string) - (match-string 2 string)) + (cons (epg-make-signature + 'good + (match-string 1 string) + (if (eq (epg-context-protocol epg-context) 'CMS) + (condition-case nil + (epg-dn-from-string (match-string 2 string)) + (error (match-string 2 string))) + (match-string 2 string))) (epg-context-result-for epg-context 'verify))))) (defun epg-status-EXPSIG (process string) @@ -656,9 +661,14 @@ This function is for internal use only." (epg-context-set-result-for epg-context 'verify - (cons (epg-make-signature 'expired - (match-string 1 string) - (match-string 2 string)) + (cons (epg-make-signature + 'expired + (match-string 1 string) + (if (eq (epg-context-protocol epg-context) 'CMS) + (condition-case nil + (epg-dn-from-string (match-string 2 string)) + (error (match-string 2 string))) + (match-string 2 string))) (epg-context-result-for epg-context 'verify))))) (defun epg-status-EXPKEYSIG (process string) @@ -666,9 +676,14 @@ This function is for internal use only." (epg-context-set-result-for epg-context 'verify - (cons (epg-make-signature 'expired-key - (match-string 1 string) - (match-string 2 string)) + (cons (epg-make-signature + 'expired-key + (match-string 1 string) + (if (eq (epg-context-protocol epg-context) 'CMS) + (condition-case nil + (epg-dn-from-string (match-string 2 string)) + (error (match-string 2 string))) + (match-string 2 string))) (epg-context-result-for epg-context 'verify))))) (defun epg-status-REVKEYSIG (process string) @@ -676,9 +691,14 @@ This function is for internal use only." (epg-context-set-result-for epg-context 'verify - (cons (epg-make-signature 'revoked-key - (match-string 1 string) - (match-string 2 string)) + (cons (epg-make-signature + 'revoked-key + (match-string 1 string) + (if (eq (epg-context-protocol epg-context) 'CMS) + (condition-case nil + (epg-dn-from-string (match-string 2 string)) + (error (match-string 2 string))) + (match-string 2 string))) (epg-context-result-for epg-context 'verify))))) (defun epg-status-BADSIG (process string) @@ -686,9 +706,14 @@ This function is for internal use only." (epg-context-set-result-for epg-context 'verify - (cons (epg-make-signature 'bad - (match-string 1 string) - (match-string 2 string)) + (cons (epg-make-signature + 'bad + (match-string 1 string) + (if (eq (epg-context-protocol epg-context) 'CMS) + (condition-case nil + (epg-dn-from-string (match-string 2 string)) + (error (match-string 2 string))) + (match-string 2 string))) (epg-context-result-for epg-context 'verify))))) (defun epg-status-VALIDSIG (process string) @@ -925,9 +950,10 @@ This function is for internal use only." (if (aref (car lines) 1) (cdr (assq (string-to-char (aref (car lines) 1)) epg-key-validity-alist))) - (if (and cert - (not (eq (aref (aref (car lines) 9) 0) ?<))) - (epg-dn-from-string (aref (car lines) 9)) + (if cert + (condition-case nil + (epg-dn-from-string (aref (car lines) 9)) + (error (aref (car lines) 9))) (aref (car lines) 9))) (epg-key-user-id-list (car keys))))) ((equal (aref (car lines) 0) "fpr") -- 1.7.10.4