2 * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved.
10 #include <gssapi/gssapi.h>
11 #include <gssapi/gssapi_generic.h>
13 #include <gssapi/gssapi_krb5.h>
16 #include <gssrpc/rpc.h>
17 #include <gssrpc/auth_gssapi.h>
19 #include "gssrpcint.h"
22 #define DEBUG_GSSAPI 1
26 int auth_debug_gssapi = DEBUG_GSSAPI;
27 extern void gssrpcint_printf(const char *format, ...);
28 #define L_PRINTF(l,args) if (auth_debug_gssapi >= l) gssrpcint_printf args
29 #define PRINTF(args) L_PRINTF(99, args)
30 #define AUTH_GSSAPI_DISPLAY_STATUS(args) \
31 if (auth_debug_gssapi) auth_gssapi_display_status args
34 #define L_PRINTF(l, args)
35 #define AUTH_GSSAPI_DISPLAY_STATUS(args)
38 static void auth_gssapi_nextverf(AUTH *);
39 static bool_t auth_gssapi_marshall(AUTH *, XDR *);
40 static bool_t auth_gssapi_validate(AUTH *, struct opaque_auth *);
41 static bool_t auth_gssapi_refresh(AUTH *, struct rpc_msg *);
42 static bool_t auth_gssapi_wrap(AUTH *, XDR *, xdrproc_t, caddr_t);
43 static bool_t auth_gssapi_unwrap(AUTH *, XDR *, xdrproc_t, caddr_t);
44 static void auth_gssapi_destroy(AUTH *);
46 static bool_t marshall_new_creds(AUTH *, bool_t, gss_buffer_t);
48 static struct auth_ops auth_gssapi_ops = {
59 * the ah_private data structure for an auth_handle
61 struct auth_gssapi_data {
65 gss_buffer_desc client_handle;
69 /* pre-serialized ah_cred */
70 unsigned char cred_buf[MAX_AUTH_BYTES];
73 #define AUTH_PRIVATE(auth) ((struct auth_gssapi_data *)auth->ah_private)
76 * Function: auth_gssapi_create_default
78 * Purpose: Create a GSS-API style authenticator, with default
79 * options, and return the handle.
81 * Effects: See design document, section XXX.
83 AUTH *auth_gssapi_create_default(CLIENT *clnt, char *service_name)
86 OM_uint32 gssstat, minor_stat;
87 gss_buffer_desc input_name;
88 gss_name_t target_name;
90 input_name.value = service_name;
91 input_name.length = strlen(service_name) + 1;
93 gssstat = gss_import_name(&minor_stat, &input_name,
94 gss_nt_service_name, &target_name);
95 if (gssstat != GSS_S_COMPLETE) {
96 AUTH_GSSAPI_DISPLAY_STATUS(("parsing name", gssstat,
98 rpc_createerr.cf_stat = RPC_SYSTEMERROR;
99 rpc_createerr.cf_error.re_errno = ENOMEM;
103 auth = auth_gssapi_create(clnt,
109 GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG,
115 gss_release_name(&minor_stat, &target_name);
120 * Function: auth_gssapi_create
122 * Purpose: Create a GSS-API style authenticator, with all the
123 * options, and return the handle.
125 * Effects: See design document, section XXX.
127 AUTH *auth_gssapi_create(
130 OM_uint32 *minor_stat,
131 gss_cred_id_t claimant_cred_handle,
132 gss_name_t target_name,
136 gss_OID *actual_mech_type,
137 OM_uint32 *ret_flags,
140 AUTH *auth, *save_auth;
141 struct auth_gssapi_data *pdata;
142 struct gss_channel_bindings_struct bindings, *bindp;
143 struct sockaddr_in laddr, raddr;
144 enum clnt_stat callstat;
145 struct timeval timeout;
149 auth_gssapi_init_arg call_arg;
150 auth_gssapi_init_res call_res;
151 gss_buffer_desc *input_token, isn_buf;
153 memset(&rpc_createerr, 0, sizeof(rpc_createerr));
155 /* this timeout is only used if clnt_control(clnt, CLSET_TIMEOUT) */
156 /* has not already been called.. therefore, we can just pick */
157 /* something reasonable-sounding.. */
164 /* don't assume the caller will want to change clnt->cl_auth */
165 save_auth = clnt->cl_auth;
167 auth = (AUTH *) malloc(sizeof(*auth));
168 pdata = (struct auth_gssapi_data *) malloc(sizeof(*pdata));
169 if (auth == NULL || pdata == NULL) {
170 /* They needn't both have failed; clean up. */
175 rpc_createerr.cf_stat = RPC_SYSTEMERROR;
176 rpc_createerr.cf_error.re_errno = ENOMEM;
179 memset(auth, 0, sizeof(*auth));
180 memset(pdata, 0, sizeof(*pdata));
182 auth->ah_ops = &auth_gssapi_ops;
183 auth->ah_private = (caddr_t) pdata;
185 /* initial creds are auth_msg TRUE and no handle */
186 marshall_new_creds(auth, TRUE, NULL);
188 /* initial verifier is empty */
189 auth->ah_verf.oa_flavor = AUTH_GSSAPI;
190 auth->ah_verf.oa_base = NULL;
191 auth->ah_verf.oa_length = 0;
193 AUTH_PRIVATE(auth)->established = FALSE;
194 AUTH_PRIVATE(auth)->clnt = clnt;
195 AUTH_PRIVATE(auth)->def_cred = (claimant_cred_handle ==
196 GSS_C_NO_CREDENTIAL);
198 clnt->cl_auth = auth;
200 /* start by trying latest version */
201 call_arg.version = 4;
205 /* set state for initial call to init_sec_context */
206 input_token = GSS_C_NO_BUFFER;
207 AUTH_PRIVATE(auth)->context = GSS_C_NO_CONTEXT;
208 init_func = AUTH_GSSAPI_INIT;
212 * OV servers up to version 3 used the old mech id. Beta 7
213 * servers used version 3 with the new mech id; however, the beta
214 * 7 gss-api accept_sec_context accepts either mech id. Thus, if
215 * any server rejects version 4, we fall back to version 3 with
216 * the old mech id; for the OV server it will be right, and for
217 * the beta 7 server it will be accepted. Not ideal, but it
220 if (call_arg.version < 4 && (mech_type == gss_mech_krb5 ||
221 mech_type == GSS_C_NULL_OID))
222 mech_type = (gss_OID) gss_mech_krb5_old;
225 if (!bindings_failed && call_arg.version >= 3) {
226 if (clnt_control(clnt, CLGET_LOCAL_ADDR, &laddr) == FALSE) {
227 PRINTF(("gssapi_create: CLGET_LOCAL_ADDR failed"));
230 if (clnt_control(clnt, CLGET_SERVER_ADDR, &raddr) == FALSE) {
231 PRINTF(("gssapi_create: CLGET_SERVER_ADDR failed"));
235 memset(&bindings, 0, sizeof(bindings));
236 bindings.application_data.length = 0;
237 bindings.initiator_addrtype = GSS_C_AF_INET;
238 bindings.initiator_address.length = 4;
239 bindings.initiator_address.value = &laddr.sin_addr.s_addr;
241 bindings.acceptor_addrtype = GSS_C_AF_INET;
242 bindings.acceptor_address.length = 4;
243 bindings.acceptor_address.value = &raddr.sin_addr.s_addr;
249 memset(&call_res, 0, sizeof(call_res));
252 *gssstat = gss_init_sec_context(minor_stat,
253 claimant_cred_handle,
254 &AUTH_PRIVATE(auth)->context,
266 if (*gssstat != GSS_S_COMPLETE && *gssstat != GSS_S_CONTINUE_NEEDED) {
267 AUTH_GSSAPI_DISPLAY_STATUS(("initializing context", *gssstat,
272 /* if we got a token, pass it on */
273 if (call_arg.token.length != 0) {
276 * sanity check: if we received a signed isn in the last
277 * response then there *cannot* be another token to send
279 if (call_res.signed_isn.length != 0) {
280 PRINTF(("gssapi_create: unexpected token from init_sec\n"));
284 PRINTF(("gssapi_create: calling GSSAPI_INIT (%d)\n", init_func));
286 xdr_free(xdr_authgssapi_init_res, &call_res);
287 memset(&call_res, 0, sizeof(call_res));
288 callstat = clnt_call(clnt, init_func,
289 xdr_authgssapi_init_arg, &call_arg,
290 xdr_authgssapi_init_res, &call_res,
292 gss_release_buffer(minor_stat, &call_arg.token);
294 if (callstat != RPC_SUCCESS) {
297 clnt_geterr(clnt, &err);
298 if (callstat == RPC_AUTHERROR &&
299 (err.re_why == AUTH_BADCRED || err.re_why == AUTH_FAILED)
300 && call_arg.version >= 1) {
302 ("call_arg protocol version %d rejected, trying %d.\n",
303 call_arg.version, call_arg.version-1));
305 goto try_new_version;
307 PRINTF(("gssapi_create: GSSAPI_INIT (%d) failed, stat %d\n",
308 init_func, callstat));
312 } else if (call_res.version != call_arg.version &&
313 !(call_arg.version == 2 && call_res.version == 1)) {
315 * The Secure 1.1 servers always respond with version
316 * 1. Thus, if we just tried a version >=3, fall all
317 * the way back to version 1 since that is all they
320 if (call_arg.version > 2 && call_res.version == 1) {
322 ("Talking to Secure 1.1 server, using version 1.\n"));
323 call_arg.version = 1;
324 goto try_new_version;
327 PRINTF(("gssapi_create: invalid call_res vers %d\n",
330 } else if (call_res.gss_major != GSS_S_COMPLETE) {
331 AUTH_GSSAPI_DISPLAY_STATUS(("in response from server",
333 call_res.gss_minor));
337 PRINTF(("gssapi_create: GSSAPI_INIT (%d) succeeded\n", init_func));
338 init_func = AUTH_GSSAPI_CONTINUE_INIT;
340 /* check for client_handle */
341 if (AUTH_PRIVATE(auth)->client_handle.length == 0) {
342 if (call_res.client_handle.length == 0) {
343 PRINTF(("gssapi_create: expected client_handle\n"));
346 PRINTF(("gssapi_create: got client_handle %d\n",
347 *((uint32_t *)call_res.client_handle.value)));
349 GSS_DUP_BUFFER(AUTH_PRIVATE(auth)->client_handle,
350 call_res.client_handle);
352 /* auth_msg is TRUE; there may be more tokens */
353 marshall_new_creds(auth, TRUE,
354 &AUTH_PRIVATE(auth)->client_handle);
356 } else if (!GSS_BUFFERS_EQUAL(AUTH_PRIVATE(auth)->client_handle,
357 call_res.client_handle)) {
358 PRINTF(("gssapi_create: got different client_handle\n"));
362 /* check for token */
363 if (call_res.token.length==0 && *gssstat==GSS_S_CONTINUE_NEEDED) {
364 PRINTF(("gssapi_create: expected token\n"));
366 } else if (call_res.token.length != 0) {
367 if (*gssstat == GSS_S_COMPLETE) {
368 PRINTF(("gssapi_create: got unexpected token\n"));
371 /* assumes call_res is safe until init_sec_context */
372 input_token = &call_res.token;
373 PRINTF(("gssapi_create: got new token\n"));
379 if (*gssstat == GSS_S_COMPLETE) {
380 if (call_res.signed_isn.length == 0) {
381 PRINTF(("gssapi_created: expected signed isn\n"));
384 PRINTF(("gssapi_create: processing signed isn\n"));
386 /* don't check conf (integ only) or qop (accpet default) */
387 *gssstat = gss_unseal(minor_stat,
388 AUTH_PRIVATE(auth)->context,
389 &call_res.signed_isn,
390 &isn_buf, NULL, NULL);
392 if (*gssstat != GSS_S_COMPLETE) {
393 AUTH_GSSAPI_DISPLAY_STATUS(("unsealing isn",
394 *gssstat, *minor_stat));
396 } else if (isn_buf.length != sizeof(uint32_t)) {
397 PRINTF(("gssapi_create: gss_unseal gave %d bytes\n",
398 (int) isn_buf.length));
402 AUTH_PRIVATE(auth)->seq_num = (uint32_t)
403 ntohl(*((uint32_t*)isn_buf.value));
404 *gssstat = gss_release_buffer(minor_stat, &isn_buf);
405 if (*gssstat != GSS_S_COMPLETE) {
406 AUTH_GSSAPI_DISPLAY_STATUS(("releasing unsealed isn",
407 *gssstat, *minor_stat));
411 PRINTF(("gssapi_create: isn is %d\n",
412 AUTH_PRIVATE(auth)->seq_num));
414 } else if (call_res.signed_isn.length != 0) {
415 PRINTF(("gssapi_create: got signed isn, can't check yet\n"));
418 /* results were okay.. continue if necessary */
419 if (*gssstat == GSS_S_CONTINUE_NEEDED) {
420 PRINTF(("gssapi_create: not done, continuing\n"));
425 * Done! Context is established, we have client_handle and isn.
427 AUTH_PRIVATE(auth)->established = TRUE;
429 marshall_new_creds(auth, FALSE,
430 &AUTH_PRIVATE(auth)->client_handle);
432 PRINTF(("gssapi_create: done. client_handle %#x, isn %d\n\n",
433 *((uint32_t *)AUTH_PRIVATE(auth)->client_handle.value),
434 AUTH_PRIVATE(auth)->seq_num));
436 /* don't assume the caller will want to change clnt->cl_auth */
437 clnt->cl_auth = save_auth;
439 xdr_free(xdr_authgssapi_init_res, &call_res);
442 /******************************************************************/
445 PRINTF(("gssapi_create: bailing\n\n"));
448 if (AUTH_PRIVATE(auth))
449 auth_gssapi_destroy(auth);
455 /* don't assume the caller will want to change clnt->cl_auth */
456 clnt->cl_auth = save_auth;
458 if (rpc_createerr.cf_stat == 0)
459 rpc_createerr.cf_stat = RPC_AUTHERROR;
461 xdr_free(xdr_authgssapi_init_res, &call_res);
466 * Function: marshall_new_creds
468 * Purpose: (pre-)serialize auth_msg and client_handle fields of
469 * auth_gssapi_creds into auth->cred_buf
473 * auth (r/w) the AUTH structure to modify
474 * auth_msg (r) the auth_msg field to serialize
475 * client_handle (r) the client_handle field to serialize, or
478 * Returns: TRUE if successful, FALSE if not
480 * Requires: auth must point to a valid GSS-API auth structure, auth_msg
481 * must be TRUE or FALSE, client_handle must be a gss_buffer_t with a valid
482 * value and length field or NULL.
484 * Effects: auth->ah_cred is set to the serialized auth_gssapi_creds
485 * version 2 structure (stored in the cred_buf field of private data)
486 * containing version, auth_msg and client_handle.
487 * auth->ah_cred.oa_flavor is set to AUTH_GSSAPI. If cliend_handle is
488 * NULL, it is treated as if it had a length of 0 and a value of NULL.
492 static bool_t marshall_new_creds(
495 gss_buffer_t client_handle)
497 auth_gssapi_creds creds;
500 PRINTF(("marshall_new_creds: starting\n"));
504 creds.auth_msg = auth_msg;
506 GSS_COPY_BUFFER(creds.client_handle, *client_handle)
508 creds.client_handle.length = 0;
509 creds.client_handle.value = NULL;
512 xdrmem_create(&xdrs, (caddr_t) AUTH_PRIVATE(auth)->cred_buf,
513 MAX_AUTH_BYTES, XDR_ENCODE);
514 if (! xdr_authgssapi_creds(&xdrs, &creds)) {
515 PRINTF(("marshall_new_creds: failed encoding auth_gssapi_creds\n"));
519 AUTH_PRIVATE(auth)->cred_len = xdr_getpos(&xdrs);
522 PRINTF(("marshall_new_creds: auth_gssapi_creds is %d bytes\n",
523 AUTH_PRIVATE(auth)->cred_len));
525 auth->ah_cred.oa_flavor = AUTH_GSSAPI;
526 auth->ah_cred.oa_base = (char *) AUTH_PRIVATE(auth)->cred_buf;
527 auth->ah_cred.oa_length = AUTH_PRIVATE(auth)->cred_len;
529 PRINTF(("marshall_new_creds: succeeding\n"));
536 * Function: auth_gssapi_nextverf
540 * Effects: None. Never called.
542 static void auth_gssapi_nextverf(AUTH *auth)
547 * Function: auth_gssapi_marhsall
549 * Purpose: Marshall RPC credentials and verifier onto xdr stream.
553 * auth (r/w) AUTH structure for client
554 * xdrs (r/w) XDR stream to marshall to
556 * Returns: boolean indicating success/failure
560 * The pre-serialized credentials in cred_buf are serialized. If the
561 * context is established, the sealed sequence number is serialized as
562 * the verifier. If the context is not established, an empty verifier
563 * is serialized. The sequence number is *not* incremented, because
564 * this function is called multiple times if retransmission is required.
566 * If this took all the header fields as arguments, it could sign
569 static bool_t auth_gssapi_marshall(
573 OM_uint32 minor_stat;
574 gss_buffer_desc out_buf;
577 if (AUTH_PRIVATE(auth)->established == TRUE) {
578 PRINTF(("gssapi_marshall: starting\n"));
580 seq_num = AUTH_PRIVATE(auth)->seq_num + 1;
582 PRINTF(("gssapi_marshall: sending seq_num %d\n", seq_num));
584 if (auth_gssapi_seal_seq(AUTH_PRIVATE(auth)->context, seq_num,
585 &out_buf) == FALSE) {
586 PRINTF(("gssapi_marhshall: seal failed\n"));
589 auth->ah_verf.oa_base = out_buf.value;
590 auth->ah_verf.oa_length = out_buf.length;
592 if (! xdr_opaque_auth(xdrs, &auth->ah_cred) ||
593 ! xdr_opaque_auth(xdrs, &auth->ah_verf)) {
594 (void) gss_release_buffer(&minor_stat, &out_buf);
597 (void) gss_release_buffer(&minor_stat, &out_buf);
599 PRINTF(("gssapi_marshall: not established, sending null verf\n"));
601 auth->ah_verf.oa_base = NULL;
602 auth->ah_verf.oa_length = 0;
604 if (! xdr_opaque_auth(xdrs, &auth->ah_cred) ||
605 ! xdr_opaque_auth(xdrs, &auth->ah_verf)) {
614 * Function: auth_gssapi_validate
616 * Purpose: Validate RPC response verifier from server.
618 * Effects: See design document, section XXX.
620 static bool_t auth_gssapi_validate(
622 struct opaque_auth *verf)
624 gss_buffer_desc in_buf;
627 if (AUTH_PRIVATE(auth)->established == FALSE) {
628 PRINTF(("gssapi_validate: not established, noop\n"));
632 PRINTF(("gssapi_validate: starting\n"));
634 in_buf.length = verf->oa_length;
635 in_buf.value = verf->oa_base;
636 if (auth_gssapi_unseal_seq(AUTH_PRIVATE(auth)->context, &in_buf,
637 &seq_num) == FALSE) {
638 PRINTF(("gssapi_validate: failed unsealing verifier\n"));
642 /* we sent seq_num+1, so we should get back seq_num+2 */
643 if (AUTH_PRIVATE(auth)->seq_num+2 != seq_num) {
644 PRINTF(("gssapi_validate: expecting seq_num %d, got %d (%#x)\n",
645 AUTH_PRIVATE(auth)->seq_num + 2, seq_num, seq_num));
648 PRINTF(("gssapi_validate: seq_num %d okay\n", seq_num));
650 /* +1 for successful transmission, +1 for successful validation */
651 AUTH_PRIVATE(auth)->seq_num += 2;
653 PRINTF(("gssapi_validate: succeeding\n"));
659 * Function: auth_gssapi_refresh
661 * Purpose: Attempts to resyncrhonize the sequence number.
665 * When the server receives a properly authenticated RPC call, it
666 * increments the sequence number it is expecting from the client.
667 * But if the server's response is lost for any reason, the client
668 * can't know whether the server ever received it, assumes it didn't,
669 * and does *not* increment its sequence number. Thus, the client's
670 * next call will fail with AUTH_REJECTEDCRED because the server will
671 * think it is a replay attack.
673 * When an AUTH_REJECTEDCRED error arrives, this function attempts to
674 * resyncrhonize by incrementing the client's sequence number and
675 * returning TRUE. If any other error arrives, it returns FALSE.
677 static bool_t auth_gssapi_refresh(
681 if (msg->rm_reply.rp_rjct.rj_stat == AUTH_ERROR &&
682 msg->rm_reply.rp_rjct.rj_why == AUTH_REJECTEDVERF) {
683 PRINTF(("gssapi_refresh: rejected verifier, incrementing\n"));
684 AUTH_PRIVATE(auth)->seq_num++;
687 PRINTF(("gssapi_refresh: failing\n"));
693 * Function: auth_gssapi_destroy
695 * Purpose: Destroy a GSS-API authentication structure.
697 * Effects: This function destroys the GSS-API authentication
698 * context, and sends a message to the server instructing it to
699 * invokte gss_process_token() and thereby destroy its corresponding
700 * context. Since the client doesn't really care whether the server
701 * gets this message, no failures are reported.
703 static void auth_gssapi_destroy(AUTH *auth)
705 struct timeval timeout;
706 OM_uint32 gssstat, minor_stat;
710 if (AUTH_PRIVATE(auth)->client_handle.length == 0) {
711 PRINTF(("gssapi_destroy: no client_handle, not calling destroy\n"));
715 PRINTF(("gssapi_destroy: marshalling new creds\n"));
716 if (!marshall_new_creds(auth, TRUE, &AUTH_PRIVATE(auth)->client_handle)) {
717 PRINTF(("gssapi_destroy: marshall_new_creds failed\n"));
721 PRINTF(("gssapi_destroy: calling GSSAPI_DESTROY\n"));
724 callstat = clnt_call(AUTH_PRIVATE(auth)->clnt, AUTH_GSSAPI_DESTROY,
725 xdr_void, NULL, xdr_void, NULL, timeout);
726 if (callstat != RPC_SUCCESS)
727 clnt_sperror(AUTH_PRIVATE(auth)->clnt,
728 "gssapi_destroy: GSSAPI_DESTROY failed");
731 PRINTF(("gssapi_destroy: deleting context\n"));
732 gssstat = gss_delete_sec_context(&minor_stat,
733 &AUTH_PRIVATE(auth)->context,
735 if (gssstat != GSS_S_COMPLETE)
736 AUTH_GSSAPI_DISPLAY_STATUS(("deleting context", gssstat,
738 if (AUTH_PRIVATE(auth)->def_cred) {
739 cred = GSS_C_NO_CREDENTIAL;
740 gssstat = gss_release_cred(&minor_stat, &cred);
741 if (gssstat != GSS_S_COMPLETE)
742 AUTH_GSSAPI_DISPLAY_STATUS(("deleting default credential",
743 gssstat, minor_stat));
746 free(AUTH_PRIVATE(auth)->client_handle.value);
749 PRINTF(("gssapi_destroy: calling GSSAPI_EXIT\n"));
750 AUTH_PRIVATE(auth)->established = FALSE;
751 callstat = clnt_call(AUTH_PRIVATE(auth)->clnt, AUTH_GSSAPI_EXIT,
752 xdr_void, NULL, xdr_void, NULL, timeout);
755 free(auth->ah_private);
757 PRINTF(("gssapi_destroy: done\n"));
761 * Function: auth_gssapi_wrap
763 * Purpose: encrypt the serialized arguments from xdr_func applied to
764 * xdr_ptr and write the result to xdrs.
766 * Effects: See design doc, section XXX.
768 static bool_t auth_gssapi_wrap(
771 bool_t (*xdr_func)(),
774 OM_uint32 gssstat, minor_stat;
776 if (! AUTH_PRIVATE(auth)->established) {
777 PRINTF(("gssapi_wrap: context not established, noop\n"));
778 return (*xdr_func)(out_xdrs, xdr_ptr);
779 } else if (! auth_gssapi_wrap_data(&gssstat, &minor_stat,
780 AUTH_PRIVATE(auth)->context,
781 AUTH_PRIVATE(auth)->seq_num+1,
782 out_xdrs, xdr_func, xdr_ptr)) {
783 if (gssstat != GSS_S_COMPLETE)
784 AUTH_GSSAPI_DISPLAY_STATUS(("encrypting function arguments",
785 gssstat, minor_stat));
792 * Function: auth_gssapi_unwrap
794 * Purpose: read encrypted arguments from xdrs, decrypt, and
795 * deserialize with xdr_func into xdr_ptr.
797 * Effects: See design doc, section XXX.
799 static bool_t auth_gssapi_unwrap(
802 bool_t (*xdr_func)(),
805 OM_uint32 gssstat, minor_stat;
807 if (! AUTH_PRIVATE(auth)->established) {
808 PRINTF(("gssapi_unwrap: context not established, noop\n"));
809 return (*xdr_func)(in_xdrs, xdr_ptr);
810 } else if (! auth_gssapi_unwrap_data(&gssstat, &minor_stat,
811 AUTH_PRIVATE(auth)->context,
812 AUTH_PRIVATE(auth)->seq_num,
813 in_xdrs, xdr_func, xdr_ptr)) {
814 if (gssstat != GSS_S_COMPLETE)
815 AUTH_GSSAPI_DISPLAY_STATUS(("decrypting function arguments",
816 gssstat, minor_stat));