From d2a3455bc8907da4c187ce59ac58125be929afaa Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Wed, 10 Aug 2016 14:01:16 +0100 Subject: [PATCH] [JENKINS-37302] Give up faster when we are unlucky --- src/main/java/org/jenkinsci/remoting/engine/Jnlp3Util.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jenkinsci/remoting/engine/Jnlp3Util.java b/src/main/java/org/jenkinsci/remoting/engine/Jnlp3Util.java index 05b0be67f..e0ce157ce 100644 --- a/src/main/java/org/jenkinsci/remoting/engine/Jnlp3Util.java +++ b/src/main/java/org/jenkinsci/remoting/engine/Jnlp3Util.java @@ -86,7 +86,7 @@ public static byte[] keyFromString(String keyString) { public static String generateChallenge() { try { MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); - outer: for (int tries = 0; tries < 256; tries++) { + outer: for (int tries = 0; tries < 10; tries++) { String challenge = new BigInteger(10400, new SecureRandom()).toString(32); // JENKINS-37302 we need to validate that this is a challenge that can be round-tripped