]> granicus.if.org Git - pdns/commitdiff
pdnsutil: Fix messages for generate-tsig-key
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 31 Oct 2017 13:05:56 +0000 (14:05 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 31 Oct 2017 13:05:56 +0000 (14:05 +0100)
Closes #5849

pdns/pdnsutil.cc

index 50e7d7600b1b2163db4aa4aa0d8261b09a357bf0..eb0e7b7101f5262b55bae1407475f96bbe96d321 100644 (file)
@@ -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);
      }