### ms-wcce.idl
"""
RPC definitions for the following interfaces:
- ICertRequestD (v0.0): d99e6e70-fc88-11d0-b498-00a0c90312f3
- ICertRequestD2 (v0.0): 5422fd3a-d4b8-4cef-a12e-e87d4ca22e90
This file is auto-generated by midl-to-scapy, do not modify.
"""

import uuid


from scapy.layers.dcerpc import (
    NDRPacket,
    DceRpcOp,
    NDRConfStrLenField,
    NDRConfVarStrNullField,
    NDRConfVarStrNullFieldUtf16,
    NDRFullPointerField,
    NDRIntField,
    NDRPacketField,
    NDRSignedIntField,
    register_com_interface,
)


class CERTTRANSBLOB(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("cb", None, size_of="pb"),
        NDRFullPointerField(
            NDRConfStrLenField("pb", "", size_is=lambda pkt: pkt.cb), deferred=True
        ),
    ]


class Request_Request(NDRPacket):
    fields_desc = [
        NDRIntField("dwFlags", 0),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszAuthority", "")),
        NDRIntField("pdwRequestId", 0),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszAttributes", "")),
        NDRPacketField("pctbRequest", CERTTRANSBLOB(), CERTTRANSBLOB),
    ]


class Request_Response(NDRPacket):
    fields_desc = [
        NDRIntField("pdwRequestId", 0),
        NDRIntField("pdwDisposition", 0),
        NDRPacketField("pctbCertChain", CERTTRANSBLOB(), CERTTRANSBLOB),
        NDRPacketField("pctbEncodedCert", CERTTRANSBLOB(), CERTTRANSBLOB),
        NDRPacketField("pctbDispositionMessage", CERTTRANSBLOB(), CERTTRANSBLOB),
        NDRIntField("status", 0),
    ]


class GetCACert_Request(NDRPacket):
    fields_desc = [
        NDRIntField("fchain", 0),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszAuthority", "")),
    ]


class GetCACert_Response(NDRPacket):
    fields_desc = [
        NDRPacketField("pctbOut", CERTTRANSBLOB(), CERTTRANSBLOB),
        NDRIntField("status", 0),
    ]


class Ping_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszAuthority", ""))
    ]


class Ping_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


ICERTREQUESTD_OPNUMS = {
    0: DceRpcOp(Request_Request, Request_Response),
    1: DceRpcOp(GetCACert_Request, GetCACert_Response),
    2: DceRpcOp(Ping_Request, Ping_Response),
}
register_com_interface(
    name="ICertRequestD",
    uuid=uuid.UUID("d99e6e70-fc88-11d0-b498-00a0c90312f3"),
    opnums=ICERTREQUESTD_OPNUMS,
)


class Request2_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszAuthority", "")),
        NDRIntField("dwFlags", 0),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszSerialNumber", "")),
        NDRIntField("pdwRequestId", 0),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszAttributes", "")),
        NDRPacketField("pctbRequest", CERTTRANSBLOB(), CERTTRANSBLOB),
    ]


class Request2_Response(NDRPacket):
    fields_desc = [
        NDRIntField("pdwRequestId", 0),
        NDRIntField("pdwDisposition", 0),
        NDRPacketField("pctbFullResponse", CERTTRANSBLOB(), CERTTRANSBLOB),
        NDRPacketField("pctbEncodedCert", CERTTRANSBLOB(), CERTTRANSBLOB),
        NDRPacketField("pctbDispositionMessage", CERTTRANSBLOB(), CERTTRANSBLOB),
        NDRIntField("status", 0),
    ]


class GetCAProperty_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszAuthority", "")),
        NDRSignedIntField("PropID", 0),
        NDRSignedIntField("PropIndex", 0),
        NDRSignedIntField("PropType", 0),
    ]


class GetCAProperty_Response(NDRPacket):
    fields_desc = [
        NDRPacketField("pctbPropertyValue", CERTTRANSBLOB(), CERTTRANSBLOB),
        NDRIntField("status", 0),
    ]


class GetCAPropertyInfo_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszAuthority", ""))
    ]


class GetCAPropertyInfo_Response(NDRPacket):
    fields_desc = [
        NDRSignedIntField("pcProperty", 0),
        NDRPacketField("pctbPropInfo", CERTTRANSBLOB(), CERTTRANSBLOB),
        NDRIntField("status", 0),
    ]


class Ping2_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszAuthority", ""))
    ]


class Ping2_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


ICERTREQUESTD2_OPNUMS = {
    0: DceRpcOp(Request2_Request, Request2_Response),
    1: DceRpcOp(GetCAProperty_Request, GetCAProperty_Response),
    2: DceRpcOp(GetCAPropertyInfo_Request, GetCAPropertyInfo_Response),
    3: DceRpcOp(Ping2_Request, Ping2_Response),
}
register_com_interface(
    name="ICertRequestD2",
    uuid=uuid.UUID("5422fd3a-d4b8-4cef-a12e-e87d4ca22e90"),
    opnums=ICERTREQUESTD2_OPNUMS,
)
