Ignore:
Timestamp:
Jun 9, 2016, 2:23:12 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: apply latest security patches to trunk

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/librpc/idl/dcerpc.idl

    r862 r920  
    1010*/
    1111import "misc.idl";
     12
     13cpp_quote("extern const uint8_t DCERPC_SEC_VT_MAGIC[8];")
    1214
    1315interface dcerpc
     
    454456
    455457        /* pfc_flags values */
    456         const uint8 DCERPC_PFC_FLAG_FIRST               = 0x01; /* First fragment */
    457         const uint8 DCERPC_PFC_FLAG_LAST                = 0x02; /* Last fragment */
    458         const uint8 DCERPC_PFC_FLAG_PENDING_CANCEL      = 0x04; /* Cancel was pending at sender */
    459         const uint8 DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN = DCERPC_PFC_FLAG_PENDING_CANCEL; /* depends on the pdu type */
    460         const uint8 DCERPC_PFC_FLAG_CONC_MPX            = 0x10; /* supports concurrent multiplexing of a single connection. */
    461         const uint8 DCERPC_PFC_FLAG_DID_NOT_EXECUTE     = 0x20; /* on a fault it means the server hasn't done anything */
    462         const uint8 DCERPC_PFC_FLAG_MAYBE               = 0x40; /* `maybe' call semantics requested */
    463         const uint8 DCERPC_PFC_FLAG_OBJECT_UUID         = 0x80; /* on valid guid is in the optional object field */
     458        typedef [bitmap8bit] bitmap {
     459                DCERPC_PFC_FLAG_FIRST           = 0x01, /* First fragment */
     460                DCERPC_PFC_FLAG_LAST            = 0x02, /* Last fragment */
     461                DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING = 0x04, /* depends on the pdu type */
     462                DCERPC_PFC_FLAG_CONC_MPX        = 0x10, /* supports concurrent multiplexing of a single connection. */
     463                DCERPC_PFC_FLAG_DID_NOT_EXECUTE = 0x20, /* on a fault it means the server hasn't done anything */
     464                DCERPC_PFC_FLAG_MAYBE           = 0x40, /* `maybe' call semantics requested */
     465                DCERPC_PFC_FLAG_OBJECT_UUID     = 0x80 /* on valid guid is in the optional object field */
     466        } dcerpc_pfc_flags;
     467
     468        /* Cancel was pending at sender */
     469        const int DCERPC_PFC_FLAG_PENDING_CANCEL =
     470                DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING;
     471        const ist DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN =
     472                DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING;
    464473
    465474        /* these offsets are needed by the signing code */
     
    467476        const uint8 DCERPC_DREP_OFFSET     =  4;
    468477        const uint8 DCERPC_FRAG_LEN_OFFSET =  8;
     478        const uint32 DCERPC_FRAG_MAX_SIZE  = 5840;
    469479        const uint8 DCERPC_AUTH_LEN_OFFSET = 10;
    470480        const uint8 DCERPC_CALL_ID_OFFSET  = 12;
     481        const uint8 DCERPC_NCACN_PAYLOAD_OFFSET = 16;
     482        const uint32 DCERPC_NCACN_PAYLOAD_MAX_SIZE = 0x400000; /* 4 MByte */
    471483
    472484        /* little-endian flag */
     
    477489                uint8 rpc_vers_minor;   /* Minor version */
    478490                dcerpc_pkt_type ptype;  /* Packet type */
    479                 uint8 pfc_flags;        /* Fragmentation flags */
     491                dcerpc_pfc_flags pfc_flags; /* Fragmentation flags */
    480492                uint8 drep[4];          /* NDR data representation */
    481493                uint16 frag_length;     /* Total length of fragment */
     
    507519                [switch_is(ptype)] dcerpc_payload u;
    508520        } ncadg_packet;
     521
     522        typedef [bitmap16bit] bitmap {
     523                DCERPC_SEC_VT_COMMAND_ENUM  = 0x3FFF,
     524                DCERPC_SEC_VT_COMMAND_END   = 0x4000,
     525                DCERPC_SEC_VT_MUST_PROCESS  = 0x8000
     526        } dcerpc_sec_vt_command;
     527
     528        typedef [enum16bit] enum {
     529                DCERPC_SEC_VT_COMMAND_BITMASK1  = 0x0001,
     530                DCERPC_SEC_VT_COMMAND_PCONTEXT  = 0x0002,
     531                DCERPC_SEC_VT_COMMAND_HEADER2   = 0x0003
     532        } dcerpc_sec_vt_command_enum;
     533
     534        typedef [bitmap32bit] bitmap {
     535                DCERPC_SEC_VT_CLIENT_SUPPORTS_HEADER_SIGNING = 0x00000001
     536        } dcerpc_sec_vt_bitmask1;
     537
     538        typedef struct {
     539                ndr_syntax_id abstract_syntax;
     540                ndr_syntax_id transfer_syntax;
     541        } dcerpc_sec_vt_pcontext;
     542
     543        typedef struct {
     544                dcerpc_pkt_type ptype;  /* Packet type */
     545                [value(0)] uint8 reserved1;
     546                [value(0)] uint16 reserved2;
     547                uint8 drep[4];          /* NDR data representation */
     548                uint32 call_id;         /* Call identifier */
     549                uint16 context_id;
     550                uint16 opnum;
     551        } dcerpc_sec_vt_header2;
     552
     553        typedef [switch_type(dcerpc_sec_vt_command_enum),nodiscriminant] union {
     554        [case(DCERPC_SEC_VT_COMMAND_BITMASK1)] dcerpc_sec_vt_bitmask1 bitmask1;
     555        [case(DCERPC_SEC_VT_COMMAND_PCONTEXT)] dcerpc_sec_vt_pcontext pcontext;
     556        [case(DCERPC_SEC_VT_COMMAND_HEADER2)] dcerpc_sec_vt_header2 header2;
     557        [default,flag(NDR_REMAINING)] DATA_BLOB _unknown;
     558        } dcerpc_sec_vt_union;
     559
     560        typedef struct {
     561                dcerpc_sec_vt_command command;
     562                [switch_is(command & DCERPC_SEC_VT_COMMAND_ENUM)]
     563                        [subcontext(2),flag(NDR_SUBCONTEXT_NO_UNREAD_BYTES)]
     564                        dcerpc_sec_vt_union u;
     565        } dcerpc_sec_vt;
     566
     567        typedef [public,nopush,nopull] struct {
     568                uint16 count;
     569        } dcerpc_sec_vt_count;
     570
     571        /*
     572         * We assume that the whole verification trailer fits into
     573         * the last 1024 bytes after the stub data.
     574         *
     575         * There're currently only 3 commands defined and each should
     576         * only be used once.
     577         */
     578        const uint16 DCERPC_SEC_VT_MAX_SIZE = 1024;
     579
     580        typedef [public,flag(NDR_PAHEX)] struct {
     581                [flag(NDR_ALIGN4)] DATA_BLOB _pad;
     582                [value(DCERPC_SEC_VT_MAGIC)] uint8 magic[8];
     583                dcerpc_sec_vt_count count;
     584                dcerpc_sec_vt commands[count.count];
     585        } dcerpc_sec_verification_trailer;
    509586}
Note: See TracChangeset for help on using the changeset viewer.