Test passing null cert/keys to WifiEnterpriseConfig

Ensure that null certificates and keys don't crash.

Bug: 34765004
Test: This is a test
Change-Id: I439b4f985c1b88ad4a9b58ee6f4eb4f90bd81246
This commit is contained in:
Paul Stewart
2017-01-27 12:03:47 -08:00
parent 1ca57a1d10
commit 88b3c589ad

View File

@@ -86,6 +86,16 @@ public class WifiEnterpriseConfigTest {
assertTrue(result[0] == cert0 && result[1] == cert1);
}
@Test
public void testSetClientKeyEntryWithNull() {
mEnterpriseConfig.setClientKeyEntry(null, null);
assertEquals(null, mEnterpriseConfig.getClientCertificateChain());
assertEquals(null, mEnterpriseConfig.getClientCertificate());
mEnterpriseConfig.setClientKeyEntryWithCertificateChain(null, null);
assertEquals(null, mEnterpriseConfig.getClientCertificateChain());
assertEquals(null, mEnterpriseConfig.getClientCertificate());
}
@Test
public void testSetClientCertificateChain() {
PrivateKey clientKey = FakeKeys.RSA_KEY1;