Skip to content

Commit 8eb83b9

Browse files
author
Steve Block
committed
Modify BrowserFrame.requestClientCert() to take the host and port as a String
Currently we get the host and port from Chromium as a std::string, convert to a jbyte array to pass over JNI, then convert to String. It's simpler to convert directly to jstring and to pass that over JNI. Requires https://android-git.corp.google.com/g/141234 in external/webkit. Bug: 5442710 Change-Id: I5480471a841c24481ef09d836a8b0c778251b119
1 parent 99f3668 commit 8eb83b9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

core/java/android/webkit/BrowserFrame.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,22 +1204,20 @@ public void cancel() {
12041204
* We delegate the request to CallbackProxy, and route its response to
12051205
* {@link #nativeSslClientCert(int, X509Certificate)}.
12061206
*/
1207-
private void requestClientCert(int handle, byte[] host_and_port_bytes) {
1208-
String host_and_port = new String(host_and_port_bytes, Charsets.UTF_8);
1207+
private void requestClientCert(int handle, String hostAndPort) {
12091208
SslClientCertLookupTable table = SslClientCertLookupTable.getInstance();
1210-
if (table.IsAllowed(host_and_port)) {
1209+
if (table.IsAllowed(hostAndPort)) {
12111210
// previously allowed
12121211
nativeSslClientCert(handle,
1213-
table.PrivateKey(host_and_port),
1214-
table.CertificateChain(host_and_port));
1215-
} else if (table.IsDenied(host_and_port)) {
1212+
table.PrivateKey(hostAndPort),
1213+
table.CertificateChain(hostAndPort));
1214+
} else if (table.IsDenied(hostAndPort)) {
12161215
// previously denied
12171216
nativeSslClientCert(handle, null, null);
12181217
} else {
12191218
// previously ignored or new
12201219
mCallbackProxy.onReceivedClientCertRequest(
1221-
new ClientCertRequestHandler(this, handle, host_and_port, table),
1222-
host_and_port);
1220+
new ClientCertRequestHandler(this, handle, hostAndPort, table), hostAndPort);
12231221
}
12241222
}
12251223

0 commit comments

Comments
 (0)