mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 916091 - patch 2 - nsIMessageSender should check if the principal is valid., r=smaug
This commit is contained in:
parent
1d81221332
commit
15ad5661b6
@ -2868,6 +2868,11 @@ ContentParent::RecvSyncMessage(const nsString& aMsg,
|
|||||||
const IPC::Principal& aPrincipal,
|
const IPC::Principal& aPrincipal,
|
||||||
InfallibleTArray<nsString>* aRetvals)
|
InfallibleTArray<nsString>* aRetvals)
|
||||||
{
|
{
|
||||||
|
nsIPrincipal* principal = aPrincipal;
|
||||||
|
if (principal && !AssertAppPrincipal(this, principal)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
nsRefPtr<nsFrameMessageManager> ppm = mMessageManager;
|
nsRefPtr<nsFrameMessageManager> ppm = mMessageManager;
|
||||||
if (ppm) {
|
if (ppm) {
|
||||||
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
||||||
@ -2886,6 +2891,11 @@ ContentParent::AnswerRpcMessage(const nsString& aMsg,
|
|||||||
const IPC::Principal& aPrincipal,
|
const IPC::Principal& aPrincipal,
|
||||||
InfallibleTArray<nsString>* aRetvals)
|
InfallibleTArray<nsString>* aRetvals)
|
||||||
{
|
{
|
||||||
|
nsIPrincipal* principal = aPrincipal;
|
||||||
|
if (principal && !AssertAppPrincipal(this, principal)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
nsRefPtr<nsFrameMessageManager> ppm = mMessageManager;
|
nsRefPtr<nsFrameMessageManager> ppm = mMessageManager;
|
||||||
if (ppm) {
|
if (ppm) {
|
||||||
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
||||||
@ -2902,6 +2912,11 @@ ContentParent::RecvAsyncMessage(const nsString& aMsg,
|
|||||||
const InfallibleTArray<CpowEntry>& aCpows,
|
const InfallibleTArray<CpowEntry>& aCpows,
|
||||||
const IPC::Principal& aPrincipal)
|
const IPC::Principal& aPrincipal)
|
||||||
{
|
{
|
||||||
|
nsIPrincipal* principal = aPrincipal;
|
||||||
|
if (principal && !AssertAppPrincipal(this, principal)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
nsRefPtr<nsFrameMessageManager> ppm = mMessageManager;
|
nsRefPtr<nsFrameMessageManager> ppm = mMessageManager;
|
||||||
if (ppm) {
|
if (ppm) {
|
||||||
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "TabParent.h"
|
#include "TabParent.h"
|
||||||
|
|
||||||
|
#include "AppProcessChecker.h"
|
||||||
#include "IDBFactory.h"
|
#include "IDBFactory.h"
|
||||||
#include "IndexedDBParent.h"
|
#include "IndexedDBParent.h"
|
||||||
#include "mozIApplication.h"
|
#include "mozIApplication.h"
|
||||||
@ -770,8 +771,14 @@ TabParent::RecvSyncMessage(const nsString& aMessage,
|
|||||||
const IPC::Principal& aPrincipal,
|
const IPC::Principal& aPrincipal,
|
||||||
InfallibleTArray<nsString>* aJSONRetVal)
|
InfallibleTArray<nsString>* aJSONRetVal)
|
||||||
{
|
{
|
||||||
|
nsIPrincipal* principal = aPrincipal;
|
||||||
|
ContentParent* parent = static_cast<ContentParent*>(Manager());
|
||||||
|
if (principal && !AssertAppPrincipal(parent, principal)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
||||||
CpowIdHolder cpows(static_cast<ContentParent*>(Manager())->GetCPOWManager(), aCpows);
|
CpowIdHolder cpows(parent->GetCPOWManager(), aCpows);
|
||||||
return ReceiveMessage(aMessage, true, &cloneData, &cpows, aPrincipal, aJSONRetVal);
|
return ReceiveMessage(aMessage, true, &cloneData, &cpows, aPrincipal, aJSONRetVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -782,8 +789,14 @@ TabParent::AnswerRpcMessage(const nsString& aMessage,
|
|||||||
const IPC::Principal& aPrincipal,
|
const IPC::Principal& aPrincipal,
|
||||||
InfallibleTArray<nsString>* aJSONRetVal)
|
InfallibleTArray<nsString>* aJSONRetVal)
|
||||||
{
|
{
|
||||||
|
nsIPrincipal* principal = aPrincipal;
|
||||||
|
ContentParent* parent = static_cast<ContentParent*>(Manager());
|
||||||
|
if (principal && !AssertAppPrincipal(parent, principal)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
||||||
CpowIdHolder cpows(static_cast<ContentParent*>(Manager())->GetCPOWManager(), aCpows);
|
CpowIdHolder cpows(parent->GetCPOWManager(), aCpows);
|
||||||
return ReceiveMessage(aMessage, true, &cloneData, &cpows, aPrincipal, aJSONRetVal);
|
return ReceiveMessage(aMessage, true, &cloneData, &cpows, aPrincipal, aJSONRetVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -793,8 +806,14 @@ TabParent::RecvAsyncMessage(const nsString& aMessage,
|
|||||||
const InfallibleTArray<CpowEntry>& aCpows,
|
const InfallibleTArray<CpowEntry>& aCpows,
|
||||||
const IPC::Principal& aPrincipal)
|
const IPC::Principal& aPrincipal)
|
||||||
{
|
{
|
||||||
|
nsIPrincipal* principal = aPrincipal;
|
||||||
|
ContentParent* parent = static_cast<ContentParent*>(Manager());
|
||||||
|
if (principal && !AssertAppPrincipal(parent, principal)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
|
||||||
CpowIdHolder cpows(static_cast<ContentParent*>(Manager())->GetCPOWManager(), aCpows);
|
CpowIdHolder cpows(parent->GetCPOWManager(), aCpows);
|
||||||
return ReceiveMessage(aMessage, false, &cloneData, &cpows, aPrincipal, nullptr);
|
return ReceiveMessage(aMessage, false, &cloneData, &cpows, aPrincipal, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user