vici: Clear cached strings in case the message contained shared secrets

This commit is contained in:
Tobias Brunner
2021-10-04 11:30:03 +02:00
parent 66e80f3d1b
commit 4bea9e8b60
+8 -1
View File
@@ -644,6 +644,13 @@ METHOD(vici_message_t, dump, bool,
return FALSE;
}
CALLBACK(clear_strings, void,
char *str)
{
memwipe(str, strlen(str));
free(str);
}
METHOD(vici_message_t, destroy, void,
private_vici_message_t *this)
{
@@ -651,7 +658,7 @@ METHOD(vici_message_t, destroy, void,
{
chunk_clear(&this->encoding);
}
this->strings->destroy_function(this->strings, free);
this->strings->destroy_function(this->strings, clear_strings);
free(this);
}