Skip to content

Commit

Permalink
Merge pull request #2749 from jglick/JnlpSlaveAgentProtocol4-robustness
Browse files Browse the repository at this point in the history
[FIXED JENKINS-41987] Check for null return values from InstanceIdentityProvider methods
  • Loading branch information
jglick committed Feb 17, 2017
2 parents 532156e + dbf5efa commit 2f92482
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -101,7 +101,13 @@ public class JnlpSlaveAgentProtocol4 extends AgentProtocol {
public JnlpSlaveAgentProtocol4() throws KeyStoreException, KeyManagementException, IOException {
// prepare our local identity and certificate
X509Certificate identityCertificate = InstanceIdentityProvider.RSA.getCertificate();
if (identityCertificate == null) {
throw new KeyStoreException("JENKINS-41987: no X509Certificate found; perhaps instance-identity module is missing or too old");
}
RSAPrivateKey privateKey = InstanceIdentityProvider.RSA.getPrivateKey();
if (privateKey == null) {
throw new KeyStoreException("JENKINS-41987: no RSAPrivateKey found; perhaps instance-identity module is missing or too old");
}

// prepare our keyStore so we can provide our authentication
keyStore = KeyStore.getInstance("JKS");
Expand Down

0 comments on commit 2f92482

Please sign in to comment.