[rt-commit] r120 - in /redwax-tool/trunk: ChangeLog redwax_p11kit.c

rt-commit at redwax.eu rt-commit at redwax.eu
Thu Dec 9 18:08:18 CET 2021


Author: minfrin at redwax.eu
Date: Thu Dec  9 18:08:17 2021
New Revision: 120

Log:
Read the pkcs11 label on certificates.

Modified:
    redwax-tool/trunk/ChangeLog
    redwax-tool/trunk/redwax_p11kit.c

Modified: redwax-tool/trunk/ChangeLog
==============================================================================
--- redwax-tool/trunk/ChangeLog	(original)
+++ redwax-tool/trunk/ChangeLog	Thu Dec  9 18:08:17 2021
@@ -1,5 +1,7 @@
 
 Changes with v0.9.1
+
+ *) Read the pkcs11 label on certificates. [Graham Leggett]
 
  *) The opencryptoki-swtok tokens can be used when uninitialised.
     Add a sanity check to ignore uninitialised tokens. [Graham

Modified: redwax-tool/trunk/redwax_p11kit.c
==============================================================================
--- redwax-tool/trunk/redwax_p11kit.c	(original)
+++ redwax-tool/trunk/redwax_p11kit.c	Thu Dec  9 18:08:17 2021
@@ -1642,7 +1642,7 @@
             CK_CERTIFICATE_TYPE type;
 
             CK_ATTRIBUTE type_template[] = {
-              {CKA_CERTIFICATE_TYPE, NULL_PTR, 0}
+              { CKA_CERTIFICATE_TYPE, NULL_PTR, 0}
             };
 
             int type_template_len = 1;
@@ -1663,9 +1663,10 @@
 
                 CK_ATTRIBUTE cert_template[] =
                     { { CKA_VALUE, NULL_PTR, 0 },
-                      { CKA_TRUSTED, NULL_PTR, 0 }
+                      { CKA_TRUSTED, NULL_PTR, 0 },
+                      { CKA_LABEL, NULL_PTR, 0 }
                     };
-                int cert_template_len = 2;
+                int cert_template_len = 3;
 
                 apr_pool_t *p;
 
@@ -1690,6 +1691,12 @@
                             != cert_template[0].ulValueLen) {
                         cert->der = cert_template[0].pValue;
                         cert->len = cert_template[0].ulValueLen;
+                    }
+
+                    if (CK_UNAVAILABLE_INFORMATION
+                            != cert_template[2].ulValueLen) {
+                        cert->label = cert_template[2].pValue;
+                        cert->label_len = cert_template[2].ulValueLen;
                     }
 
                     rt_run_normalise_certificate(r, cert, 1);



More information about the rt-commit mailing list