[gnome-keyring] xdg-store: Use the peer name in a trust assertion as file name



commit 70d390e8c2a1abcb8110ed4b6a3077cb11e64b27
Author: Stef Walter <stefw collabora co uk>
Date:   Wed Aug 31 09:36:30 2011 +0200

    xdg-store: Use the peer name in a trust assertion as file name
    
     * Use the peer name in a trust assertion as a possible file name
       for the object on disk.

 pkcs11/xdg-store/gkm-xdg-module.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/pkcs11/xdg-store/gkm-xdg-module.c b/pkcs11/xdg-store/gkm-xdg-module.c
index 1f5ef01..708d4ee 100644
--- a/pkcs11/xdg-store/gkm-xdg-module.c
+++ b/pkcs11/xdg-store/gkm-xdg-module.c
@@ -39,6 +39,8 @@
 #include "gkm/gkm-transaction.h"
 #include "gkm/gkm-util.h"
 
+#include "pkcs11x.h"
+
 #include <string.h>
 
 struct _GkmXdgModule {
@@ -314,6 +316,14 @@ guess_basename_for_object (GkmObject *object)
 		name = name_for_subject (data, n_data);
 	g_free (data);
 
+	/* Next we try and see if it has a peer (is a trust assertion) */
+	if (name == NULL) {
+		data = gkm_object_get_attribute_data (object, NULL, CKA_X_PEER, &n_data);
+		if (data && n_data)
+			name = g_strndup ((gchar *)data, n_data);
+		g_free (data);
+	}
+
 	/* Next we try hex encoding the ID */
 	if (name == NULL) {
 		data = gkm_object_get_attribute_data (object, NULL, CKA_ID, &n_data);



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