Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PWebAuthnTransactionParent.cpp
Line
Count
Source (jump to first uncovered line)
1
//
2
// Automatically generated by ipdlc.
3
// Edit at your own risk
4
//
5
6
7
#include "mozilla/dom/PWebAuthnTransactionParent.h"
8
#include "ipc/IPCMessageUtils.h"
9
10
#include "mozilla/ipc/PBackgroundParent.h"
11
12
#include "nsIFile.h"
13
#include "GeckoProfiler.h"
14
15
namespace mozilla {
16
namespace dom {
17
18
19
auto PWebAuthnTransactionParent::ActorDestroy(ActorDestroyReason aWhy) -> void
20
0
{
21
0
}
22
23
MOZ_IMPLICIT PWebAuthnTransactionParent::PWebAuthnTransactionParent() :
24
    mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
25
    mLivenessState(mozilla::ipc::LivenessState::Dead)
26
0
{
27
0
    MOZ_COUNT_CTOR(PWebAuthnTransactionParent);
28
0
}
29
30
PWebAuthnTransactionParent::~PWebAuthnTransactionParent()
31
0
{
32
0
    MOZ_COUNT_DTOR(PWebAuthnTransactionParent);
33
0
}
34
35
auto PWebAuthnTransactionParent::Manager() const -> PBackgroundParent*
36
0
{
37
0
    return static_cast<PBackgroundParent*>(IProtocol::Manager());
38
0
}
39
40
auto PWebAuthnTransactionParent::Send__delete__(PWebAuthnTransactionParent* actor) -> bool
41
0
{
42
0
    if ((!(actor))) {
43
0
        return false;
44
0
    }
45
0
46
0
    IPC::Message* msg__ = PWebAuthnTransaction::Msg___delete__((actor)->Id());
47
0
48
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
49
0
    WriteIPDLParam(msg__, actor, actor);
50
0
    // Sentinel = 'actor'
51
0
    (msg__)->WriteSentinel(875202478);
52
0
53
0
54
0
55
0
    if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionParent")) {
56
0
        mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionParent", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
57
0
    }
58
0
    AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg___delete__", OTHER);
59
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
60
0
        mozilla::ipc::LogicError("Transition error");
61
0
    }
62
0
63
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
64
0
65
0
    IProtocol* mgr = (actor)->Manager();
66
0
    (actor)->DestroySubtree(Deletion);
67
0
    (actor)->DeallocSubtree();
68
0
    (mgr)->RemoveManagee(PWebAuthnTransactionMsgStart, actor);
69
0
    return sendok__;
70
0
}
71
72
auto PWebAuthnTransactionParent::SendConfirmRegister(
73
        const uint64_t& aTransactionId,
74
        const WebAuthnMakeCredentialResult& aResult) -> bool
75
0
{
76
0
    IPC::Message* msg__ = PWebAuthnTransaction::Msg_ConfirmRegister(Id());
77
0
78
0
    WriteIPDLParam(msg__, this, aTransactionId);
79
0
    // Sentinel = 'aTransactionId'
80
0
    (msg__)->WriteSentinel(3266273614);
81
0
    WriteIPDLParam(msg__, this, aResult);
82
0
    // Sentinel = 'aResult'
83
0
    (msg__)->WriteSentinel(3888726089);
84
0
85
0
86
0
87
0
88
0
    if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionParent")) {
89
0
        mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
90
0
    }
91
0
    AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_ConfirmRegister", OTHER);
92
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
93
0
        mozilla::ipc::LogicError("Transition error");
94
0
    }
95
0
96
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
97
0
    return sendok__;
98
0
}
99
100
auto PWebAuthnTransactionParent::SendConfirmSign(
101
        const uint64_t& aTransactionId,
102
        const WebAuthnGetAssertionResult& aResult) -> bool
103
0
{
104
0
    IPC::Message* msg__ = PWebAuthnTransaction::Msg_ConfirmSign(Id());
105
0
106
0
    WriteIPDLParam(msg__, this, aTransactionId);
107
0
    // Sentinel = 'aTransactionId'
108
0
    (msg__)->WriteSentinel(3266273614);
109
0
    WriteIPDLParam(msg__, this, aResult);
110
0
    // Sentinel = 'aResult'
111
0
    (msg__)->WriteSentinel(3888726089);
112
0
113
0
114
0
115
0
116
0
    if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionParent")) {
117
0
        mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
118
0
    }
119
0
    AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_ConfirmSign", OTHER);
120
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
121
0
        mozilla::ipc::LogicError("Transition error");
122
0
    }
123
0
124
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
125
0
    return sendok__;
126
0
}
127
128
auto PWebAuthnTransactionParent::SendAbort(
129
        const uint64_t& aTransactionId,
130
        const nsresult& Error) -> bool
131
0
{
132
0
    IPC::Message* msg__ = PWebAuthnTransaction::Msg_Abort(Id());
133
0
134
0
    WriteIPDLParam(msg__, this, aTransactionId);
135
0
    // Sentinel = 'aTransactionId'
136
0
    (msg__)->WriteSentinel(3266273614);
137
0
    WriteIPDLParam(msg__, this, Error);
138
0
    // Sentinel = 'Error'
139
0
    (msg__)->WriteSentinel(1861840727);
140
0
141
0
142
0
143
0
144
0
    if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionParent")) {
145
0
        mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
146
0
    }
147
0
    AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_Abort", OTHER);
148
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
149
0
        mozilla::ipc::LogicError("Transition error");
150
0
    }
151
0
152
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
153
0
    return sendok__;
154
0
}
155
156
auto PWebAuthnTransactionParent::RemoveManagee(
157
        int32_t aProtocolId,
158
        IProtocol* aListener) -> void
159
0
{
160
0
    FatalError("unreached");
161
0
    return;
162
0
}
163
164
auto PWebAuthnTransactionParent::OnMessageReceived(const Message& msg__) -> PWebAuthnTransactionParent::Result
165
0
{
166
0
    switch ((msg__).type()) {
167
0
    case PWebAuthnTransaction::Msg_RequestRegister__ID:
168
0
        {
169
0
            if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionParent")) {
170
0
                mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
171
0
            }
172
0
            AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestRegister", OTHER);
173
0
174
0
            PickleIterator iter__(msg__);
175
0
            uint64_t aTransactionId;
176
0
            WebAuthnMakeCredentialInfo aTransactionInfo;
177
0
178
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTransactionId)))))) {
179
0
                FatalError("Error deserializing 'uint64_t'");
180
0
                return MsgValueError;
181
0
            }
182
0
            // Sentinel = 'aTransactionId'
183
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3266273614)))) {
184
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
185
0
                return MsgValueError;
186
0
            }
187
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTransactionInfo)))))) {
188
0
                FatalError("Error deserializing 'WebAuthnMakeCredentialInfo'");
189
0
                return MsgValueError;
190
0
            }
191
0
            // Sentinel = 'aTransactionInfo'
192
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1312922839)))) {
193
0
                mozilla::ipc::SentinelReadError("Error deserializing 'WebAuthnMakeCredentialInfo'");
194
0
                return MsgValueError;
195
0
            }
196
0
            (msg__).EndRead(iter__, (msg__).type());
197
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
198
0
                FatalError("Transition error");
199
0
                return MsgValueError;
200
0
            }
201
0
            if ((!(RecvRequestRegister(aTransactionId, aTransactionInfo)))) {
202
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
203
0
                // Error handled in mozilla::ipc::IPCResult
204
0
                return MsgProcessingError;
205
0
            }
206
0
207
0
            return MsgProcessed;
208
0
        }
209
0
    case PWebAuthnTransaction::Msg_RequestSign__ID:
210
0
        {
211
0
            if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionParent")) {
212
0
                mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
213
0
            }
214
0
            AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestSign", OTHER);
215
0
216
0
            PickleIterator iter__(msg__);
217
0
            uint64_t aTransactionId;
218
0
            WebAuthnGetAssertionInfo aTransactionInfo;
219
0
220
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTransactionId)))))) {
221
0
                FatalError("Error deserializing 'uint64_t'");
222
0
                return MsgValueError;
223
0
            }
224
0
            // Sentinel = 'aTransactionId'
225
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3266273614)))) {
226
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
227
0
                return MsgValueError;
228
0
            }
229
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTransactionInfo)))))) {
230
0
                FatalError("Error deserializing 'WebAuthnGetAssertionInfo'");
231
0
                return MsgValueError;
232
0
            }
233
0
            // Sentinel = 'aTransactionInfo'
234
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1312922839)))) {
235
0
                mozilla::ipc::SentinelReadError("Error deserializing 'WebAuthnGetAssertionInfo'");
236
0
                return MsgValueError;
237
0
            }
238
0
            (msg__).EndRead(iter__, (msg__).type());
239
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
240
0
                FatalError("Transition error");
241
0
                return MsgValueError;
242
0
            }
243
0
            if ((!(RecvRequestSign(aTransactionId, aTransactionInfo)))) {
244
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
245
0
                // Error handled in mozilla::ipc::IPCResult
246
0
                return MsgProcessingError;
247
0
            }
248
0
249
0
            return MsgProcessed;
250
0
        }
251
0
    case PWebAuthnTransaction::Msg_RequestCancel__ID:
252
0
        {
253
0
            if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionParent")) {
254
0
                mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
255
0
            }
256
0
            AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestCancel", OTHER);
257
0
258
0
            PickleIterator iter__(msg__);
259
0
            uint64_t aTransactionId;
260
0
261
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTransactionId)))))) {
262
0
                FatalError("Error deserializing 'uint64_t'");
263
0
                return MsgValueError;
264
0
            }
265
0
            // Sentinel = 'aTransactionId'
266
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3266273614)))) {
267
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
268
0
                return MsgValueError;
269
0
            }
270
0
            (msg__).EndRead(iter__, (msg__).type());
271
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
272
0
                FatalError("Transition error");
273
0
                return MsgValueError;
274
0
            }
275
0
            if ((!(RecvRequestCancel(aTransactionId)))) {
276
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
277
0
                // Error handled in mozilla::ipc::IPCResult
278
0
                return MsgProcessingError;
279
0
            }
280
0
281
0
            return MsgProcessed;
282
0
        }
283
0
    case PWebAuthnTransaction::Msg_DestroyMe__ID:
284
0
        {
285
0
            if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionParent")) {
286
0
                mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
287
0
            }
288
0
            AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_DestroyMe", OTHER);
289
0
290
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
291
0
                FatalError("Transition error");
292
0
                return MsgValueError;
293
0
            }
294
0
            if ((!(RecvDestroyMe()))) {
295
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
296
0
                // Error handled in mozilla::ipc::IPCResult
297
0
                return MsgProcessingError;
298
0
            }
299
0
300
0
            return MsgProcessed;
301
0
        }
302
0
    case PWebAuthnTransaction::Reply___delete____ID:
303
0
        {
304
0
            return MsgProcessed;
305
0
        }
306
0
    default:
307
0
        {
308
0
            return MsgNotKnown;
309
0
        }
310
0
    }
311
0
}
312
313
auto PWebAuthnTransactionParent::OnMessageReceived(
314
        const Message& msg__,
315
        Message*& reply__) -> PWebAuthnTransactionParent::Result
316
0
{
317
0
    return MsgNotKnown;
318
0
}
319
320
auto PWebAuthnTransactionParent::OnCallReceived(
321
        const Message& msg__,
322
        Message*& reply__) -> PWebAuthnTransactionParent::Result
323
0
{
324
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
325
0
    return MsgNotKnown;
326
0
}
327
328
auto PWebAuthnTransactionParent::GetProtocolTypeId() -> int32_t
329
0
{
330
0
    return PWebAuthnTransactionMsgStart;
331
0
}
332
333
auto PWebAuthnTransactionParent::DestroySubtree(ActorDestroyReason why) -> void
334
0
{
335
0
    // Unregister from our manager.
336
0
    Unregister(Id());
337
0
338
0
    // Reject owning pending responses.
339
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
340
0
341
0
    // Finally, destroy "us".
342
0
    ActorDestroy(why);
343
0
}
344
345
auto PWebAuthnTransactionParent::DeallocSubtree() -> void
346
0
{
347
0
}
348
349
350
351
} // namespace dom
352
} // namespace mozilla
353
namespace mozilla {
354
namespace ipc {
355
auto IPDLParamTraits<mozilla::dom::PWebAuthnTransactionParent>::Write(
356
        IPC::Message* aMsg,
357
        mozilla::ipc::IProtocol* aActor,
358
        const paramType& aVar) -> void
359
0
{
360
0
    int32_t id;
361
0
    if ((!(aVar))) {
362
0
        id = 0;
363
0
    }
364
0
    else {
365
0
        id = (aVar)->Id();
366
0
        if ((1) == (id)) {
367
0
            (aActor)->FatalError("actor has been |delete|d");
368
0
        }
369
0
    }
370
0
    WriteIPDLParam(aMsg, aActor, id);
371
0
}
372
373
auto IPDLParamTraits<mozilla::dom::PWebAuthnTransactionParent>::Read(
374
        const IPC::Message* aMsg,
375
        PickleIterator* aIter,
376
        mozilla::ipc::IProtocol* aActor,
377
        paramType* aVar) -> bool
378
0
{
379
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PWebAuthnTransaction", PWebAuthnTransactionMsgStart);
380
0
    if ((actor).isNothing()) {
381
0
        return false;
382
0
    }
383
0
384
0
    (*(aVar)) = static_cast<mozilla::dom::PWebAuthnTransactionParent*>((actor).value());
385
0
    return true;
386
0
}
387
388
} // namespace ipc
389
} // namespace mozilla