From b7e1d8b5b4d09379b7652f77372f5d666f439b91 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 25 May 2021 22:58:38 +0000 Subject: More debug commands --- src/sbearssl/sbearssl_server_init_and_run.c | 3 +++ src/sbearssl/sbearssl_x509_small_vtable.c | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src/sbearssl') 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 #include +#include + #include #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 - #include +#include + #include #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 ; -- cgit v1.2.3