From bf35103b5519e81a3cb3a234816f166bf236d7d7 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Mon, 21 Apr 2025 19:38:45 +0200 Subject: Added send packets with type i.e. keyex / json-data Signed-off-by: Toni Uhlig --- examples/c-decrypt/c-decrypt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'examples/c-decrypt') diff --git a/examples/c-decrypt/c-decrypt.c b/examples/c-decrypt/c-decrypt.c index 2ec27fba1..f03e82295 100644 --- a/examples/c-decrypt/c-decrypt.c +++ b/examples/c-decrypt/c-decrypt.c @@ -122,7 +122,7 @@ int udp_server(struct ncrypt * const nc) if (ret < 0) { logger(1, "Crypto error: %d", ret); - break; + continue; } msgs_recvd++; @@ -137,10 +137,12 @@ int udp_server(struct ncrypt * const nc) HASH_ITER(hh, nc->peers, current_peer, ctmp) { printf( - "*** Peer: %8X | Cryptions: %5zu | Crypto Errors: %2zu | IV Mismatches: %2zu | Send Errors: " + "*** Peer: %8X | Key Rotations: %5zu | Cryptions: %5zu | Crypto Errors: %2zu | IV Mismatches: " + "%2zu | Send Errors: " "%2zu | " "Partial Writes: %2zu ***\n", current_peer->hash_key, + current_peer->key_rotations, current_peer->cryptions, current_peer->crypto_errors, current_peer->iv_mismatches, @@ -159,12 +161,14 @@ int udp_server(struct ncrypt * const nc) if (ret != PARSE_OK) { logger(1, "JSON parsing failed with: %d", ret); - break; + continue; } json_ctx.tokens_found = 0; } } + ncrypt_free(nc); + return 0; } -- cgit v1.2.3