diff options
author | Stef Walter <stefw@collabora.co.uk> | 2011-08-31 09:36:30 +0200 |
---|---|---|
committer | Stef Walter <stefw@collabora.co.uk> | 2011-08-31 09:40:39 +0200 |
commit | 70d390e8c2a1abcb8110ed4b6a3077cb11e64b27 (patch) | |
tree | 1b0c816a3cede0027e596865f8db1cd889bcca28 /pkcs11/xdg-store | |
parent | 616e971d01fdd86c6022039e7b8c09c811ef6afb (diff) | |
download | gnome-keyring-70d390e8c2a1abcb8110ed4b6a3077cb11e64b27.tar.gz |
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.
Diffstat (limited to 'pkcs11/xdg-store')
-rw-r--r-- | 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 1f5ef01e..708d4eea 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); |