]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Make sure PIN is always set to at least empty
authorAki Tuomi <cmouse@cmouse.fi>
Sun, 17 May 2015 15:07:41 +0000 (18:07 +0300)
committerAki Tuomi <cmouse@cmouse.fi>
Sun, 17 May 2015 15:10:33 +0000 (18:10 +0300)
pdns/dnssecinfra.cc

index 078159a68fa8345ce035b129cc488eec4eea59b1..3dcfb71b6eaba7ba24c5c4d9c581ea0e7682a9a5 100644 (file)
@@ -80,6 +80,10 @@ DNSCryptoKeyEngine* DNSCryptoKeyEngine::makeFromISCString(DNSKEYRecordContent& d
 
   if (pkcs11) {
 #ifdef HAVE_P11KIT1
+    if (stormap.find("slot") == stormap.end())
+      throw PDNSException("Cannot load PKCS#11 key, no Slot specified");
+    // we need PIN to be at least empty
+    if (stormap.find("pin") == stormap.end()) stormap["pin"] = "";
     dpk = PKCS11DNSCryptoKeyEngine::maker(algorithm); 
 #else
     throw PDNSException("Cannot load PKCS#11 key without support for it");