forked from osmocom/wireshark
sharkd: support exporting ssl secrets
Change-Id: Ie7db733d8aa7189b1ade6ef85d911653ed8c490f Reviewed-on: https://code.wireshark.org/review/20703 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
572b80d283
commit
2de68eb47f
|
@ -43,6 +43,8 @@
|
|||
|
||||
#include <epan/column.h>
|
||||
|
||||
#include <ui/ssl_key_export.h>
|
||||
|
||||
#include <epan/stats_tree_priv.h>
|
||||
#include <epan/stat_tap_ui.h>
|
||||
#include <epan/conversation_table.h>
|
||||
|
@ -2831,6 +2833,25 @@ sharkd_session_process_download(char *buf, const jsmntok_t *tokens, int count)
|
|||
printf("}\n");
|
||||
}
|
||||
}
|
||||
else if (!strcmp(tok_token, "ssl-secrets"))
|
||||
{
|
||||
char *str = ssl_export_sessions();
|
||||
|
||||
if (str)
|
||||
{
|
||||
const char *mime = "text/plain";
|
||||
const char *filename = "keylog.txt";
|
||||
|
||||
printf("{\"file\":");
|
||||
json_puts_string(filename);
|
||||
printf(",\"mime\":");
|
||||
json_puts_string(mime);
|
||||
printf(",\"data\":");
|
||||
json_print_base64(str, strlen(str));
|
||||
printf("}\n");
|
||||
}
|
||||
g_free(str);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue