diff --git a/core/src/main/java/hudson/model/UsageStatistics.java b/core/src/main/java/hudson/model/UsageStatistics.java index 8800d9764a..8de447e302 100644 --- a/core/src/main/java/hudson/model/UsageStatistics.java +++ b/core/src/main/java/hudson/model/UsageStatistics.java @@ -226,8 +226,8 @@ public class UsageStatistics extends PageDecorator { super.in = new CipherInputStream(in,sym); } - public CombinedCipherInputStream(InputStream in, RSAKey key, String algorithm, int keyLength) throws IOException, GeneralSecurityException { - this(in,toCipher(key,Cipher.DECRYPT_MODE),algorithm,keyLength); + public CombinedCipherInputStream(InputStream in, RSAKey key, String algorithm) throws IOException, GeneralSecurityException { + this(in,toCipher(key,Cipher.DECRYPT_MODE),algorithm,key.getModulus().bitLength()); } } diff --git a/test/src/test/java/hudson/model/UsageStatisticsTest.java b/test/src/test/java/hudson/model/UsageStatisticsTest.java index 9acc9a4dda..38cbe50477 100644 --- a/test/src/test/java/hudson/model/UsageStatisticsTest.java +++ b/test/src/test/java/hudson/model/UsageStatisticsTest.java @@ -57,7 +57,7 @@ public class UsageStatisticsTest extends HudsonTestCase { byte[] cipherText = Base64.decode(data.toCharArray()); InputStreamReader r = new InputStreamReader(new GZIPInputStream( - new CombinedCipherInputStream(new ByteArrayInputStream(cipherText),priv,"AES",1024)), "UTF-8"); + new CombinedCipherInputStream(new ByteArrayInputStream(cipherText),priv,"AES")), "UTF-8"); JSONObject o = JSONObject.fromObject(IOUtils.toString(r)); System.out.println(o); assertEquals(1,o.getInt("stat"));