summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-10-12 09:51:22 +0100
committerSteve Block <steveblock@google.com>2011-10-12 09:51:22 +0100
commit8eb83b96ac75bf1d83147b2f2708a4398bae78bb (patch)
tree40c73ed19d51bb32a96df537b5da454e9c04db7f
parent99f36683a4f2c218d52922ae7c2a0c0b3f2890ed (diff)
downloadframeworks_base-8eb83b96ac75bf1d83147b2f2708a4398bae78bb.zip
frameworks_base-8eb83b96ac75bf1d83147b2f2708a4398bae78bb.tar.gz
frameworks_base-8eb83b96ac75bf1d83147b2f2708a4398bae78bb.tar.bz2
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
-rw-r--r--core/java/android/webkit/BrowserFrame.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index c8b67a8..2cc928f 100644
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -1204,22 +1204,20 @@ class BrowserFrame extends Handler {
* We delegate the request to CallbackProxy, and route its response to
* {@link #nativeSslClientCert(int, X509Certificate)}.
*/
- private void requestClientCert(int handle, byte[] host_and_port_bytes) {
- String host_and_port = new String(host_and_port_bytes, Charsets.UTF_8);
+ private void requestClientCert(int handle, String hostAndPort) {
SslClientCertLookupTable table = SslClientCertLookupTable.getInstance();
- if (table.IsAllowed(host_and_port)) {
+ if (table.IsAllowed(hostAndPort)) {
// previously allowed
nativeSslClientCert(handle,
- table.PrivateKey(host_and_port),
- table.CertificateChain(host_and_port));
- } else if (table.IsDenied(host_and_port)) {
+ table.PrivateKey(hostAndPort),
+ table.CertificateChain(hostAndPort));
+ } else if (table.IsDenied(hostAndPort)) {
// previously denied
nativeSslClientCert(handle, null, null);
} else {
// previously ignored or new
mCallbackProxy.onReceivedClientCertRequest(
- new ClientCertRequestHandler(this, handle, host_and_port, table),
- host_and_port);
+ new ClientCertRequestHandler(this, handle, hostAndPort, table), hostAndPort);
}
}