vici: List additional key exchanges

Co-authored-by: Tobias Brunner <[email protected]>
This commit is contained in:
Andreas Steffen
2024-08-07 16:20:18 +02:00
committed by Tobias Brunner
co-authored by Tobias Brunner
parent c5a6938b9e
commit 355f917532
2 changed files with 47 additions and 3 deletions
+22 -1
View File
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2016-2019 Andreas Steffen
* Copyright (C) 2015-2020 Tobias Brunner
* Copyright (C) 2014 Martin Willi
* Copyright (C) 2016 Andreas Steffen
*
* Copyright (C) secunet Security Networks AG
*
@@ -100,6 +101,24 @@ CALLBACK(sa_list, int,
return 0;
}
/**
* Print additional key exchanges
*/
static void print_ake(hashtable_t *sa)
{
char ake_str[5];
int ake;
for (ake = 1; ake <= 7; ake++)
{
sprintf(ake_str, "ake%d", ake);
if (sa->get(sa, ake_str))
{
printf("/KE%d_%s", ake, sa->get(sa, ake_str));
}
}
}
CALLBACK(child_sas, int,
hashtable_t *ike, vici_res_t *res, char *name)
{
@@ -145,6 +164,7 @@ CALLBACK(child_sas, int,
{
printf("/%s", child->get(child, "dh-group"));
}
print_ake(child);
if (child->get(child, "esn"))
{
printf("/ESN");
@@ -290,6 +310,7 @@ CALLBACK(ike_sa, int,
}
printf("/%s", ike->get(ike, "prf-alg"));
printf("/%s", ike->get(ike, "dh-group"));
print_ake(ike);
if (streq(ike->get(ike, "ppk"), "yes"))
{
printf("/PPK");