libcli:auth: Return NTSTATUS for netlogon_creds_encrypt_samlogon_validation()
[samba.git] / source4 / rpc_server / dcesrv_auth.c
1 /* 
2    Unix SMB/CIFS implementation.
3
4    server side dcerpc authentication code
5
6    Copyright (C) Andrew Tridgell 2003
7    Copyright (C) Stefan (metze) Metzmacher 2004
8
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 */
22
23 #include "includes.h"
24 #include "rpc_server/dcerpc_server.h"
25 #include "rpc_server/dcerpc_server_proto.h"
26 #include "rpc_server/common/proto.h"
27 #include "librpc/rpc/dcerpc_proto.h"
28 #include "librpc/gen_ndr/ndr_dcerpc.h"
29 #include "auth/credentials/credentials.h"
30 #include "auth/gensec/gensec.h"
31 #include "auth/auth.h"
32 #include "param/param.h"
33 #include "librpc/rpc/rpc_common.h"
34
35 static NTSTATUS dcesrv_auth_negotiate_hdr_signing(struct dcesrv_call_state *call,
36                                                   struct ncacn_packet *pkt)
37 {
38         struct dcesrv_connection *dce_conn = call->conn;
39         struct dcesrv_auth *a = NULL;
40
41         if (!(call->pkt.pfc_flags & DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN)) {
42                 return NT_STATUS_OK;
43         }
44
45         if (dce_conn->client_hdr_signing) {
46                 if (dce_conn->negotiated_hdr_signing && pkt != NULL) {
47                         pkt->pfc_flags |= DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN;
48                 }
49                 return NT_STATUS_OK;
50         }
51
52         dce_conn->client_hdr_signing = true;
53         dce_conn->negotiated_hdr_signing = dce_conn->support_hdr_signing;
54
55         if (!dce_conn->negotiated_hdr_signing) {
56                 return NT_STATUS_OK;
57         }
58
59         if (pkt != NULL) {
60                 pkt->pfc_flags |= DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN;
61         }
62
63         a = call->conn->default_auth_state;
64         if (a->gensec_security != NULL) {
65                 gensec_want_feature(a->gensec_security,
66                                     GENSEC_FEATURE_SIGN_PKT_HEADER);
67         }
68
69         for (a = call->conn->auth_states; a != NULL; a = a->next) {
70                 if (a->gensec_security == NULL) {
71                         continue;
72                 }
73
74                 gensec_want_feature(a->gensec_security,
75                                     GENSEC_FEATURE_SIGN_PKT_HEADER);
76         }
77
78         return NT_STATUS_OK;
79 }
80
81 static bool dcesrv_auth_prepare_gensec(struct dcesrv_call_state *call)
82 {
83         struct cli_credentials *server_credentials = NULL;
84         struct dcesrv_connection *dce_conn = call->conn;
85         struct dcesrv_auth *auth = call->auth_state;
86         NTSTATUS status;
87
88         if (auth->auth_started) {
89                 return false;
90         }
91
92         auth->auth_started = true;
93
94         if (auth->auth_invalid) {
95                 return false;
96         }
97
98         if (auth->auth_finished) {
99                 return false;
100         }
101
102         if (auth->gensec_security != NULL) {
103                 return false;
104         }
105
106         switch (call->in_auth_info.auth_level) {
107         case DCERPC_AUTH_LEVEL_CONNECT:
108         case DCERPC_AUTH_LEVEL_CALL:
109         case DCERPC_AUTH_LEVEL_PACKET:
110         case DCERPC_AUTH_LEVEL_INTEGRITY:
111         case DCERPC_AUTH_LEVEL_PRIVACY:
112                 /*
113                  * We evaluate auth_type only if auth_level was valid
114                  */
115                 break;
116         default:
117                 /*
118                  * Setting DCERPC_AUTH_LEVEL_NONE,
119                  * gives the caller the reject_reason
120                  * as auth_context_id.
121                  *
122                  * Note: DCERPC_AUTH_LEVEL_NONE == 1
123                  */
124                 auth->auth_type = DCERPC_AUTH_TYPE_NONE;
125                 auth->auth_level = DCERPC_AUTH_LEVEL_NONE;
126                 auth->auth_context_id = DCERPC_BIND_NAK_REASON_NOT_SPECIFIED;
127                 return false;
128         }
129
130         auth->auth_type = call->in_auth_info.auth_type;
131         auth->auth_level = call->in_auth_info.auth_level;
132         auth->auth_context_id = call->in_auth_info.auth_context_id;
133
134         server_credentials 
135                 = cli_credentials_init(auth);
136         if (!server_credentials) {
137                 DEBUG(1, ("Failed to init server credentials\n"));
138                 return false;
139         }
140         
141         cli_credentials_set_conf(server_credentials, call->conn->dce_ctx->lp_ctx);
142         status = cli_credentials_set_machine_account(server_credentials, call->conn->dce_ctx->lp_ctx);
143         if (!NT_STATUS_IS_OK(status)) {
144                 DEBUG(1, ("Failed to obtain server credentials: %s\n",
145                           nt_errstr(status)));
146                 return false;
147         }
148
149         status = samba_server_gensec_start(auth,
150                                            call->event_ctx,
151                                            call->msg_ctx,
152                                            call->conn->dce_ctx->lp_ctx,
153                                            server_credentials,
154                                            NULL,
155                                            &auth->gensec_security);
156         if (!NT_STATUS_IS_OK(status)) {
157                 DEBUG(1, ("Failed to call samba_server_gensec_start %s\n",
158                           nt_errstr(status)));
159                 return false;
160         }
161
162         /*
163          * We have to call this because we set the target_service for
164          * Kerberos to NULL above, and in any case we wish to log a
165          * more specific service target.
166          *
167          */
168         status = gensec_set_target_service_description(auth->gensec_security,
169                                                        "DCE/RPC");
170         if (!NT_STATUS_IS_OK(status)) {
171                 DEBUG(1, ("Failed to call gensec_set_target_service_description %s\n",
172                           nt_errstr(status)));
173                 return false;
174         }
175
176         if (call->conn->remote_address != NULL) {
177                 status = gensec_set_remote_address(auth->gensec_security,
178                                                 call->conn->remote_address);
179                 if (!NT_STATUS_IS_OK(status)) {
180                         DEBUG(1, ("Failed to call gensec_set_remote_address() %s\n",
181                                   nt_errstr(status)));
182                         return false;
183                 }
184         }
185
186         if (call->conn->local_address != NULL) {
187                 status = gensec_set_local_address(auth->gensec_security,
188                                                   call->conn->local_address);
189                 if (!NT_STATUS_IS_OK(status)) {
190                         DEBUG(1, ("Failed to call gensec_set_local_address() %s\n",
191                                   nt_errstr(status)));
192                         return false;
193                 }
194         }
195
196         status = gensec_start_mech_by_authtype(auth->gensec_security, auth->auth_type,
197                                                auth->auth_level);
198         if (!NT_STATUS_IS_OK(status)) {
199                 const char *backend_name =
200                         gensec_get_name_by_authtype(auth->gensec_security,
201                                                     auth->auth_type);
202
203                 DEBUG(3, ("Failed to start GENSEC mechanism for DCERPC server: "
204                           "auth_type=%d (%s), auth_level=%d: %s\n",
205                           (int)auth->auth_type, backend_name,
206                           (int)auth->auth_level,
207                           nt_errstr(status)));
208
209                 /*
210                  * Setting DCERPC_AUTH_LEVEL_NONE,
211                  * gives the caller the reject_reason
212                  * as auth_context_id.
213                  *
214                  * Note: DCERPC_AUTH_LEVEL_NONE == 1
215                  */
216                 auth->auth_type = DCERPC_AUTH_TYPE_NONE;
217                 auth->auth_level = DCERPC_AUTH_LEVEL_NONE;
218                 if (backend_name != NULL) {
219                         auth->auth_context_id =
220                                 DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM;
221                 } else {
222                         auth->auth_context_id =
223                                 DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE;
224                 }
225                 return false;
226         }
227
228         if (dce_conn->negotiated_hdr_signing) {
229                 gensec_want_feature(auth->gensec_security,
230                                     GENSEC_FEATURE_SIGN_PKT_HEADER);
231         }
232
233         return true;
234 }
235
236 static void log_successful_dcesrv_authz_event(struct dcesrv_call_state *call)
237 {
238         struct dcesrv_auth *auth = call->auth_state;
239         enum dcerpc_transport_t transport =
240                 dcerpc_binding_get_transport(call->conn->endpoint->ep_description);
241         const char *auth_type = derpc_transport_string_by_transport(transport);
242         const char *transport_protection = AUTHZ_TRANSPORT_PROTECTION_NONE;
243
244         if (transport == NCACN_NP) {
245                 transport_protection = AUTHZ_TRANSPORT_PROTECTION_SMB;
246         }
247
248         /*
249          * Log the authorization to this RPC interface.  This
250          * covered ncacn_np pass-through auth, and anonymous
251          * DCE/RPC (eg epmapper, netlogon etc)
252          */
253         log_successful_authz_event(call->conn->msg_ctx,
254                                    call->conn->dce_ctx->lp_ctx,
255                                    call->conn->remote_address,
256                                    call->conn->local_address,
257                                    "DCE/RPC",
258                                    auth_type,
259                                    transport_protection,
260                                    auth->session_info);
261
262         auth->auth_audited = true;
263 }
264
265 static void dcesrv_default_auth_state_finish_bind(struct dcesrv_call_state *call)
266 {
267         SMB_ASSERT(call->pkt.ptype == DCERPC_PKT_BIND);
268
269         if (call->auth_state == call->conn->default_auth_state) {
270                 return;
271         }
272
273         if (call->conn->default_auth_state->auth_started) {
274                 return;
275         }
276
277         if (call->conn->default_auth_state->auth_invalid) {
278                 return;
279         }
280
281         call->conn->default_auth_state->auth_type = DCERPC_AUTH_TYPE_NONE;
282         call->conn->default_auth_state->auth_level = DCERPC_AUTH_LEVEL_NONE;
283         call->conn->default_auth_state->auth_context_id = 0;
284         call->conn->default_auth_state->auth_started = true;
285         call->conn->default_auth_state->auth_finished = true;
286
287         /*
288          *
289          * We defer log_successful_dcesrv_authz_event()
290          * to dcesrv_default_auth_state_prepare_request()
291          *
292          * As we don't want to trigger authz_events
293          * just for alter_context requests without authentication
294          */
295 }
296
297 void dcesrv_default_auth_state_prepare_request(struct dcesrv_call_state *call)
298 {
299         struct dcesrv_connection *dce_conn = call->conn;
300         struct dcesrv_auth *auth = call->auth_state;
301
302         if (auth->auth_audited) {
303                 return;
304         }
305
306         if (call->pkt.ptype != DCERPC_PKT_REQUEST) {
307                 return;
308         }
309
310         if (auth != dce_conn->default_auth_state) {
311                 return;
312         }
313
314         if (auth->auth_invalid) {
315                 return;
316         }
317
318         if (!auth->auth_finished) {
319                 return;
320         }
321
322         log_successful_dcesrv_authz_event(call);
323 }
324
325 /*
326   parse any auth information from a dcerpc bind request
327   return false if we can't handle the auth request for some
328   reason (in which case we send a bind_nak)
329 */
330 bool dcesrv_auth_bind(struct dcesrv_call_state *call)
331 {
332         struct ncacn_packet *pkt = &call->pkt;
333         struct dcesrv_auth *auth = call->auth_state;
334         NTSTATUS status;
335
336         if (pkt->auth_length == 0) {
337                 auth->auth_type = DCERPC_AUTH_TYPE_NONE;
338                 auth->auth_level = DCERPC_AUTH_LEVEL_NONE;
339                 auth->auth_context_id = 0;
340                 auth->auth_started = true;
341
342                 log_successful_dcesrv_authz_event(call);
343
344                 return true;
345         }
346
347         status = dcerpc_pull_auth_trailer(pkt, call, &pkt->u.bind.auth_info,
348                                           &call->in_auth_info,
349                                           NULL, true);
350         if (!NT_STATUS_IS_OK(status)) {
351                 /*
352                  * Setting DCERPC_AUTH_LEVEL_NONE,
353                  * gives the caller the reject_reason
354                  * as auth_context_id.
355                  *
356                  * Note: DCERPC_AUTH_LEVEL_NONE == 1
357                  */
358                 auth->auth_type = DCERPC_AUTH_TYPE_NONE;
359                 auth->auth_level = DCERPC_AUTH_LEVEL_NONE;
360                 auth->auth_context_id =
361                         DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED;
362                 return false;
363         }
364
365         return dcesrv_auth_prepare_gensec(call);
366 }
367
368 NTSTATUS dcesrv_auth_complete(struct dcesrv_call_state *call, NTSTATUS status)
369 {
370         struct dcesrv_auth *auth = call->auth_state;
371         const char *pdu = "<unknown>";
372
373         switch (call->pkt.ptype) {
374         case DCERPC_PKT_BIND:
375                 pdu = "BIND";
376                 break;
377         case DCERPC_PKT_ALTER:
378                 pdu = "ALTER";
379                 break;
380         case DCERPC_PKT_AUTH3:
381                 pdu = "AUTH3";
382                 if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
383                         DEBUG(4, ("GENSEC not finished at at %s\n", pdu));
384                         return NT_STATUS_RPC_SEC_PKG_ERROR;
385                 }
386                 break;
387         default:
388                 return NT_STATUS_INTERNAL_ERROR;
389         }
390
391         if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
392                 return NT_STATUS_OK;
393         }
394
395         if (!NT_STATUS_IS_OK(status)) {
396                 DEBUG(4, ("GENSEC mech rejected the incoming authentication "
397                           "at %s: %s\n", pdu, nt_errstr(status)));
398                 return status;
399         }
400
401         status = gensec_session_info(auth->gensec_security,
402                                      auth,
403                                      &auth->session_info);
404         if (!NT_STATUS_IS_OK(status)) {
405                 DEBUG(1, ("Failed to establish session_info: %s\n",
406                           nt_errstr(status)));
407                 return status;
408         }
409         auth->auth_finished = true;
410
411         if (auth->auth_level == DCERPC_AUTH_LEVEL_CONNECT &&
412             !call->conn->got_explicit_auth_level_connect)
413         {
414                 call->conn->default_auth_level_connect = auth;
415         }
416
417         if (call->pkt.ptype != DCERPC_PKT_AUTH3) {
418                 return NT_STATUS_OK;
419         }
420
421         if (call->out_auth_info->credentials.length != 0) {
422                 DEBUG(4, ("GENSEC produced output token (len=%zu) at %s\n",
423                           call->out_auth_info->credentials.length, pdu));
424                 return NT_STATUS_RPC_SEC_PKG_ERROR;
425         }
426
427         return NT_STATUS_OK;
428 }
429
430 /*
431   add any auth information needed in a bind ack, and process the authentication
432   information found in the bind.
433 */
434 NTSTATUS dcesrv_auth_prepare_bind_ack(struct dcesrv_call_state *call, struct ncacn_packet *pkt)
435 {
436         struct dcesrv_connection *dce_conn = call->conn;
437         struct dcesrv_auth *auth = call->auth_state;
438         NTSTATUS status;
439
440         status = dcesrv_auth_negotiate_hdr_signing(call, pkt);
441         if (!NT_STATUS_IS_OK(status)) {
442                 return status;
443         }
444
445         dce_conn->allow_alter = true;
446         dcesrv_default_auth_state_finish_bind(call);
447
448         if (call->pkt.auth_length == 0) {
449                 auth->auth_finished = true;
450                 return NT_STATUS_OK;
451         }
452
453         /* We can't work without an existing gensec state */
454         if (auth->gensec_security == NULL) {
455                 return NT_STATUS_INTERNAL_ERROR;
456         }
457
458         call->_out_auth_info = (struct dcerpc_auth) {
459                 .auth_type = auth->auth_type,
460                 .auth_level = auth->auth_level,
461                 .auth_context_id = auth->auth_context_id,
462         };
463         call->out_auth_info = &call->_out_auth_info;
464
465         return NT_STATUS_OK;
466 }
467
468 /*
469   process the final stage of a auth request
470 */
471 bool dcesrv_auth_prepare_auth3(struct dcesrv_call_state *call)
472 {
473         struct ncacn_packet *pkt = &call->pkt;
474         struct dcesrv_auth *auth = call->auth_state;
475         NTSTATUS status;
476
477         if (pkt->auth_length == 0) {
478                 return false;
479         }
480
481         if (auth->auth_finished) {
482                 return false;
483         }
484
485         /* We can't work without an existing gensec state */
486         if (auth->gensec_security == NULL) {
487                 return false;
488         }
489
490         status = dcerpc_pull_auth_trailer(pkt, call, &pkt->u.auth3.auth_info,
491                                           &call->in_auth_info, NULL, true);
492         if (!NT_STATUS_IS_OK(status)) {
493                 /*
494                  * Windows returns DCERPC_NCA_S_FAULT_REMOTE_NO_MEMORY
495                  * instead of DCERPC_NCA_S_PROTO_ERROR.
496                  */
497                 call->fault_code = DCERPC_NCA_S_FAULT_REMOTE_NO_MEMORY;
498                 return false;
499         }
500
501         if (call->in_auth_info.auth_type != auth->auth_type) {
502                 return false;
503         }
504
505         if (call->in_auth_info.auth_level != auth->auth_level) {
506                 return false;
507         }
508
509         if (call->in_auth_info.auth_context_id != auth->auth_context_id) {
510                 return false;
511         }
512
513         call->_out_auth_info = (struct dcerpc_auth) {
514                 .auth_type = auth->auth_type,
515                 .auth_level = auth->auth_level,
516                 .auth_context_id = auth->auth_context_id,
517         };
518         call->out_auth_info = &call->_out_auth_info;
519
520         return true;
521 }
522
523 /*
524   parse any auth information from a dcerpc alter request
525   return false if we can't handle the auth request for some 
526   reason (in which case we send a bind_nak (is this true for here?))
527 */
528 bool dcesrv_auth_alter(struct dcesrv_call_state *call)
529 {
530         struct ncacn_packet *pkt = &call->pkt;
531         struct dcesrv_auth *auth = call->auth_state;
532         NTSTATUS status;
533
534         /* on a pure interface change there is no auth blob */
535         if (pkt->auth_length == 0) {
536                 if (!auth->auth_finished) {
537                         return false;
538                 }
539                 return true;
540         }
541
542         if (auth->auth_finished) {
543                 call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
544                 return false;
545         }
546
547         status = dcerpc_pull_auth_trailer(pkt, call, &pkt->u.alter.auth_info,
548                                           &call->in_auth_info, NULL, true);
549         if (!NT_STATUS_IS_OK(status)) {
550                 call->fault_code = DCERPC_NCA_S_PROTO_ERROR;
551                 return false;
552         }
553
554         if (!auth->auth_started) {
555                 bool ok;
556
557                 ok = dcesrv_auth_prepare_gensec(call);
558                 if (!ok) {
559                         call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
560                         return false;
561                 }
562
563                 return true;
564         }
565
566         if (call->in_auth_info.auth_type == DCERPC_AUTH_TYPE_NONE) {
567                 call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
568                 return false;
569         }
570
571         if (call->in_auth_info.auth_type != auth->auth_type) {
572                 return false;
573         }
574
575         if (call->in_auth_info.auth_level != auth->auth_level) {
576                 return false;
577         }
578
579         if (call->in_auth_info.auth_context_id != auth->auth_context_id) {
580                 return false;
581         }
582
583         return true;
584 }
585
586 /*
587   add any auth information needed in a alter ack, and process the authentication
588   information found in the alter.
589 */
590 NTSTATUS dcesrv_auth_prepare_alter_ack(struct dcesrv_call_state *call, struct ncacn_packet *pkt)
591 {
592         struct dcesrv_auth *auth = call->auth_state;
593         NTSTATUS status;
594
595         status = dcesrv_auth_negotiate_hdr_signing(call, pkt);
596         if (!NT_STATUS_IS_OK(status)) {
597                 return status;
598         }
599
600         /* on a pure interface change there is no auth_info structure
601            setup */
602         if (call->pkt.auth_length == 0) {
603                 return NT_STATUS_OK;
604         }
605
606         if (auth->gensec_security == NULL) {
607                 return NT_STATUS_INTERNAL_ERROR;
608         }
609
610         call->_out_auth_info = (struct dcerpc_auth) {
611                 .auth_type = auth->auth_type,
612                 .auth_level = auth->auth_level,
613                 .auth_context_id = auth->auth_context_id,
614         };
615         call->out_auth_info = &call->_out_auth_info;
616
617         return NT_STATUS_OK;
618 }
619
620 /*
621   check credentials on a packet
622 */
623 bool dcesrv_auth_pkt_pull(struct dcesrv_call_state *call,
624                           DATA_BLOB *full_packet,
625                           uint8_t required_flags,
626                           uint8_t optional_flags,
627                           uint8_t payload_offset,
628                           DATA_BLOB *payload_and_verifier)
629 {
630         struct ncacn_packet *pkt = &call->pkt;
631         struct dcesrv_auth *auth = call->auth_state;
632         const struct dcerpc_auth tmp_auth = {
633                 .auth_type = auth->auth_type,
634                 .auth_level = auth->auth_level,
635                 .auth_context_id = auth->auth_context_id,
636         };
637         NTSTATUS status;
638
639         if (!auth->auth_started) {
640                 return false;
641         }
642
643         if (!auth->auth_finished) {
644                 call->fault_code = DCERPC_NCA_S_PROTO_ERROR;
645                 return false;
646         }
647
648         if (auth->auth_invalid) {
649                 return false;
650         }
651
652         status = dcerpc_ncacn_pull_pkt_auth(&tmp_auth,
653                                             auth->gensec_security,
654                                             call,
655                                             pkt->ptype,
656                                             required_flags,
657                                             optional_flags,
658                                             payload_offset,
659                                             payload_and_verifier,
660                                             full_packet,
661                                             pkt);
662         if (NT_STATUS_EQUAL(status, NT_STATUS_RPC_PROTOCOL_ERROR)) {
663                 call->fault_code = DCERPC_NCA_S_PROTO_ERROR;
664                 return false;
665         }
666         if (NT_STATUS_EQUAL(status, NT_STATUS_RPC_UNSUPPORTED_AUTHN_LEVEL)) {
667                 call->fault_code = DCERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL;
668                 return false;
669         }
670         if (NT_STATUS_EQUAL(status, NT_STATUS_RPC_SEC_PKG_ERROR)) {
671                 call->fault_code = DCERPC_FAULT_SEC_PKG_ERROR;
672                 return false;
673         }
674         if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
675                 call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
676                 return false;
677         }
678         if (!NT_STATUS_IS_OK(status)) {
679                 return false;
680         }
681
682         return true;
683 }
684
685 /* 
686    push a signed or sealed dcerpc request packet into a blob
687 */
688 bool dcesrv_auth_pkt_push(struct dcesrv_call_state *call,
689                           DATA_BLOB *blob, size_t sig_size,
690                           uint8_t payload_offset,
691                           const DATA_BLOB *payload,
692                           const struct ncacn_packet *pkt)
693 {
694         struct dcesrv_auth *auth = call->auth_state;
695         const struct dcerpc_auth tmp_auth = {
696                 .auth_type = auth->auth_type,
697                 .auth_level = auth->auth_level,
698                 .auth_context_id = auth->auth_context_id,
699         };
700         NTSTATUS status;
701
702         status = dcerpc_ncacn_push_pkt_auth(&tmp_auth,
703                                             auth->gensec_security,
704                                             call, blob, sig_size,
705                                             payload_offset,
706                                             payload,
707                                             pkt);
708         return NT_STATUS_IS_OK(status);
709 }