summaryrefslogtreecommitdiffstats
path: root/librpc
Commit message (Collapse)AuthorAgeFilesLines
...
* librpc/rpc: simplify dcerpc_binding_build_tower()Stefan Metzmacher2014-02-111-18/+15
| | | | | | | | | dcerpc_floor_set_rhs_data() handles the special cases now and we keep the 'host' part unmodified except EPM_PROTOCOL_IP addresses. No special '\\' handling anymore. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: fix dcerpc_floor_set_rhs_data() with NULL data.Stefan Metzmacher2014-02-111-0/+7
| | | | | | | | For EPM_PROTOCOL_IP we can only marshal ipv4 addresses, everything else gets '0.0.0.0' (4 zero bytes on the wire). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: handle dcerpc_binding->host == NULL in dcerpc_floor_get_rhs_data()Stefan Metzmacher2014-02-111-4/+16
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: let dcerpc_floor_get_rhs_data() return 'char *'Stefan Metzmacher2014-02-112-2/+2
| | | | | | | | We don't return any "const char *" values here, so give the caller a chance to talloc_free() the result. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: add ndr_table_by_syntax()Stefan Metzmacher2014-02-112-0/+15
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/idl: add witness.idlStefan Metzmacher2014-02-113-2/+122
| | | | | | | | | See [MS-SWN] for the details. Pair-Programmed-With: Gregor Beck <gbeck@sernet.de> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: add dcerpc_sec_verification_trailer_check()Gregor Beck2014-02-112-0/+154
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/rpc: add dcerpc_sec_vt_header2_[from_ncacn_packet|equal]()Gregor Beck2014-02-112-0/+79
| | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: add ndr_syntax_id_[from|to]_string()Stefan Metzmacher2014-02-114-1/+301
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: add ndr_pull_append/pop()Stefan Metzmacher2014-02-112-0/+107
| | | | | | | | | | | | | | | They can be used to parse a fragmented NDR byte stream. ndr_pull_append() appends more data that can be processed and ndr_pull_pop() removed already processed data. This will be used to implement dcerpc pipes, where we can get a verify large amount of pipe chunks, once we processed a chunk we can forget about the related data, but we may need to keep some bytes in order to get the alignment right. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: add support for a shallow copy to ndr_pull_subcontext_start/endStefan Metzmacher2014-02-111-1/+20
| | | | | | | | This will be usefull to try parsing DCERPC pipe chunks for LIBNDR_FLAG_INCOMPLETE_BUFFER. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: remember INCOMPLETE_BUFFER missing bytes in relative_highest_offsetStefan Metzmacher2014-02-111-0/+9
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: add NDR_ERR_INCOMPLETE_BUFFER and LIBNDR_FLAG_INCOMPLETE_BUFFERStefan Metzmacher2014-02-112-1/+20
| | | | | | | | | | | | If we pull a pipe chunk we need a way to check if we have enough bytes to parse the complete chunk. Setting ndr_pull->flags |= LIBNDR_FLAG_INCOMPLETE_BUFFER would change NDR_ERR_BUFSIZE (and later maybe others) into NDR_ERR_INCOMPLETE_BUFFER. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc/ndr: fix headers in ndr_dcerpc.cGregor Beck2014-02-111-3/+1
| | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* dcerpc.idl: make use of union dcerpc_bind_ack_reason and fix all callers.Stefan Metzmacher2014-01-161-1/+1
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Jan 16 18:21:40 CET 2014 on sn-devel-104
* dcerpc.idl: make use of dcerpc_bind_nak_reasonStefan Metzmacher2014-01-161-2/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* dcerpc.idl: make use of dcerpc_bind_ack_resultStefan Metzmacher2014-01-161-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* dcerpc.idl: add enums and bitmaps for dcerpc_bind_ack_result, ↵Stefan Metzmacher2014-01-161-4/+44
| | | | | | | dcerpc_bind_[ack|nak]_reason Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* dcerpc.idl: add a bitmap for dcerpc_pfc_flagsStefan Metzmacher2014-01-161-9/+16
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* dcerpc.idl: use logical dcerpc_object orderingDavid Disseldorp2014-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This IDL code: typedef [nodiscriminant] union { [default] dcerpc_empty empty; [case(LIBNDR_FLAG_OBJECT_PRESENT)] GUID object; } dcerpc_object; Compiles into the following default-before-case marshalling code: switch (level) { default: { NDR_CHECK(ndr_push_dcerpc_empty(ndr, NDR_SCALARS, &r->empty)); break; } case LIBNDR_FLAG_OBJECT_PRESENT: { NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object)); break; } } The default entry before case does not change the flow of execution but is more logical when present at the end of the switch statement. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ndrdump: dump verification trailerGregor Beck2014-01-082-1/+22
| | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc/ndr: add ndr_pop_dcerpc_sec_verification_trailer()Gregor Beck2014-01-084-2/+151
| | | | | | | | | | | | | | This extracts the dcerpc_sec_verification_trailer from the end of an ndr_pull structure, it found it reduces ndr->data_size. NDR_ERR_ALLOC is the only possible error, all other errors are ignored and a trailer with command count = 0 is returned. Pair-Programmed-With: Gregor Beck <gbeck@sernet.de> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc/rpc: simplify tevent_req_nterror() usage in binding_handle.cStefan Metzmacher2014-01-081-6/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libgpo: when running in verbose mode, printout the parsed PReg file.Günther Deschner2014-01-071-1/+1
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* librpc/rpc: read the full header in dcerpc_read_ncacn_packet_next_vector()Stefan Metzmacher2014-01-071-3/+9
| | | | | | | This helps wireshark reassamble the PDUs generated by socket_wrapper. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* dcerpc.idl: add DCERPC_NCACN_PAYLOAD_OFFSETStefan Metzmacher2014-01-071-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* librpc: fix possible memory leakGregor Beck2014-01-071-0/+1
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* librpc/ndrdump: free some temporary memory while parsing dcerpc pipe chunksStefan Metzmacher2014-01-071-1/+6
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* dcerpc.idl: add dcerpc_sec_verification_trailerStefan Metzmacher2014-01-073-1/+134
| | | | | | | | | | See [MS-RPCE] 2.2.2.13 Verification Trailer for details. Pair-Programmed-With: Gregor Beck <gbeck@sernet.de> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dcerpc.idl: add documentation referencesStefan Metzmacher2014-01-071-2/+11
| | | | | | | To [C706 - DCE 1.1: Remote Procedure Call] and [MS-RPCE]. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* librpc/ndr: add LIBNDR_FLAG_SUBCONTEXT_NO_UNREAD_BYTESStefan Metzmacher2014-01-073-0/+28
| | | | | | | | This lets ndr_pull_subcontext_end() make sure that all subcontext bytes are consumed otherwise it returns NDR_ERR_UNREAD_BYTES. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:librpc: always try to negotiate DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGNStefan Metzmacher2014-01-072-2/+4
| | | | | | | If the gensec backend supports it there's no reason not sign the header. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2013-4408:librpc: check for invalid frag_len within ↵Stefan Metzmacher2013-12-091-0/+9
| | | | | | | | | | | | dcerpc_read_ncacn_packet_next_vector() We should do this explicit instead of relying on tstream_readv_pdu_ask_for_next_vector() to catch the overflow. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CVE-2013-4408:librpc: check for invalid frag_len within ↵Stefan Metzmacher2013-12-091-0/+5
| | | | | | | | | dcerpc_read_ncacn_packet_done() Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* svcctl: Fix IDL for svcctl_OpenServiceA().Hans Leidekker2013-11-191-1/+2
| | | | | Signed-off-by: Hans Leidekker <hans@meelstraat.net> Reviewed-by: Guenther Deschner <gd@samba.org>
* librpc-idl: change the drsuapi_DsBindInfoCtr so that it match what is on the ↵Matthieu Patou2013-10-302-9/+204
| | | | | | | | | | | | | wire both in NDR32 and NDR64. Previous implementation had a problem with NDR64 with uint32 and uint3264 being in the wrong order Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Oct 30 10:16:02 CET 2013 on sn-devel-104
* librpc-idl: replace int32 by uint32 as the values are always > 0Stefan Metzmacher2013-10-261-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* librpc-idl: replace int32 by the enumeration as it's the type that we use in ↵Matthieu Patou2013-10-261-10/+10
| | | | | | | | union's switch drsuapi_DsGetDCInfoCtrLevels Signed-off-by: Matthieu Patou <mat@matws.net> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* librpc/rpc: add dcerpc_binding_handle_auth_info()Stefan Metzmacher2013-10-172-0/+33
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libndr: Avoid ommitting display of unset bitmap flags.Günther Deschner2013-10-091-4/+4
| | | | | | | | | | | | | | In 816e68f94fe500b9d68fd29021d432b84d3139b7 the display of unset bits has been effectively disabled while only the check for 0 bits was supposed to be avoided (because it creates the infite loop). Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Oct 9 19:56:39 CEST 2013 on sn-devel-104
* Revert "Support UPN_DNS_INFO in the PAC"Stefan Metzmacher2013-10-031-9/+7
| | | | | | | | | | | | | | | | | | | | | This reverts commit a6be8a97f705247c1b1cbb0595887d8924740a71. We fail (often) to parse a krb5pac type 12 buffer due to the incomplete change which came in via a6be8a97f705247c1b1cbb0595887d8924740a71. This change came into master and has only been released in RCs so no regression to published 4.0.x releases. We should revert this for 4.1 for now until we can make it work in all cases (see work on this in https://git.samba.org/?p=gd/samba/.git;a=shortlog;h=refs/heads/master-krb5pac_type12). Without this revert the entire PAC parsing may fail which can effect serious implications (krb5 smb session setup not working). Bug: https://bugzilla.samba.org/show_bug.cgi?id=10178 Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Oct 3 17:08:46 CEST 2013 on sn-devel-104
* librpc: Fix blank line endingsVolker Lendecke2013-10-021-8/+8
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Oct 2 15:02:07 CEST 2013 on sn-devel-104
* libndr: Fix ndr_print_bitmap_flag for value=0Volker Lendecke2013-10-021-0/+4
| | | | | | | Don't endlessly loop Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* librpc: return a ndr_pull_error instead of just NDR_ERR_NDR64 when upper ↵Matthieu Patou2013-10-021-1/+2
| | | | | | | bits of 64 bit value are not 0 Signed-off-by: Matthieu Patou <mat@matws.net> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* idl: fix frsrpc idl with NDR64 fieldsMatthieu Patou2013-09-241-2/+2
| | | | | | | Signed-off-by: Matthieu Patou <mat@matws.net> Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* idl: remove duplicate flagMatthieu Patou2013-09-241-1/+0
| | | | | Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* frstrans.idl: add flag(NDR_PAHEX) to frstrans_BytePipeStefan Metzmacher2013-09-241-1/+1
| | | | | | | That way we get hexdump -C style output for the content of the pipe chunks. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Matthieu Patou <mat@matws.net>
* drsuapi.idl: change the range for attribute values to 26214400 bytes.Stefan Metzmacher2013-09-241-1/+1
| | | | | | | This matches the IDL from [MS-DRSR]. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Matthieu Patou <mat@matws.net>
* librpc/ndr: make use of ndr_dump_data() in ndr_print_array_uint8()Stefan Metzmacher2013-09-241-2/+11
| | | | | | | | It's much easier to look at hexdump -C style output than a few thousand lines with 1 byte each. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Matthieu Patou <mat@matws.net>
* librpc/ndr: make ndr_pull/push_DATA_BLOB NDR64 awareStefan Metzmacher2013-09-241-4/+4
| | | | | | | Pair-Programmed-With: Matthieu Patou <mat@matws.net> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Matthieu Patou <mat@matws.net>