summaryrefslogtreecommitdiff
path: root/src/sbearssl
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-05-25 22:58:38 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-05-25 22:58:38 +0000
commitb7e1d8b5b4d09379b7652f77372f5d666f439b91 (patch)
tree85f65c06521ea20df1466ad963d001c94c0e4273 /src/sbearssl
parenta32bdcb06acf0428b4babe6f8342a3f962fd5b39 (diff)
downloads6-networking-b7e1d8b5b4d09379b7652f77372f5d666f439b91.tar.xz
More debug commands
Diffstat (limited to 'src/sbearssl')
-rw-r--r--src/sbearssl/sbearssl_server_init_and_run.c3
-rw-r--r--src/sbearssl/sbearssl_x509_small_vtable.c12
2 files changed, 11 insertions, 4 deletions
diff --git a/src/sbearssl/sbearssl_server_init_and_run.c b/src/sbearssl/sbearssl_server_init_and_run.c
index 428efb8..56943bf 100644
--- a/src/sbearssl/sbearssl_server_init_and_run.c
+++ b/src/sbearssl/sbearssl_server_init_and_run.c
@@ -10,6 +10,8 @@
#include <skalibs/genalloc.h>
#include <skalibs/random.h>
+#include <skalibs/lolstdio.h>
+
#include <s6-networking/sbearssl.h>
#include "sbearssl-internal.h"
@@ -74,6 +76,7 @@ void sbearssl_server_init_and_run (int *fds, tain_t const *tto, uint32_t preopti
if (n)
{
+ LOLDEBUG("sbearssl_server_init_and_run: trusts anchors found: %zu", n) ;
sbearssl_x509_small_init_full(&xc, btas, n, &cbarg->eedn, &cbarg->eltstatus, cbarg->eehash) ;
if (!sbearssl_x509_small_set_tain(&xc, &STAMP))
strerr_diefu1sys(111, "initialize validation time") ;
diff --git a/src/sbearssl/sbearssl_x509_small_vtable.c b/src/sbearssl/sbearssl_x509_small_vtable.c
index 9946e7a..d589c94 100644
--- a/src/sbearssl/sbearssl_x509_small_vtable.c
+++ b/src/sbearssl/sbearssl_x509_small_vtable.c
@@ -1,9 +1,9 @@
/* ISC license. */
-#include <skalibs/lolstdio.h>
-
#include <bearssl.h>
+#include <skalibs/lolstdio.h>
+
#include <s6-networking/sbearssl.h>
#define INSTANCE(c) ((sbearssl_x509_small_context *)(c))
@@ -41,15 +41,19 @@ static void end_cert (br_x509_class const **c)
ctx->minimal.vtable->end_cert(&ctx->minimal.vtable) ;
LOLDEBUG("small_context: end_cert") ;
- if (!ctx->i) br_sha256_out(&ctx->hashctx, ctx->eehash) ;
+ if (!ctx->i)
+ {
+ br_sha256_out(&ctx->hashctx, ctx->eehash) ;
+ LOLDEBUG("finished parsing EE: CN=%.64s", ctx->elts[5].buf) ;
+ }
ctx->i++ ;
}
static unsigned int end_chain (br_x509_class const **c)
{
sbearssl_x509_small_context *ctx = INSTANCE(c) ;
- LOLDEBUG("small_context: end_chain") ;
unsigned int r = ctx->minimal.vtable->end_chain(&ctx->minimal.vtable) ;
+ LOLDEBUG("small_context: end_chain, returned %u", r) ;
if (!r)
{
uint8_t mask = 1 ;