Stop scrubbing @NoPresubmitTest annotation to make it easier to import external changes.

Also fixing a typo in Java transformation rules.

PiperOrigin-RevId: 199870545
GitOrigin-RevId: b2bf283c8f782205598503e14b0f13278ac0b4db
This commit is contained in:
Thai Duong
2018-06-08 16:43:12 -07:00
committed by Tink Team
parent b9b3b2119c
commit 2904be69e9
9 changed files with 78 additions and 0 deletions
@@ -409,6 +409,10 @@ public class AesGcmTest {
}
/** Encryption and decryption with large arrays should be copy-safe. */
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"b/64378943"}
)
@Test
public void testLargeArrayAlias() throws Exception {
byte[] ptVector = new byte[8192];
@@ -484,6 +488,10 @@ public class AesGcmTest {
*
* @see https://bugs.openjdk.java.net/browse/JDK-8181386
*/
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE, ProviderType.OPENJDK},
bugs = {"b/64378943"}
)
@Test
public void testByteBufferShiftedAlias() throws Exception {
byte[] ptVector = new byte[8192];
@@ -349,6 +349,10 @@ public class DhTest {
* https://docs.oracle.com/javase/7/docs/api/java/security/KeyPairGenerator.html an implementation
* of the Java platform is only required to support 1024 bit keys.
*/
@NoPresubmitTest(
providers = {ProviderType.OPENJDK, ProviderType.BOUNCY_CASTLE},
bugs = {"b/33190860", "b/33190677"}
)
@SlowTest(providers = {ProviderType.BOUNCY_CASTLE, ProviderType.SPONGY_CASTLE})
@Test
public void testDefaultKeyPairGenerator() throws Exception {
@@ -187,10 +187,19 @@ public class DhiesTest {
* <li>CVE-2016-1000344 BouncyCaslte before v.1.56 used ECB mode as a default.
* </ul>
*/
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"b/31101111: won't fix, all BC DHIES modes are banned"}
)
@Test
public void testSemanticSecurityDhiesWithAes() throws Exception {
testNotEcb("DHIESWithAES");
}
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"b/31101111: won't fix, all BC DHIES modes are banned"}
)
@Test
public void testSemanticSecurityDhiesWithDesede() throws Exception {
testNotEcb("DHIESWITHDESEDE");
@@ -917,6 +917,10 @@ public class DsaTest {
* https://docs.oracle.com/javase/7/docs/api/java/security/KeyPairGenerator.html only requires
* that 1024 bits are supported.
*/
@NoPresubmitTest(
providers = {ProviderType.OPENJDK, ProviderType.BOUNCY_CASTLE},
bugs = {"b/33190860", "b/33190677"}
)
@Test
public void testDefaultKeySize() throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA");
@@ -1888,6 +1888,11 @@ public static final EcPublicKeyTestVector EC_VALID_PUBLIC_KEY =
}
}
}
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"BouncyCastle uses long encoding. Is this a bug?"}
)
@Test
public void testEncode() throws Exception {
KeyFactory kf = KeyFactory.getInstance("EC");
@@ -2209,6 +2214,11 @@ public static final EcPublicKeyTestVector EC_VALID_PUBLIC_KEY =
// testLargePrivateKey(EcUtil.getNistP521Params());
testLargePrivateKey(EcUtil.getBrainpoolP256r1Params());
}
@NoPresubmitTest(
providers = {ProviderType.OPENJDK},
bugs = {"CVE-2017-10176"}
)
@Test
public void testLargePrivateKeyNoPresubmit() throws Exception {
testLargePrivateKey(EcUtil.getNistP521Params());
@@ -208,6 +208,11 @@ public class EciesTest {
public void testEciesCorruptDefault() throws Exception {
testExceptions("ECIES");
}
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"b/30424901: won't fix, all BC ECIES modes are banned"}
)
@Test
public void testEciesCorruptAesCbc() throws Exception {
testExceptions("ECIESWithAES-CBC");
@@ -283,11 +288,19 @@ public class EciesTest {
}
/** BouncyCastle v1.52 uses ECB as default for ECIES with AES. */
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"b/30424901: won't fix, all BC ECIES modes are banned"}
)
@Test
public void testDefaultEciesWithAes() throws Exception {
testNotEcb("ECIESWithAES");
}
/** BouncyCastle v1.52 uses ECB as default for ECIES with DESede. */
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"b/30424901: won't fix, all BC ECIES modes are banned"}
)
@Test
public void testDefaultEciesWithDESede() throws Exception {
testNotEcb("ECIESwithDESede");
@@ -341,6 +354,10 @@ public class EciesTest {
* Encryption with ByteBuffers. This currently fails with BouncyCastle. Possibly this is the same
* bug as http://www.bouncycastle.org/jira/browse/BJA-577 and should be fixed in version 1.53.
*/
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"b/30424901: won't fix, all BC ECIES modes are banned"}
)
@Test
public void testByteBuffer() throws Exception {
ECGenParameterSpec ecSpec = new ECGenParameterSpec("secp256r1");
@@ -375,6 +392,10 @@ public class EciesTest {
*
* <p>This test tries to verify this.
*/
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"b/30424901: won't fix, all BC ECIES modes are banned"}
)
@Test
public void testByteBufferAlias() throws Exception {
byte[] message = "Hello".getBytes("UTF-8");
@@ -233,10 +233,20 @@ public class JsonKeyWrapTest {
assertEquals(1, exceptions.size());
}
}
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"b/77572633"}
)
@Test
public void testAesWrap() throws Exception {
testKeywrap("kw_test.json", "AESWRAP", "HMACSHA256", false);
}
@NoPresubmitTest(
providers = {ProviderType.BOUNCY_CASTLE},
bugs = {"b/77572633"}
)
@Test
public void testAesRFC5649Wrap() throws Exception {
testKeywrap("kwp_test.json", "AESRFC5649WRAP", "HMACSHA256", false);
@@ -332,6 +332,10 @@ public class JsonSignatureTest {
}
// Testing DSA signatures.
@NoPresubmitTest(
providers = {ProviderType.OPENJDK},
bugs = {"b/33446454"}
)
@ExcludedTest(
providers = {ProviderType.CONSCRYPT},
comment = "Conscrypt does not support DSA.")
@@ -1536,6 +1536,10 @@ public class RsaKeyTest {
* implementation of the Java platform is required to implement RSA with both 1024 and 2048 bit
* key sizes. Hence a 2048 bit default should not lead to compatibility problems.
*/
@NoPresubmitTest(
providers = {ProviderType.OPENJDK},
bugs = {"b/33190530"}
)
@Test
public void testDefaultKeySize() throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
@@ -1640,6 +1644,10 @@ public class RsaKeyTest {
};
// TODO(bleichen): This test is only needed as long as there are open issues.
@NoPresubmitTest(
providers = {ProviderType.OPENJDK},
bugs = {"b/32656910"}
)
@Test
public void testProblematicPublicKeyDecoding() throws Exception {
KeyFactory kf = KeyFactory.getInstance("RSA");