Skip to content

Commit b8f5daf

Browse files
Roytakmichalvasko
authored andcommitted
session server tls UPDATE debug print matched ctn
1 parent a6c1448 commit b8f5daf

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/session_server_tls.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ nc_server_tls_cert_to_name(struct nc_ctn *ctn, void *cert_chain, char **username
343343

344344
cert_count = nc_tls_get_num_certs_wrap(cert_chain);
345345
for (i = 0; i < cert_count; i++) {
346+
DBG(NULL, "Cert verify CTN: checking entry with id %"PRIu32".", ctn->id);
347+
346348
/* reset the flag */
347349
fingerprint_match = 0;
348350

@@ -367,8 +369,6 @@ nc_server_tls_cert_to_name(struct nc_ctn *ctn, void *cert_chain, char **username
367369
}
368370

369371
if (!strcasecmp(ctn->fingerprint + 3, digest_md5)) {
370-
/* we got ourselves a potential winner! */
371-
VRB(NULL, "Cert verify CTN: entry with a matching fingerprint found.");
372372
fingerprint_match = 1;
373373
}
374374
free(digest_md5);
@@ -382,8 +382,6 @@ nc_server_tls_cert_to_name(struct nc_ctn *ctn, void *cert_chain, char **username
382382
}
383383

384384
if (!strcasecmp(ctn->fingerprint + 3, digest_sha1)) {
385-
/* we got ourselves a potential winner! */
386-
VRB(NULL, "Cert verify CTN: entry with a matching fingerprint found.");
387385
fingerprint_match = 1;
388386
}
389387
free(digest_sha1);
@@ -397,8 +395,6 @@ nc_server_tls_cert_to_name(struct nc_ctn *ctn, void *cert_chain, char **username
397395
}
398396

399397
if (!strcasecmp(ctn->fingerprint + 3, digest_sha224)) {
400-
/* we got ourselves a potential winner! */
401-
VRB(NULL, "Cert verify CTN: entry with a matching fingerprint found.");
402398
fingerprint_match = 1;
403399
}
404400
free(digest_sha224);
@@ -412,8 +408,6 @@ nc_server_tls_cert_to_name(struct nc_ctn *ctn, void *cert_chain, char **username
412408
}
413409

414410
if (!strcasecmp(ctn->fingerprint + 3, digest_sha256)) {
415-
/* we got ourselves a potential winner! */
416-
VRB(NULL, "Cert verify CTN: entry with a matching fingerprint found.");
417411
fingerprint_match = 1;
418412
}
419413
free(digest_sha256);
@@ -427,8 +421,6 @@ nc_server_tls_cert_to_name(struct nc_ctn *ctn, void *cert_chain, char **username
427421
}
428422

429423
if (!strcasecmp(ctn->fingerprint + 3, digest_sha384)) {
430-
/* we got ourselves a potential winner! */
431-
VRB(NULL, "Cert verify CTN: entry with a matching fingerprint found.");
432424
fingerprint_match = 1;
433425
}
434426
free(digest_sha384);
@@ -442,8 +434,6 @@ nc_server_tls_cert_to_name(struct nc_ctn *ctn, void *cert_chain, char **username
442434
}
443435

444436
if (!strcasecmp(ctn->fingerprint + 3, digest_sha512)) {
445-
/* we got ourselves a potential winner! */
446-
VRB(NULL, "Cert verify CTN: entry with a matching fingerprint found.");
447437
fingerprint_match = 1;
448438
}
449439
free(digest_sha512);
@@ -456,6 +446,8 @@ nc_server_tls_cert_to_name(struct nc_ctn *ctn, void *cert_chain, char **username
456446

457447
if (fingerprint_match) {
458448
/* found a fingerprint match, try to obtain the username */
449+
VRB(NULL, "Cert verify CTN: entry with a matching fingerprint found.");
450+
DBG(NULL, "Cert verify CTN: matched fingerprint: %s (id %"PRIu32").", ctn->fingerprint, ctn->id);
459451
ret = nc_server_tls_get_username(cert, ctn, username);
460452
if (ret == -1) {
461453
/* fatal error */

0 commit comments

Comments
 (0)