зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1731982 - Part 7: Ignoring the partitionKey when verify loadingPrincipal with clientInfo. r=asuth,necko-reviewers
Given that we use the partitioned Principal in the third-party context and the loading principal won't have it, we should ignore the partitionKey when doing the verfication. Differential Revision: https://phabricator.services.mozilla.com/D127841
This commit is contained in:
Родитель
45bfad05fe
Коммит
e05ade8128
|
@ -340,13 +340,21 @@ void AssertLoadingPrincipalAndClientInfoMatch(
|
|||
return;
|
||||
}
|
||||
// Fall back to a slower origin equality test to support null principals.
|
||||
nsAutoCString loadingOrigin;
|
||||
MOZ_ALWAYS_SUCCEEDS(aLoadingPrincipal->GetOrigin(loadingOrigin));
|
||||
nsAutoCString loadingOriginNoSuffix;
|
||||
MOZ_ALWAYS_SUCCEEDS(
|
||||
aLoadingPrincipal->GetOriginNoSuffix(loadingOriginNoSuffix));
|
||||
|
||||
nsAutoCString clientOrigin;
|
||||
MOZ_ALWAYS_SUCCEEDS(clientPrincipal->GetOrigin(clientOrigin));
|
||||
nsAutoCString clientOriginNoSuffix;
|
||||
MOZ_ALWAYS_SUCCEEDS(
|
||||
clientPrincipal->GetOriginNoSuffix(clientOriginNoSuffix));
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(loadingOrigin == clientOrigin);
|
||||
// The client principal will have the partitionKey set if it's in a third
|
||||
// party context, but the loading principal won't. So, we ignore he
|
||||
// partitionKey when doing the verification here.
|
||||
MOZ_DIAGNOSTIC_ASSERT(loadingOriginNoSuffix == clientOriginNoSuffix);
|
||||
MOZ_DIAGNOSTIC_ASSERT(
|
||||
aLoadingPrincipal->OriginAttributesRef().EqualsIgnoringPartitionKey(
|
||||
clientPrincipal->OriginAttributesRef()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче