Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca731c5c authored by Steve Block's avatar Steve Block Committed by Android Git Automerger
Browse files

am c0c394ee: Merge "Modify BrowserFrame.requestClientCert() to take the host...

am c0c394ee: Merge "Modify BrowserFrame.requestClientCert() to take the host and port as a String" into ics-mr0

* commit 'c0c394ee':
  Modify BrowserFrame.requestClientCert() to take the host and port as a String
parents b10d396f c0c394ee
Loading
Loading
Loading
Loading
+6 −8
Original line number Original line Diff line number Diff line
@@ -1204,22 +1204,20 @@ class BrowserFrame extends Handler {
     * We delegate the request to CallbackProxy, and route its response to
     * We delegate the request to CallbackProxy, and route its response to
     * {@link #nativeSslClientCert(int, X509Certificate)}.
     * {@link #nativeSslClientCert(int, X509Certificate)}.
     */
     */
    private void requestClientCert(int handle, byte[] host_and_port_bytes) {
    private void requestClientCert(int handle, String hostAndPort) {
        String host_and_port = new String(host_and_port_bytes, Charsets.UTF_8);
        SslClientCertLookupTable table = SslClientCertLookupTable.getInstance();
        SslClientCertLookupTable table = SslClientCertLookupTable.getInstance();
        if (table.IsAllowed(host_and_port)) {
        if (table.IsAllowed(hostAndPort)) {
            // previously allowed
            // previously allowed
            nativeSslClientCert(handle,
            nativeSslClientCert(handle,
                                table.PrivateKey(host_and_port),
                                table.PrivateKey(hostAndPort),
                                table.CertificateChain(host_and_port));
                                table.CertificateChain(hostAndPort));
        } else if (table.IsDenied(host_and_port)) {
        } else if (table.IsDenied(hostAndPort)) {
            // previously denied
            // previously denied
            nativeSslClientCert(handle, null, null);
            nativeSslClientCert(handle, null, null);
        } else {
        } else {
            // previously ignored or new
            // previously ignored or new
            mCallbackProxy.onReceivedClientCertRequest(
            mCallbackProxy.onReceivedClientCertRequest(
                    new ClientCertRequestHandler(this, handle, host_and_port, table),
                    new ClientCertRequestHandler(this, handle, hostAndPort, table), hostAndPort);
                    host_and_port);
        }
        }
    }
    }