webauthn: fix spelling of googleLegacyAppidSupport extension
The correct spelling is with a lower-case 'i' in Appid. But CL 2981053
added it with an upper-case 'i'.
The lower-case 'i' is what the spec uses and Safari implements.
Bug: 1224886
, 1233116
Change-Id: I8d21204ef356f473c80fd5efaa2f2b98f9f885a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3048954
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
Reviewed-by: Adam Langley <agl@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#905358}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
efe0d73982
commit
e8c3bb2941
content/browser/webauth
third_party/blink
renderer
modules
web_tests
http
tests
@ -192,7 +192,7 @@ absl::optional<std::string> ProcessAppIdExtension(
|
||||
|
||||
// Returns an App ID string if a U2F credential must be made for the request
|
||||
// with |options|. This is the case for requests that either originate from
|
||||
// cryptotoken or have the googleLegacyAppIdSupport extension set.
|
||||
// cryptotoken or have the googleLegacyAppidSupport extension set.
|
||||
absl::optional<std::string> MakeCredentialU2fAppIdOverride(
|
||||
const url::Origin& caller_origin,
|
||||
const blink::mojom::PublicKeyCredentialCreationOptionsPtr& options) {
|
||||
@ -614,7 +614,7 @@ base::flat_set<device::FidoTransportProtocol> GetWebAuthnTransports(
|
||||
}
|
||||
|
||||
// GetU2FTransports is like GetWebAuthnTransports but for requests that
|
||||
// originate from Cryptotoken or use googleLegacyAppIdSupport extension.
|
||||
// originate from Cryptotoken or use googleLegacyAppidSupport extension.
|
||||
base::flat_set<device::FidoTransportProtocol> GetU2FTransports() {
|
||||
return base::flat_set<device::FidoTransportProtocol>(
|
||||
{device::FidoTransportProtocol::kUsbHumanInterfaceDevice});
|
||||
@ -1048,7 +1048,7 @@ void AuthenticatorCommon::MakeCredential(
|
||||
device::PublicKeyCredentialParams(options->public_key_parameters));
|
||||
|
||||
// If the request originates from CryptoToken or carries a valid
|
||||
// googleLegacyAppIdSupport extension, a U2F/CTAP1 credential bound to an
|
||||
// googleLegacyAppidSupport extension, a U2F/CTAP1 credential bound to an
|
||||
// AppID will be created.
|
||||
absl::optional<std::string> u2f_credential_app_id_override =
|
||||
MakeCredentialU2fAppIdOverride(caller_origin, options);
|
||||
|
@ -3952,7 +3952,7 @@ TEST_F(AuthenticatorImplTest, CredBlob) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(AuthenticatorImplTest, GoogleLegacyAppIdSupport) {
|
||||
TEST_F(AuthenticatorImplTest, GoogleLegacyAppidSupport) {
|
||||
struct TestCase {
|
||||
std::string url;
|
||||
bool google_legacy_app_id_support;
|
||||
@ -3971,7 +3971,7 @@ TEST_F(AuthenticatorImplTest, GoogleLegacyAppIdSupport) {
|
||||
TestCase::kWebAuthn,
|
||||
"google.com",
|
||||
},
|
||||
// accounts.google.com can exercise googleLegacyAppIdSupport to get a U2F
|
||||
// accounts.google.com can exercise googleLegacyAppidSupport to get a U2F
|
||||
// credential with a hard-coded appId.
|
||||
{
|
||||
"https://accounts.google.com",
|
||||
@ -3990,7 +3990,7 @@ TEST_F(AuthenticatorImplTest, GoogleLegacyAppIdSupport) {
|
||||
TestCase::kWebAuthn,
|
||||
"google.com",
|
||||
},
|
||||
// login.corp.google.com also can exercise googleLegacyAppIdSupport,
|
||||
// login.corp.google.com also can exercise googleLegacyAppidSupport,
|
||||
// yielding a different appId.
|
||||
{
|
||||
"https://login.corp.google.com",
|
||||
@ -4000,7 +4000,7 @@ TEST_F(AuthenticatorImplTest, GoogleLegacyAppIdSupport) {
|
||||
TestCase::kU2f,
|
||||
"https://www.gstatic.com/securitykey/a/google.com/origins.json",
|
||||
},
|
||||
// On other origins, googleLegacyAppIdSupport has no effect.
|
||||
// On other origins, googleLegacyAppidSupport has no effect.
|
||||
{
|
||||
"https://example.com",
|
||||
true,
|
||||
@ -4060,7 +4060,7 @@ TEST_F(AuthenticatorImplTest, GoogleLegacyAppIdSupport) {
|
||||
->second.is_u2f,
|
||||
test_case.credential_type == TestCase::kU2f);
|
||||
// Requests use the type key for WebAuthn rather than U2F API registration,
|
||||
// even if googleLegacyAppIdSupport is set.
|
||||
// even if googleLegacyAppidSupport is set.
|
||||
EXPECT_TRUE(
|
||||
base::StartsWith(client_data_json, R"({"type":"webauthn.create")"))
|
||||
<< client_data_json;
|
||||
|
2
third_party/blink/renderer/modules/credentialmanager/authentication_extensions_client_inputs.idl
vendored
2
third_party/blink/renderer/modules/credentialmanager/authentication_extensions_client_inputs.idl
vendored
@ -34,5 +34,5 @@ dictionary AuthenticationExtensionsClientInputs {
|
||||
boolean getCredBlob;
|
||||
|
||||
// Legacy compatibility extension for U2F migration https://groups.google.com/a/chromium.org/g/blink-dev/c/xHC3AtU_65A.
|
||||
boolean googleLegacyAppIdSupport;
|
||||
boolean googleLegacyAppidSupport;
|
||||
};
|
||||
|
4
third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.cc
vendored
4
third_party/blink/renderer/modules/credentialmanager/credential_manager_type_converters.cc
vendored
@ -581,9 +581,9 @@ TypeConverter<PublicKeyCredentialCreationOptionsPtr,
|
||||
mojo_options->cred_blob =
|
||||
ConvertTo<Vector<uint8_t>>(extensions->credBlob());
|
||||
}
|
||||
if (extensions->hasGoogleLegacyAppIdSupport()) {
|
||||
if (extensions->hasGoogleLegacyAppidSupport()) {
|
||||
mojo_options->google_legacy_app_id_support =
|
||||
extensions->googleLegacyAppIdSupport();
|
||||
extensions->googleLegacyAppidSupport();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1040,10 +1040,10 @@ ScriptPromise CredentialsContainer::get(
|
||||
return promise;
|
||||
}
|
||||
}
|
||||
if (options->publicKey()->extensions()->hasGoogleLegacyAppIdSupport()) {
|
||||
if (options->publicKey()->extensions()->hasGoogleLegacyAppidSupport()) {
|
||||
resolver->Reject(MakeGarbageCollected<DOMException>(
|
||||
DOMExceptionCode::kNotSupportedError,
|
||||
"The 'googleLegacyAppIdSupport' extension is only valid when "
|
||||
"The 'googleLegacyAppidSupport' extension is only valid when "
|
||||
"creating a credential"));
|
||||
return promise;
|
||||
}
|
||||
@ -1349,7 +1349,7 @@ ScriptPromise CredentialsContainer::create(
|
||||
return promise;
|
||||
}
|
||||
}
|
||||
if (options->publicKey()->extensions()->hasGoogleLegacyAppIdSupport()) {
|
||||
if (options->publicKey()->extensions()->hasGoogleLegacyAppidSupport()) {
|
||||
const auto& rp_id =
|
||||
options->publicKey()->rp()->id()
|
||||
? options->publicKey()->rp()->id()
|
||||
@ -1359,7 +1359,7 @@ ScriptPromise CredentialsContainer::create(
|
||||
MakeGarbageCollected<ConsoleMessage>(
|
||||
mojom::blink::ConsoleMessageSource::kJavaScript,
|
||||
mojom::blink::ConsoleMessageLevel::kWarning,
|
||||
"The 'googleLegacyAppIdSupport' extension is ignored for "
|
||||
"The 'googleLegacyAppidSupport' extension is ignored for "
|
||||
"requests with an 'rp.id' not equal to 'google.com'"));
|
||||
}
|
||||
}
|
||||
|
4
third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-create-basics.html
vendored
4
third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-create-basics.html
vendored
@ -252,10 +252,10 @@ promise_test(t => {
|
||||
mockAuthenticator.reset();
|
||||
mockAuthenticator.setDefaultsForSuccessfulMakeCredential();
|
||||
var customMakeCredOptions = deepCopy(MAKE_CREDENTIAL_OPTIONS);
|
||||
customMakeCredOptions.extensions = {googleLegacyAppIdSupport: true}
|
||||
customMakeCredOptions.extensions = {googleLegacyAppidSupport: true}
|
||||
return navigator.credentials.create({publicKey: customMakeCredOptions}).then(r => {
|
||||
assertValidMakeCredentialResponse(r);
|
||||
});
|
||||
}, "navigator.credentials.create() with googleLegacyAppIdSupport extension");
|
||||
}, "navigator.credentials.create() with googleLegacyAppidSupport extension");
|
||||
|
||||
</script>
|
||||
|
4
third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-get-basics.html
vendored
4
third_party/blink/web_tests/http/tests/credentialmanager/credentialscontainer-get-basics.html
vendored
@ -265,10 +265,10 @@ promise_test(t => {
|
||||
mockAuthenticator.reset();
|
||||
mockAuthenticator.setDefaultsForSuccessfulGetAssertion();
|
||||
var customGetCredentialOptions = deepCopy(GET_CREDENTIAL_OPTIONS);
|
||||
customGetCredentialOptions.extensions = {googleLegacyAppIdSupport: true};
|
||||
customGetCredentialOptions.extensions = {googleLegacyAppidSupport: true};
|
||||
return promise_rejects_dom(t, "NotSupportedError",
|
||||
navigator.credentials.get({ publicKey : customGetCredentialOptions}));
|
||||
}, "navigator.credentials.get() with googleLegacyAppIdSupport extension not supported");
|
||||
}, "navigator.credentials.get() with googleLegacyAppidSupport extension not supported");
|
||||
|
||||
promise_test(t => {
|
||||
var authAbortController = new AbortController();
|
||||
|
Reference in New Issue
Block a user