提交 c072b3cb 编写于 作者: K Kohsuke Kawaguchi

key length can be obtained from the key

上级 eb19a453
......@@ -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());
}
}
......
......@@ -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"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册