gnome-keyring/rsa1-keys.patch

47 lines
1.4 KiB
Diff

From 63c148b12c08ea0cfe72ac921abdcbebba84acc1 Mon Sep 17 00:00:00 2001
From: Vincent Untz <vuntz@gnome.org>
Date: Thu, 8 Oct 2009 16:25:11 +0200
Subject: [PATCH] [ssh-agent] Fix support for rsa1 keys
Read the comment, instead of ignoring it and using the bytes as if they
were constraints.
https://bugzilla.gnome.org/show_bug.cgi?id=597813
---
pkcs11/ssh-agent/gck-ssh-agent-ops.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/pkcs11/ssh-agent/gck-ssh-agent-ops.c b/pkcs11/ssh-agent/gck-ssh-agent-ops.c
index d3507f4..c02c43e 100644
--- a/pkcs11/ssh-agent/gck-ssh-agent-ops.c
+++ b/pkcs11/ssh-agent/gck-ssh-agent-ops.c
@@ -685,6 +685,7 @@ op_v1_add_identity (GckSshAgentCall *call)
{
GP11Attributes *pub, *priv;
GP11Session *session;
+ gchar *comment = NULL;
gboolean ret;
gsize offset = 5;
guint32 unused;
@@ -702,6 +703,19 @@ op_v1_add_identity (GckSshAgentCall *call)
return FALSE;
}
+ /* Get the comment */
+ if (!egg_buffer_get_string (call->req, offset, &offset, &comment, (EggBufferAllocator)g_realloc)) {
+ gp11_attributes_unref (pub);
+ gp11_attributes_unref (priv);
+ return FALSE;
+ }
+
+ /*
+ gp11_attributes_add_string (pub, CKA_LABEL, comment);
+ gp11_attributes_add_string (priv, CKA_LABEL, comment);
+ */
+ g_free (comment);
+
gp11_attributes_add_string (priv, CKA_LABEL, V1_LABEL);
gp11_attributes_add_string (pub, CKA_LABEL, V1_LABEL);
--
1.6.4.2