From 458f525e7dbf1dfa6d66726112e625d243e709c5 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Tue, 14 May 2024 19:07:12 +0200 Subject: [PATCH] Fix null check for public key parameter. --- .../sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hierynomus/sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java b/src/main/java/com/hierynomus/sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java index 5e4e3260..97a885e2 100644 --- a/src/main/java/com/hierynomus/sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java +++ b/src/main/java/com/hierynomus/sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java @@ -121,7 +121,7 @@ public void init(File location, PasswordFinder pwdf) { @Override public void init(String privateKey, String publicKey, PasswordFinder pwdf) { - if (pubKey != null) { + if (publicKey != null) { try { initPubKey(new StringReader(publicKey)); } catch (IOException e) { @@ -133,7 +133,7 @@ public void init(String privateKey, String publicKey, PasswordFinder pwdf) { @Override public void init(Reader privateKey, Reader publicKey, PasswordFinder pwdf) { - if (pubKey != null) { + if (publicKey != null) { try { initPubKey(publicKey); } catch (IOException e) {