From bacb7628252fe16f07dd1649d66ada0f81df4192 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Tue, 31 Oct 2017 14:05:56 +0100 Subject: [PATCH] pdnsutil: Fix messages for generate-tsig-key Closes #5849 --- pdns/pdnsutil.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 50e7d7600..eb0e7b710 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -2683,8 +2683,9 @@ try cout << "Flags: " << dspk.d_flags << endl << dspk.getKey()->convertToISC() << endl; } else if (cmds[0]=="generate-tsig-key") { + string usage = "Syntax: " + cmds[0] + " name (hmac-md5|hmac-sha1|hmac-sha224|hmac-sha256|hmac-sha384|hmac-sha512)"; if (cmds.size() < 3) { - cerr << "Syntax: " << cmds[0] << " name (hmac-md5|hmac-sha1|hmac-sha224|hmac-sha256|hmac-sha384|hmac-sha512)" << endl; + cerr << usage << endl; return 0; } DNSName name(cmds[1]); @@ -2707,10 +2708,11 @@ try klen = 64; } else { cerr << "Cannot generate key for " << algo << endl; + cerr << usage << endl; return 1; } - cerr << "Generating new key with " << klen << " bytes (this can take a while)" << endl; + cerr << "Generating new key with " << klen << " bytes" << endl; for(size_t i = 0; i < klen; i+=4) { *(unsigned int*)(tmpkey+i) = dns_random(0xffffffff); } -- 2.40.0