]> granicus.if.org Git - pdns/commitdiff
Make the string parameter to testCrypto() optional.
authorRemi Gacogne <rgacogne-github@coredump.fr>
Tue, 8 Dec 2015 17:19:34 +0000 (18:19 +0100)
committerRemi Gacogne <rgacogne-github@coredump.fr>
Tue, 8 Dec 2015 17:19:34 +0000 (18:19 +0100)
The documentation does not mention it and I don't think it makes
sense to require one.
Document the fact that makeKey() does return setKey('plaintext')
without libsodium support.
Reported by Charles-Henri Bruyand.

pdns/README-dnsdist.md
pdns/dnsdist-lua.cc

index fefe3791c32a3a24a9c846e8c5e30a7afb2c1098..546c048aaccab88c8f3c514f80ffe8e220a7d829 100644 (file)
@@ -505,6 +505,10 @@ Then start `dnsdist` as a daemon, and then connect to it:
 > 
 ```
 
+Please note that, without libsodium support, 'makeKey()' will return
+setKey("plaintext") and the communication between the client and the
+server will not be encrypted.
+
 ACL, who can use dnsdist
 ------------------------
 For safety reasons, by default only private networks can use dnsdist, see below
index 91983ee5c31b2a3db70ada03e2315a3d3d080766..02128824bcda7cb470f8e6d22405b8ef721b0960 100644 (file)
@@ -876,9 +876,18 @@ vector<std::function<void(void)>> setupLua(bool client, const std::string& confi
     });
 
   
-  g_lua.writeFunction("testCrypto", [](string testmsg)
+  g_lua.writeFunction("testCrypto", [](boost::optional<string> optTestMsg)
    {
      try {
+       string testmsg;
+
+       if (optTestMsg) {
+         testmsg = *optTestMsg;
+       }
+       else {
+         testmsg = "testStringForCryptoTests";
+       }
+
        SodiumNonce sn, sn2;
        sn.init();
        sn2=sn;