summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-06-05 09:39:49 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-06-05 13:04:55 +0000
commit17c6848ad68266a50f53f3ecb572a2c30774ddfe (patch)
tree4404a213c2f867350a527b51f56337a95fa20df9
parent4feb42dc7a709272d6c198a21cbdeee7ebe27293 (diff)
downloadgnutls-17c6848ad68266a50f53f3ecb572a2c30774ddfe.tar.gz
psktool: do not assume any default key file
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--src/psk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/psk.c b/src/psk.c
index 52c90edb29..4867ba863b 100644
--- a/src/psk.c
+++ b/src/psk.c
@@ -59,7 +59,6 @@ int main(int argc, char **argv)
static int write_key(const char *username, const char *key, int key_size,
const char *passwd_file);
-#define KPASSWD "/etc/passwd.psk"
#define MAX_KEY_SIZE 64
int main(int argc, char **argv)
{
@@ -85,9 +84,10 @@ int main(int argc, char **argv)
argc -= optct;
argv += optct;
- if (!HAVE_OPT(PSKFILE))
- passwd = (char *) KPASSWD;
- else
+ if (!HAVE_OPT(PSKFILE)) {
+ fprintf(stderr, "You need to specify a PSK key file\n");
+ exit(1);
+ } else
passwd = OPT_ARG(PSKFILE);
if (!HAVE_OPT(USERNAME)) {