Commit 74390d38 authored by Manas Verma's avatar Manas Verma Committed by Commit Bot

[Autofill Auth] Encode Credential ID with standard Base64 (not url-safe).

The url-safe base64 encoding of the credential_id was being sent to Payments
server, but only standard base64 is accepted. This CL ensures only standard
base64 is used.

Bug: 949269
Change-Id: I423ab314aeb6a40f21dcc1e9304329afa7a52147
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1897493Reviewed-by: default avatarJared Saul <jsaul@google.com>
Commit-Queue: Manas Verma <manasverma@google.com>
Cr-Commit-Position: refs/heads/master@{#713169}
parent 7faba744
...@@ -585,7 +585,8 @@ CreditCardFIDOAuthenticator::ParseCredentialDescriptor( ...@@ -585,7 +585,8 @@ CreditCardFIDOAuthenticator::ParseCredentialDescriptor(
base::Value CreditCardFIDOAuthenticator::ParseAssertionResponse( base::Value CreditCardFIDOAuthenticator::ParseAssertionResponse(
GetAssertionAuthenticatorResponsePtr assertion_response) { GetAssertionAuthenticatorResponsePtr assertion_response) {
base::Value response = base::Value(base::Value::Type::DICTIONARY); base::Value response = base::Value(base::Value::Type::DICTIONARY);
response.SetKey("credential_id", base::Value(assertion_response->info->id)); response.SetKey("credential_id",
BytesToBase64(assertion_response->info->raw_id));
response.SetKey("authenticator_data", response.SetKey("authenticator_data",
BytesToBase64(assertion_response->authenticator_data)); BytesToBase64(assertion_response->authenticator_data));
response.SetKey("client_data", response.SetKey("client_data",
......
...@@ -319,7 +319,7 @@ TEST_F(CreditCardFIDOAuthenticatorTest, ParseAssertionResponse) { ...@@ -319,7 +319,7 @@ TEST_F(CreditCardFIDOAuthenticatorTest, ParseAssertionResponse) {
GetAssertionAuthenticatorResponsePtr assertion_response_ptr = GetAssertionAuthenticatorResponsePtr assertion_response_ptr =
GetAssertionAuthenticatorResponse::New(); GetAssertionAuthenticatorResponse::New();
assertion_response_ptr->info = blink::mojom::CommonCredentialInfo::New(); assertion_response_ptr->info = blink::mojom::CommonCredentialInfo::New();
assertion_response_ptr->info->id = kTestCredentialId; assertion_response_ptr->info->raw_id = Base64ToBytes(kTestCredentialId);
assertion_response_ptr->signature = Base64ToBytes(kTestSignature); assertion_response_ptr->signature = Base64ToBytes(kTestSignature);
base::Value assertion_response_json = base::Value assertion_response_json =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment