Skip to content

Commit

Permalink
#443 : Better handling of null value in SecurityCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Jun 7, 2018
1 parent 7ce3ead commit d4639b8
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -123,7 +123,7 @@ private static boolean checkRpkIdentity(String endpoint, Identity clientIdentity
if (LOG.isDebugEnabled()) {
LOG.debug("Invalid rpk for client {}: expected \n'{}'\n but was \n'{}'", endpoint,
Hex.encodeHexString(securityInfo.getRawPublicKey().getEncoded()),
Hex.encodeHexString(publicKey.getEncoded()));
publicKey != null ? Hex.encodeHexString(publicKey.getEncoded()) : "null");
}
return false;
} else {
Expand All @@ -142,7 +142,7 @@ private static boolean checkX509Identity(String endpoint, Identity clientIdentit
return false;
}

if (!x509CommonName.equals(endpoint)) {
if (x509CommonName == null || !x509CommonName.equals(endpoint)) {
LOG.debug("Invalid certificate common name for client '{}': expected \n'{}'\n but was \n'{}'", endpoint,
endpoint, x509CommonName);
return false;
Expand Down

0 comments on commit d4639b8

Please sign in to comment.