[rs-commit] r58 - in /redwax-tool/trunk: redwax-tool.h redwax_openssl.c redwax_p11kit.c

rs-commit at redwax.eu rs-commit at redwax.eu
Tue Nov 23 14:08:36 CET 2021


Author: minfrin at redwax.eu
Date: Tue Nov 23 14:08:35 2021
New Revision: 58

Log:
Display token when available.

Modified:
    redwax-tool/trunk/redwax-tool.h
    redwax-tool/trunk/redwax_openssl.c
    redwax-tool/trunk/redwax_p11kit.c

Modified: redwax-tool/trunk/redwax-tool.h
==============================================================================
--- redwax-tool/trunk/redwax-tool.h	(original)
+++ redwax-tool/trunk/redwax-tool.h	Tue Nov 23 14:08:35 2021
@@ -148,6 +148,8 @@
     const char *origin;
     const char *label;
     apr_size_t label_len;
+    const char *token;
+    apr_size_t token_len;
     void *ctx;
     redwax_certificate_common_t common;
     union {
@@ -212,6 +214,8 @@
     const char *origin;
     const char *label;
     apr_size_t label_len;
+    const char *token;
+    apr_size_t token_len;
     void *ctx;
     redwax_key_common_t common;
     union {

Modified: redwax-tool/trunk/redwax_openssl.c
==============================================================================
--- redwax-tool/trunk/redwax_openssl.c	(original)
+++ redwax-tool/trunk/redwax_openssl.c	Tue Nov 23 14:08:35 2021
@@ -2158,6 +2158,10 @@
                 redwax_metadata_add_string(m, "Label",
                         apr_pstrndup(m->pool, cert->label, cert->label_len));
             }
+            if (cert->token && cert->token_len) {
+                redwax_metadata_add_string(m, "Token",
+                        apr_pstrndup(m->pool, cert->token, cert->token_len));
+            }
             redwax_metadata_push_object(m, "Data", 0);
             redwax_metadata_add_string(m, "Subject", cert->common.subject);
             redwax_metadata_pop_object(m);
@@ -2199,6 +2203,10 @@
                 redwax_metadata_add_string(m, "Label",
                         apr_pstrndup(m->pool, cert->label, cert->label_len));
             }
+            if (cert->token && cert->token_len) {
+                redwax_metadata_add_string(m, "Token",
+                        apr_pstrndup(m->pool, cert->token, cert->token_len));
+            }
             redwax_metadata_push_object(m, "Data", 0);
             redwax_metadata_add_string(m, "Subject", cert->common.subject);
             redwax_metadata_pop_object(m);
@@ -2235,6 +2243,10 @@
                 redwax_metadata_add_string(m, "Label",
                         apr_pstrndup(m->pool, cert->label, cert->label_len));
             }
+            if (cert->token && cert->token_len) {
+                redwax_metadata_add_string(m, "Token",
+                        apr_pstrndup(m->pool, cert->token, cert->token_len));
+            }
             redwax_metadata_push_object(m, "Data", 0);
             redwax_metadata_add_string(m, "Subject", cert->common.subject);
             redwax_metadata_pop_object(m);
@@ -2259,6 +2271,10 @@
             if (key->label && key->label_len) {
                 redwax_metadata_add_string(m, "Label",
                         apr_pstrndup(m->pool, key->label, key->label_len));
+            }
+            if (key->token && key->token_len) {
+                redwax_metadata_add_string(m, "Token",
+                        apr_pstrndup(m->pool, key->token, key->token_len));
             }
             redwax_metadata_pop_object(m);
 

Modified: redwax-tool/trunk/redwax_p11kit.c
==============================================================================
--- redwax-tool/trunk/redwax_p11kit.c	(original)
+++ redwax-tool/trunk/redwax_p11kit.c	Tue Nov 23 14:08:35 2021
@@ -1305,6 +1305,11 @@
                             class_template[1].ulValueLen);
                     cert->label_len = strlen(cert->label);
 
+                    cert->token = redwax_pstrntrim(r->pool,
+                            (const char*) tokenInfo->label,
+                            sizeof(tokenInfo->label));
+                    cert->token_len = strlen(cert->token);
+
                     if (REDWAX_CERTIFICATE_ROOT
                             == cert->common.category && trusted) {
                         cert->common.category = REDWAX_CERTIFICATE_TRUSTED;
@@ -1537,6 +1542,11 @@
                         (const char*) class_template[1].pValue,
                         class_template[1].ulValueLen);
                 key->label_len = strlen(key->label);
+
+                key->token = redwax_pstrntrim(r->pool,
+                        (const char*) tokenInfo->label,
+                        sizeof(tokenInfo->label));
+                key->token_len = strlen(key->token);
 
             }
             else {



More information about the rs-commit mailing list