Skip to content

Commit 83c1e39

Browse files
committed
Only try to load the keys if a filename is provided
1 parent 92c93ef commit 83c1e39

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clarcnet.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,10 @@ namespace clarcnet {
481481
if (!flog) throw runtime_error("Unable to open log file " + logfile);
482482
}
483483

484-
public_key = load_key(true, pubkeyfile);
485-
private_key = load_key(false, prvkeyfile);
486-
cphr = (public_key && private_key) ? cipher_t : EVP_enc_null();
484+
if (!pubkeyfile.empty()) public_key = load_key(true, pubkeyfile);
485+
if (!prvkeyfile.empty()) private_key = load_key(false, prvkeyfile);
486+
487+
cphr = (public_key && private_key) ? cipher_t : EVP_enc_null();
487488

488489
int err;
489490
addrinfo hints = {}, *res;

0 commit comments

Comments
 (0)