Account for null client certificate
If a null certificate is passed to setClientKeyEntry() we should
not pass a non-null array with a single null element to the
setClientKeyEntryWithCertificateChain helper method. Instead we
should pass a null array.
Cherry-pick of 410a3498ac
Bug: 34765004
Test: cts-tradefed run cts -d --module CtsNetTestCases --test android.net.wifi.cts.WifiEnterpriseConfigTest
Change-Id: I02793b4b29bc7325f98833c58bf652ba68353827
This commit is contained in:
@@ -752,8 +752,11 @@ public class WifiEnterpriseConfig implements Parcelable {
|
||||
* @throws IllegalArgumentException for an invalid key or certificate.
|
||||
*/
|
||||
public void setClientKeyEntry(PrivateKey privateKey, X509Certificate clientCertificate) {
|
||||
setClientKeyEntryWithCertificateChain(privateKey,
|
||||
new X509Certificate[] {clientCertificate});
|
||||
X509Certificate[] clientCertificates = null;
|
||||
if (clientCertificate != null) {
|
||||
clientCertificates = new X509Certificate[] {clientCertificate};
|
||||
}
|
||||
setClientKeyEntryWithCertificateChain(privateKey, clientCertificates);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user