From 206f565820957385672ab164d455fa0667961c40 Mon Sep 17 00:00:00 2001 From: toddouska Date: Tue, 18 Sep 2012 09:34:45 -0700 Subject: [PATCH] add password to snifftest command line --- sslSniffer/sslSnifferTest/snifftest.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sslSniffer/sslSnifferTest/snifftest.c b/sslSniffer/sslSnifferTest/snifftest.c index a132538b6..8114e17b8 100755 --- a/sslSniffer/sslSnifferTest/snifftest.c +++ b/sslSniffer/sslSnifferTest/snifftest.c @@ -217,6 +217,7 @@ int main(int argc, char** argv) ret = -1; } else { + const char* passwd = NULL; /* defaults for server and port */ port = 443; server = "127.0.0.1"; @@ -227,14 +228,17 @@ int main(int argc, char** argv) if (argc >= 5) port = atoi(argv[4]); + if (argc >= 6) + passwd = argv[5]; + ret = ssl_SetPrivateKey(server, port, argv[2], - FILETYPE_PEM, NULL, err); + FILETYPE_PEM, passwd, err); } } else { /* usage error */ - printf( - "usage: ./snifftest or ./snifftest dump pemKey [server] [port]\n"); + printf( "usage: ./snifftest or ./snifftest dump pemKey" + " [server] [port] [password]\n"); exit(EXIT_FAILURE); }