[seahorse/gnome-3-8] pkcs11: Hide certificates that have no DER X.509 values



commit e87d3a9f6122146117505c5ad8eefcd6b01007c1
Author: Stef Walter <stefw gnome org>
Date:   Fri Apr 19 21:13:53 2013 +0200

    pkcs11: Hide certificates that have no DER X.509 values

 pkcs11/seahorse-token.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/pkcs11/seahorse-token.c b/pkcs11/seahorse-token.c
index e5d9727..37bac4d 100644
--- a/pkcs11/seahorse-token.c
+++ b/pkcs11/seahorse-token.c
@@ -250,6 +250,7 @@ receive_objects (SeahorseToken *self,
 {
        GckAttributes *attrs;
        const GckAttribute *id;
+       const GckAttribute *der;
        gpointer object;
        gpointer prev;
        gpointer pair;
@@ -263,6 +264,15 @@ receive_objects (SeahorseToken *self,
                handle = gck_object_get_handle (object);
                attrs = gck_object_cache_get_attributes (object);
 
+               /* For now skip certificates that have no X.509 data */
+               if (SEAHORSE_IS_CERTIFICATE (object)) {
+                       der = gck_attributes_find (attrs, CKA_VALUE);
+                       if (!der || !der->value) {
+                               gck_attributes_unref (attrs);
+                               continue;
+                       }
+               }
+
                prev = g_hash_table_lookup (self->pv->object_for_handle, &handle);
                if (prev == NULL) {
                        g_hash_table_insert (self->pv->object_for_handle,


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