From: Martin Willi Date: Tue, 6 May 2014 09:10:05 +0000 (+0200) Subject: vici: Log owners of a just loaded shared-secret X-Git-Tag: 5.2.0dr3~9^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2b6402eb0b26dcf173b21389045ad72e00749d9;p=thirdparty%2Fstrongswan.git vici: Log owners of a just loaded shared-secret --- diff --git a/src/libcharon/plugins/vici/vici_cred.c b/src/libcharon/plugins/vici/vici_cred.c index 2a9231dfee..cc6434b624 100644 --- a/src/libcharon/plugins/vici/vici_cred.c +++ b/src/libcharon/plugins/vici/vici_cred.c @@ -207,7 +207,10 @@ CALLBACK(load_shared, vici_message_t*, shared_key_type_t type; linked_list_t *owners; chunk_t data; - char *str; + char *str, buf[512] = ""; + enumerator_t *enumerator; + identification_t *owner; + int len; str = message->get_str(message, NULL, "type"); if (!str) @@ -243,7 +246,20 @@ CALLBACK(load_shared, vici_message_t*, owners->insert_last(owners, identification_create_from_string("%any")); } - DBG1(DBG_CFG, "loaded %N shared key", shared_key_type_names, type); + enumerator = owners->create_enumerator(owners); + while (enumerator->enumerate(enumerator, &owner)) + { + len = strlen(buf); + if (len < sizeof(buf)) + { + snprintf(buf + len, sizeof(buf) - len, "%s'%Y'", + len ? ", " : "", owner); + } + } + enumerator->destroy(enumerator); + + DBG1(DBG_CFG, "loaded %N shared key for: %s", + shared_key_type_names, type, buf); this->creds->add_shared_list(this->creds, shared_key_create(type, chunk_clone(data)), owners);