Commit 44d54c7a authored by Dana Keeler's avatar Dana Keeler Committed by dkeeler@mozilla.com
Browse files

Bug 1966033 - pass the list of acceptable issuers through to the android API...

Bug 1966033 - pass the list of acceptable issuers through to the android API for client auth certs r=jschanck,geckoview-reviewers,geckoview-api-reviewers,ohall,owlish

Differential Revision: https://phabricator.services.mozilla.com/D249184
parent 6efc2103
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ let expectingChooseCertificate = false;
let chooseCertificateCalled = false;

const clientAuthDialogService = {
  chooseCertificate(hostname, certArray, loadContext, callback) {
  chooseCertificate(hostname, certArray, loadContext, caNames, callback) {
    ok(
      expectingChooseCertificate,
      `${
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSe

        geckoEngineSession.notifyObservers {
            onPromptRequest(
                PromptRequest.CertificateRequest(request.host, onComplete),
                PromptRequest.CertificateRequest(request.host, request.issuers, onComplete),
            )
        }

+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ import mozilla.components.concept.storage.Address
import mozilla.components.concept.storage.CreditCardEntry
import mozilla.components.concept.storage.Login
import mozilla.components.concept.storage.LoginEntry
import java.security.Principal
import java.util.UUID

/**
@@ -101,11 +102,13 @@ sealed class PromptRequest(
    /**
     * Value type that represents a request for a client authentication certificate prompt.
     * @property host the domain (or IP address) that requested the certificate.
     * @property issuers array of X.500 Distinguished Names identified as acceptable issuers.
     * @property onComplete callback that is called with the chosen certificate alias (or null if
     * none was chosen) when the user deals with the prompt.
     */
    data class CertificateRequest(
        val host: String,
        val issuers: Array<Principal>?,
        val onComplete: (String?) -> Unit,
    ) : PromptRequest()

+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ internal class CertificatePicker(
            container.context as Activity,
            { alias -> promptRequest.onComplete(alias) },
            arrayOf("RSA", "EC"), // keyTypes
            null, // issuers - currently not supported
            promptRequest.issuers, // array of acceptable X.500 issuer Distinguished Names
            promptRequest.host, // the host that requested the certificate
            -1, // specify the default port to simplify the UI
            null, // alias - leave null for now to not preselect a certificate
+1 −1
Original line number Diff line number Diff line
@@ -3347,7 +3347,7 @@ class PromptFeatureTest {
        )
        feature.certificatePicker = certificatePicker
        feature.start()
        val certificateRequest = PromptRequest.CertificateRequest("exmaple.com", { })
        val certificateRequest = PromptRequest.CertificateRequest("exmaple.com", null, { })

        store.dispatch(ContentAction.UpdatePromptRequestAction("custom-tab", certificateRequest))
            .joinBlocking()
Loading