Changeset 989 for vendor/current/librpc
- Timestamp:
- Nov 25, 2016, 8:04:54 PM (9 years ago)
- Location:
- vendor/current/librpc
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/librpc/idl/dcerpc.idl
r988 r989 536 536 const uint8 DCERPC_AUTH_LEN_OFFSET = 10; 537 537 const uint8 DCERPC_NCACN_PAYLOAD_OFFSET = 16; 538 const uint32 DCERPC_NCACN_PAYLOAD_MAX_SIZE = 0x400000; /* 4 MByte */ 538 539 /* 540 * See [MS-RPCE] 3.3.3.5.4 Maximum Server Input Data Size 541 * 4 MByte is the default limit of reassembled request payload 542 */ 543 const uint32 DCERPC_NCACN_REQUEST_DEFAULT_MAX_SIZE = 0x400000; 544 545 /* 546 * See [MS-RPCE] 3.3.2.5.2 Handling Responses 547 * 548 * Indicates that Windows accepts up to 0x7FFFFFFF ~2 GByte 549 * 550 * talloc has a limit of 256 MByte, so we need to use something smaller. 551 * 552 * For now we try our luck with 240 MByte. 553 */ 554 const uint32 DCERPC_NCACN_RESPONSE_DEFAULT_MAX_SIZE = 0xf000000; /* 240 MByte */ 539 555 540 556 /* little-endian flag */ -
vendor/current/librpc/idl/dns.idl
r988 r989 180 180 } dns_opt_record; 181 181 182 typedef [ public] struct {182 typedef [flag(NDR_NO_COMP),public] struct { 183 183 dns_string algorithm; 184 184 uint32 inception; … … 192 192 } dns_tkey_record; 193 193 194 typedef [ public] struct {194 typedef [flag(NDR_NO_COMP),public] struct { 195 195 dns_string algorithm_name; 196 196 uint16 time_prefix; /* 0 until February 2106*/ … … 205 205 } dns_tsig_record; 206 206 207 typedef [flag(NDR_NO ALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {207 typedef [flag(NDR_NO_COMP|NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct { 208 208 dns_string name; 209 209 dns_qclass rr_class; … … 213 213 uint32 time; 214 214 uint16 fudge; 215 uint16 original_id;216 215 uint16 error; 217 216 uint16 other_size; -
vendor/current/librpc/idl/idl_types.h
r988 r989 41 41 #define NDR_ALIGN4 LIBNDR_FLAG_ALIGN4 42 42 #define NDR_ALIGN8 LIBNDR_FLAG_ALIGN8 43 #define NDR_NO_COMP LIBNDR_FLAG_NO_COMPRESSION 43 44 44 45 /* this flag is used to force a section of IDL as little endian. It is -
vendor/current/librpc/ndr/libndr.h
r988 r989 125 125 #define LIBNDR_FLAG_STR_RAW8 (1<<13) 126 126 #define LIBNDR_STRING_FLAGS (0x7FFC) 127 128 /* Disable string token compression */ 129 #define LIBNDR_FLAG_NO_COMPRESSION (1<<15) 127 130 128 131 /* -
vendor/current/librpc/ndr/ndr_dns.c
r988 r989 170 170 uint32_t offset; 171 171 172 /* see if we have pushed the remaining string already, 173 * if so we use a label pointer to this string 174 */ 175 ndr_err = ndr_token_retrieve_cmp_fn(&ndr->dns_string_list, s, 176 &offset, 177 (comparison_fn_t)strcmp, 178 false); 179 if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 180 uint8_t b[2]; 181 182 if (offset > 0x3FFF) { 183 return ndr_push_error(ndr, NDR_ERR_STRING, 184 "offset for dns string " \ 185 "label pointer " \ 186 "%u[%08X] > 0x00003FFF", 187 offset, offset); 172 if (!(ndr->flags & LIBNDR_FLAG_NO_COMPRESSION)) { 173 /* see if we have pushed the remaining string already, 174 * if so we use a label pointer to this string 175 */ 176 ndr_err = ndr_token_retrieve_cmp_fn(&ndr->dns_string_list, s, 177 &offset, 178 (comparison_fn_t)strcmp, 179 false); 180 if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 181 uint8_t b[2]; 182 183 if (offset > 0x3FFF) { 184 return ndr_push_error(ndr, NDR_ERR_STRING, 185 "offset for dns string " \ 186 "label pointer " \ 187 "%u[%08X] > 0x00003FFF", 188 offset, offset); 189 } 190 191 b[0] = 0xC0 | (offset>>8); 192 b[1] = (offset & 0xFF); 193 194 return ndr_push_bytes(ndr, b, 2); 188 195 } 189 190 b[0] = 0xC0 | (offset>>8);191 b[1] = (offset & 0xFF);192 193 return ndr_push_bytes(ndr, b, 2);194 196 } 195 197 … … 214 216 * so it can be reused later 215 217 */ 216 NDR_CHECK(ndr_token_store(ndr, &ndr->dns_string_list, s, 217 ndr->offset)); 218 if (!(ndr->flags & LIBNDR_FLAG_NO_COMPRESSION)) { 219 NDR_CHECK(ndr_token_store(ndr, &ndr->dns_string_list, s, 220 ndr->offset)); 221 } 218 222 219 223 /* push just this component into the blob */ … … 265 269 LIBNDR_FLAG_NOALIGN); 266 270 if (ndr_flags & NDR_SCALARS) { 271 uint32_t _flags_save_name = ndr->flags; 272 267 273 NDR_CHECK(ndr_push_align(ndr, 4)); 274 275 switch (r->rr_type) { 276 case DNS_QTYPE_TKEY: 277 case DNS_QTYPE_TSIG: 278 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NO_COMPRESSION); 279 break; 280 default: 281 break; 282 } 268 283 NDR_CHECK(ndr_push_dns_string(ndr, NDR_SCALARS, r->name)); 284 ndr->flags = _flags_save_name; 285 269 286 NDR_CHECK(ndr_push_dns_qtype(ndr, NDR_SCALARS, r->rr_type)); 270 287 NDR_CHECK(ndr_push_dns_qclass(ndr, NDR_SCALARS, r->rr_class)); -
vendor/current/librpc/rpc/dcerpc_util.c
r988 r989 96 96 uint16_t auth_length; 97 97 uint32_t tmp_length; 98 uint32_t max_pad_len = 0; 98 99 99 100 ZERO_STRUCTP(auth); 100 101 if (_auth_length != NULL) { 101 102 *_auth_length = 0; 103 104 if (auth_data_only) { 105 return NT_STATUS_INTERNAL_ERROR; 106 } 107 } else { 108 if (!auth_data_only) { 109 return NT_STATUS_INTERNAL_ERROR; 110 } 102 111 } 103 112 … … 148 157 ZERO_STRUCTP(auth); 149 158 return ndr_map_error2ntstatus(ndr_err); 159 } 160 161 /* 162 * Make sure the padding would not exceed 163 * the frag_length. 164 * 165 * Here we assume at least 24 bytes for the 166 * payload specific header the value of 167 * DCERPC_{REQUEST,RESPONSE}_LENGTH. 168 * 169 * We use this also for BIND_*, ALTER_* and AUTH3 pdus. 170 * 171 * We need this check before we ignore possible 172 * invalid values. See also bug #11982. 173 * 174 * This check is mainly used to generate the correct 175 * error for BIND_*, ALTER_* and AUTH3 pdus. 176 * 177 * We always have the 'if (data_and_pad < auth->auth_pad_length)' 178 * protection for REQUEST and RESPONSE pdus, where the 179 * auth_pad_length field is actually used by the caller. 180 */ 181 tmp_length = DCERPC_REQUEST_LENGTH; 182 tmp_length += DCERPC_AUTH_TRAILER_LENGTH; 183 tmp_length += pkt->auth_length; 184 if (tmp_length < pkt->frag_length) { 185 max_pad_len = pkt->frag_length - tmp_length; 186 } 187 if (max_pad_len < auth->auth_pad_length) { 188 DEBUG(1, (__location__ ": ERROR: pad length to large. " 189 "max %u got %u\n", 190 (unsigned)max_pad_len, 191 (unsigned)auth->auth_pad_length)); 192 talloc_free(ndr); 193 ZERO_STRUCTP(auth); 194 return NT_STATUS_RPC_PROTOCOL_ERROR; 195 } 196 197 /* 198 * This is a workarround for a bug in old 199 * Samba releases. For BIND_ACK <= 3.5.x 200 * and for ALTER_RESP <= 4.2.x (see bug #11061) 201 * 202 * See also bug #11982. 203 */ 204 if (auth_data_only && data_and_pad == 0 && 205 auth->auth_pad_length > 0) { 206 /* 207 * we need to ignore invalid auth_pad_length 208 * values for BIND_*, ALTER_* and AUTH3 pdus. 209 */ 210 auth->auth_pad_length = 0; 150 211 } 151 212
Note:
See TracChangeset
for help on using the changeset viewer.