Jelajahi Sumber

HPCC-22826 Crypto helper wants Digital Signatures configured

Incorrect logic checking for existence of public key file spec

Signed-off-by: Russ Whitehead <william.whitehead@lexisnexisrisk.com>
Russ Whitehead 5 tahun lalu
induk
melakukan
6546f38caf
2 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 1 1
      plugins/cryptolib/cryptolib.cpp
  2. 1 1
      system/security/cryptohelper/pke.cpp

+ 1 - 1
plugins/cryptolib/cryptolib.cpp

@@ -437,7 +437,7 @@ public:
         else
         {
             IDigitalSignatureManager * pDSM = nullptr;
-            if (!isEmptyString(pubKeyFS) && !isEmptyString(privKeyFS))
+            if (!isEmptyString(pubKeyFS) || !isEmptyString(privKeyFS))
                 pDSM = createDigitalSignatureManagerInstanceFromFiles(pubKeyFS, privKeyFS, passphrase);
             else
                 pDSM = createDigitalSignatureManagerInstanceFromKeys(pubKeyBuff, privKeyBuff, passphrase);

+ 1 - 1
system/security/cryptohelper/pke.cpp

@@ -82,7 +82,7 @@ public:
             throwEVPExceptionV(0, "loadKeyFromFile: failed to open key: %s", keyFile);
         RSA *rsaKey = PEM_read_bio_RSA_PUBKEY(keyBio, nullptr, nullptr, (void*)passPhrase);
         if (!rsaKey)
-            throwEVPExceptionV(0, "Failed to public create key: %s", keyFile);
+            throwEVPExceptionV(0, "Failed to create public key: %s", keyFile);
         finalize(rsaKey, keyFile);
     }
 };