gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, master, updated. gnutls_2_99_2-94-g9a64508


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_99_2-94-g9a64508
Date: Thu, 16 Jun 2011 06:45:57 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=9a64508cbdf354bef5616e17dfb7744c895d5f04

The branch, master has been updated
       via  9a64508cbdf354bef5616e17dfb7744c895d5f04 (commit)
      from  ba1f72e1084d80655668353dc6cc142cf54d3a14 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9a64508cbdf354bef5616e17dfb7744c895d5f04
Author: Rickard Bellgrim <address@hidden>
Date:   Thu Jun 16 08:43:31 2011 +0200

    The CKA_SUBJECT must be specified for a certificate.
    
    Signed-off-by: Nikos Mavrogiannopoulos <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 lib/pkcs11_write.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/lib/pkcs11_write.c b/lib/pkcs11_write.c
index a81cce8..15ed132 100644
--- a/lib/pkcs11_write.c
+++ b/lib/pkcs11_write.c
@@ -54,12 +54,13 @@ gnutls_pkcs11_copy_x509_crt (const char *token_url,
   size_t der_size, id_size;
   opaque *der = NULL;
   opaque id[20];
-  struct ck_attribute a[8];
+  struct ck_attribute a[10];
   ck_object_class_t class = CKO_CERTIFICATE;
   ck_certificate_type_t type = CKC_X_509;
   ck_object_handle_t obj;
   ck_bool_t tval = 1;
   int a_val;
+  gnutls_datum_t subject = { NULL, 0 };
 
   ret = pkcs11_url_to_info (token_url, &info);
   if (ret < 0)
@@ -108,6 +109,13 @@ gnutls_pkcs11_copy_x509_crt (const char *token_url,
       gnutls_assert ();
       goto cleanup;
     }
+  
+  ret = gnutls_x509_crt_get_raw_dn (crt, &subject);
+  if (ret < 0)
+    {
+      gnutls_assert ();
+      goto cleanup;
+    }
 
   /* FIXME: copy key usage flags */
 
@@ -129,6 +137,11 @@ gnutls_pkcs11_copy_x509_crt (const char *token_url,
 
   a_val = 5;
 
+  a[a_val].type = CKA_SUBJECT;
+  a[a_val].value = subject.data;
+  a[a_val].value_len = subject.size;
+  a_val++;
+
   if (label)
     {
       a[a_val].type = CKA_LABEL;
@@ -162,7 +175,7 @@ gnutls_pkcs11_copy_x509_crt (const char *token_url,
 cleanup:
   gnutls_free (der);
   pkcs11_close_session (module, pks);
-
+  _gnutls_free_datum(&subject);
   return ret;
 
 }


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]