]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
DEBUG SoftHSM concurrent usage debug_softhsm
authorDavid Vašek <david.vasek@nic.cz>
Fri, 20 Feb 2026 20:54:48 +0000 (21:54 +0100)
committerDavid Vašek <david.vasek@nic.cz>
Fri, 20 Feb 2026 21:41:40 +0000 (22:41 +0100)
src/libknot/dnssec/keystore/pkcs11.c
tests-extra/tests/dnssec/softhsm/test.py

index 55ae985f0b0cc43be90cd2064a32e27c03f52144..0cb028ef893cafbec59ac244b73035b502023c10 100644 (file)
@@ -6,6 +6,8 @@
 #include <gnutls/gnutls.h>
 #include <pthread.h>
 
+#include <stdio.h>
+
 #include "contrib/string.h"
 #include "libknot/errcode.h"
 #include "libknot/dnssec/keyid.h"
@@ -200,6 +202,7 @@ static int pkcs11_generate_key(void *_ctx, gnutls_pk_algorithm_t algorithm,
        int r = gnutls_pkcs11_privkey_generate3(ctx->url, algorithm, bits, label,
                                                &gt_cka_id, 0, NULL, 0, flags);
        if (r != GNUTLS_E_SUCCESS) {
+printf(">>>> pkcs11_generate_key(): gnutls_pkcs11_privkey_generate3() returned %d (%s)\n", r, gnutls_strerror(r));
                return KNOT_KEY_EGENERATE;
        }
 
index 515951a20e32f8ebad7d2c1487abb929b0e4fdad..fd06eee0886584c2d6aaf716ff5c24a316ce92d4 100644 (file)
@@ -12,7 +12,7 @@ t = Test()
 
 knot1 = t.server("knot")
 knot2 = t.server("knot")
-zone = t.zone("example.com")
+zone = t.zone("example.com") + t.zone_rnd(5)
 t.link(zone, knot1)
 t.link(zone, knot2)
 
@@ -27,12 +27,12 @@ knot1.dnssec(zone).keystore = [ keys1 ]
 t.start()
 
 # Wait for signed zone
-knot1.zone_wait(zone)
+knot1.zone_wait(zone[0])
 resp = knot1.dig(zone[0].name, "DNSKEY")
 resp.check_count(2, "DNSKEY")
 
 # Wait for unsigned zone
-serial = knot2.zone_wait(zone)
+serial = knot2.zone_wait(zone[0])
 resp = knot2.dig(zone[0].name, "DNSKEY")
 resp.check_count(0, "DNSKEY")
 
@@ -49,7 +49,7 @@ knot2.gen_confile()
 knot2.reload()
 
 # Check the keysets match
-knot2.zone_wait(zone, serial)
+knot2.zone_wait(zone[0], serial)
 resp = knot2.dig(zone[0].name, "DNSKEY")
 resp.cmp(knot1)