[gmime: 4/23] GPGME: actually report User ID in GMimeCertificate objects



commit 31e3cbdbfa163b6278a43d80b6739d200a71f57e
Author: Daniel Kahn Gillmor <dkg fifthhorseman net>
Date:   Sun Oct 15 23:54:30 2017 -0400

    GPGME: actually report User ID in GMimeCertificate objects
    
    When processing a signature, the produced GMimeCertificate object
    should allow retrieval of the full User ID in addition to the name and
    e-mail fields.

 gmime/gmime-gpgme-utils.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gmime/gmime-gpgme-utils.c b/gmime/gmime-gpgme-utils.c
index 6e113ef..15ceabc 100644
--- a/gmime/gmime-gpgme-utils.c
+++ b/gmime/gmime-gpgme-utils.c
@@ -298,7 +298,7 @@ g_mime_gpgme_get_signatures (gpgme_ctx_t ctx, gboolean verify)
                        g_mime_certificate_set_issuer_serial (signature->cert, key->issuer_serial);
                        g_mime_certificate_set_issuer_name (signature->cert, key->issuer_name);
                        
-                       /* get the name and email address */
+                       /* get the name, email address, and full user id */
                        uid = key->uids;
                        while (uid) {
                                if (uid->name && *uid->name)
@@ -307,7 +307,10 @@ g_mime_gpgme_get_signatures (gpgme_ctx_t ctx, gboolean verify)
                                if (uid->email && *uid->email)
                                        g_mime_certificate_set_email (signature->cert, uid->email);
                                
-                               if (signature->cert->name && signature->cert->email)
+                               if (uid->uid && *uid->uid)
+                                       g_mime_certificate_set_user_id (signature->cert, uid->uid);
+                               
+                               if (signature->cert->name && signature->cert->email && 
signature->cert->user_id)
                                        break;
                                
                                uid = uid->next;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]