If dcerpc_pull_auth_trailer() returns NT_STATUS_RPC_PROTOCOL_ERROR
it will return the BIND reject code in auth->auth_context_id.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit
7a6a1aae6fa74ab0f55c1160aedd2d79c9a44a90)
auth_length = DCERPC_AUTH_TRAILER_LENGTH + pkt->auth_length;
if (pkt_trailer->length < auth_length) {
- return NT_STATUS_RPC_PROTOCOL_ERROR;
+ return NT_STATUS_INTERNAL_ERROR;
}
data_and_pad = pkt_trailer->length - auth_length;
if ((auth_offset % 4) != 0) {
DBG_WARNING("auth_offset[%u] not 4 byte aligned\n",
(unsigned)auth_offset);
+ auth->auth_context_id = DCERPC_BIND_NAK_REASON_NOT_SPECIFIED;
return NT_STATUS_RPC_PROTOCOL_ERROR;
}
auth->auth_pad_length));
talloc_free(ndr);
ZERO_STRUCTP(auth);
+ auth->auth_context_id = DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED;
return NT_STATUS_RPC_PROTOCOL_ERROR;
}
auth->auth_pad_length);
talloc_free(ndr);
ZERO_STRUCTP(auth);
+ auth->auth_context_id = DCERPC_BIND_NAK_REASON_NOT_SPECIFIED;
return NT_STATUS_RPC_PROTOCOL_ERROR;
}
*/
auth->auth_type = DCERPC_AUTH_TYPE_NONE;
auth->auth_level = DCERPC_AUTH_LEVEL_NONE;
- auth->auth_context_id =
- DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED;
+ if (NT_STATUS_EQUAL(status, NT_STATUS_RPC_PROTOCOL_ERROR)) {
+ auth->auth_context_id =
+ call->in_auth_info.auth_context_id;
+ } else {
+ auth->auth_context_id =
+ DCERPC_BIND_NAK_REASON_NOT_SPECIFIED;
+ }
return false;
}
^samba.tests.dcerpc.raw_protocol.samba.tests.dcerpc.raw_protocol.TestDCERPC_BIND.test_auth_mid_pad_ntlm_auth3
^samba.tests.dcerpc.raw_protocol.samba.tests.dcerpc.raw_protocol.TestDCERPC_BIND.test_auth_mid_pad_spnego_alter
^samba.tests.dcerpc.raw_protocol.samba.tests.dcerpc.raw_protocol.TestDCERPC_BIND.test_auth_mid_pad_spnego_auth3
-^samba.tests.dcerpc.raw_protocol.samba.tests.dcerpc.raw_protocol.TestDCERPC_BIND.test_auth_pad_bind_align2_ntlm
-^samba.tests.dcerpc.raw_protocol.samba.tests.dcerpc.raw_protocol.TestDCERPC_BIND.test_auth_pad_bind_align2_spnego
^samba.tests.dcerpc.raw_protocol.samba.tests.dcerpc.raw_protocol.TestDCERPC_BIND.test_auth_pad_auth3_align2_ntlm
^samba.tests.dcerpc.raw_protocol.samba.tests.dcerpc.raw_protocol.TestDCERPC_BIND.test_auth_pad_auth3_align2_spnego
^samba.tests.dcerpc.raw_protocol.samba.tests.dcerpc.raw_protocol.TestDCERPC_BIND.test_auth_pad_ntlm_2889_alter