Skip to content

Commit 43e4158

Browse files
Selim GurunAndroid (Google) Code Review
authored andcommitted
Revert "Act on credential storage updates."
This reverts commit fcd93b7
1 parent fcd93b7 commit 43e4158

File tree

4 files changed

+2
-80
lines changed

4 files changed

+2
-80
lines changed

core/java/android/net/http/CertificateChainValidator.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@
2525
import javax.net.ssl.SSLHandshakeException;
2626
import javax.net.ssl.SSLSession;
2727
import javax.net.ssl.SSLSocket;
28-
import javax.net.ssl.X509TrustManager;
2928
import org.apache.harmony.security.provider.cert.X509CertImpl;
3029
import org.apache.harmony.xnet.provider.jsse.SSLParametersImpl;
31-
import org.apache.harmony.xnet.provider.jsse.TrustManagerImpl;
3230

3331
/**
3432
* Class responsible for all server certificate validation functionality
3533
*
3634
* {@hide}
3735
*/
38-
public class CertificateChainValidator {
36+
class CertificateChainValidator {
3937

4038
/**
4139
* The singleton instance of the certificate chain validator
@@ -123,18 +121,6 @@ public static SslError verifyServerCertificates(
123121
return verifyServerDomainAndCertificates(serverCertificates, domain, authType);
124122
}
125123

126-
/**
127-
* Handles updates to credential storage.
128-
*/
129-
public static void handleTrustStorageUpdate() {
130-
131-
X509TrustManager x509TrustManager = SSLParametersImpl.getDefaultTrustManager();
132-
if( x509TrustManager instanceof TrustManagerImpl ) {
133-
TrustManagerImpl trustManager = (TrustManagerImpl) x509TrustManager;
134-
trustManager.handleTrustStorageUpdate();
135-
}
136-
}
137-
138124
/**
139125
* Common code of doHandshakeAndValidateServerCertificates and verifyServerCertificates.
140126
* Calls DomainNamevalidator to verify the domain, and TrustManager to verify the certs.

core/java/android/webkit/WebView.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
import android.os.StrictMode;
6060
import android.os.SystemClock;
6161
import android.provider.Settings;
62-
import android.security.KeyChain;
6362
import android.speech.tts.TextToSpeech;
6463
import android.text.Editable;
6564
import android.text.InputType;
@@ -1262,7 +1261,6 @@ protected WebView(Context context, AttributeSet attrs, int defStyle,
12621261
init();
12631262
setupPackageListener(context);
12641263
setupProxyListener(context);
1265-
setupTrustStorageListener(context);
12661264
updateMultiTouchSupport(context);
12671265

12681266
if (privateBrowsing) {
@@ -1272,41 +1270,6 @@ protected WebView(Context context, AttributeSet attrs, int defStyle,
12721270
mAutoFillData = new WebViewCore.AutoFillData();
12731271
}
12741272

1275-
private static class TrustStorageListener extends BroadcastReceiver {
1276-
@Override
1277-
public void onReceive(Context context, Intent intent) {
1278-
if (intent.getAction().equals(KeyChain.ACTION_STORAGE_CHANGED)) {
1279-
handleCertTrustChanged();
1280-
}
1281-
}
1282-
}
1283-
private static TrustStorageListener sTrustStorageListener;
1284-
1285-
/**
1286-
* Handles update to the trust storage.
1287-
*/
1288-
private static void handleCertTrustChanged() {
1289-
// send a message for indicating trust storage change
1290-
WebViewCore.sendStaticMessage(EventHub.TRUST_STORAGE_UPDATED, null);
1291-
}
1292-
1293-
/*
1294-
* @param context This method expects this to be a valid context.
1295-
*/
1296-
private static void setupTrustStorageListener(Context context) {
1297-
if (sTrustStorageListener != null ) {
1298-
return;
1299-
}
1300-
IntentFilter filter = new IntentFilter();
1301-
filter.addAction(KeyChain.ACTION_STORAGE_CHANGED);
1302-
sTrustStorageListener = new TrustStorageListener();
1303-
Intent current =
1304-
context.getApplicationContext().registerReceiver(sTrustStorageListener, filter);
1305-
if (current != null) {
1306-
handleCertTrustChanged();
1307-
}
1308-
}
1309-
13101273
private static class ProxyReceiver extends BroadcastReceiver {
13111274
@Override
13121275
public void onReceive(Context context, Intent intent) {

core/java/android/webkit/WebViewCore.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import android.media.MediaFile;
2727
import android.net.ProxyProperties;
2828
import android.net.Uri;
29-
import android.net.http.CertificateChainValidator;
3029
import android.os.Bundle;
3130
import android.os.Handler;
3231
import android.os.Looper;
@@ -768,11 +767,6 @@ public void handleMessage(Message msg) {
768767
Message m = (Message)msg.obj;
769768
m.sendToTarget();
770769
break;
771-
case EventHub.TRUST_STORAGE_UPDATED:
772-
// post a task to network thread for updating trust manager
773-
nativeCertTrustChanged();
774-
CertificateChainValidator.handleTrustStorageUpdate();
775-
break;
776770
}
777771
}
778772
};
@@ -1130,9 +1124,6 @@ public class EventHub {
11301124
static final int SELECT_WORD_AT = 214;
11311125
static final int SELECT_ALL = 215;
11321126

1133-
// for updating state on trust storage change
1134-
static final int TRUST_STORAGE_UPDATED = 220;
1135-
11361127
// Private handler for WebCore messages.
11371128
private Handler mHandler;
11381129
// Message queue for containing messages before the WebCore thread is
@@ -3063,6 +3054,4 @@ private native void nativeSelectText(int nativeClass,
30633054
private native void nativeClearTextSelection(int nativeClass);
30643055
private native void nativeSelectWordAt(int nativeClass, int x, int y);
30653056
private native void nativeSelectAll(int nativeClass);
3066-
3067-
private static native void nativeCertTrustChanged();
30683057
}

keystore/java/android/security/KeyChain.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public final class KeyChain {
124124
public static final String EXTRA_SENDER = "sender";
125125

126126
/**
127-
* Action to bring up the CertInstaller.
127+
* Action to bring up the CertInstaller
128128
*/
129129
private static final String ACTION_INSTALL = "android.credentials.INSTALL";
130130

@@ -167,22 +167,6 @@ public final class KeyChain {
167167
// Compatible with old android.security.Credentials.PKCS12
168168
public static final String EXTRA_PKCS12 = "PKCS12";
169169

170-
171-
/**
172-
* @hide TODO This is temporary and will be removed
173-
* Broadcast Action: Indicates the trusted storage has changed. Sent when
174-
* one of this happens:
175-
*
176-
* <ul>
177-
* <li>a new CA is added,
178-
* <li>an existing CA is removed or disabled,
179-
* <li>a disabled CA is enabled,
180-
* <li>trusted storage is reset (all user certs are cleared),
181-
* <li>when permission to access a private key is changed.
182-
* </ul>
183-
*/
184-
public static final String ACTION_STORAGE_CHANGED = "android.security.STORAGE_CHANGED";
185-
186170
/**
187171
* Returns an {@code Intent} that can be used for credential
188172
* installation. The intent may be used without any extras, in

0 commit comments

Comments
 (0)