Lines Matching refs:ap

119 	rpc_gss_data		*ap = NULL;  local
152 ap = (rpc_gss_data *) malloc(sizeof (*ap));
153 if (auth == NULL || ap == NULL) {
162 memset((char *)ap, 0, sizeof (*ap));
163 ap->clnt = clnt;
164 ap->version = RPCSEC_GSS_VERSION;
166 ap->my_cred = options_req->my_cred;
167 ap->req_flags = options_req->req_flags;
168 ap->time_req = options_req->time_req;
169 ap->icb = options_req->input_channel_bindings;
171 ap->my_cred = GSS_C_NO_CREDENTIAL;
172 ap->req_flags = GSS_C_MUTUAL_FLAG;
173 ap->time_req = 0;
174 ap->icb = NULL;
176 if ((ap->service = service) == rpc_gss_svc_default)
177 ap->service = rpc_gss_svc_integrity;
178 ap->qop = qop_num;
179 ap->target_name = target_name;
180 ap->mech_type = mech_type;
186 if (!rpc_gss_seccreate_pvt(&gssstat, &minor_stat, auth, ap,
188 if (ap->target_name)
189 (void) gss_release_name(&minor_stat, &ap->target_name);
190 free((char *)ap);
199 if ((ap->service == rpc_gss_svc_privacy &&
216 options_ret->rpcsec_version = ap->version;
219 options_ret->gss_context = ap->context;
233 rpc_gss_seccreate_pvt(gssstat, minor_stat, auth, ap, actual_mech_type, in rpc_gss_seccreate_pvt() argument
238 rpc_gss_data *ap;
243 CLIENT *clnt = ap->clnt;
261 auth->ah_private = (caddr_t)ap;
264 ap->established = FALSE;
265 ap->ctx_handle.length = 0;
266 ap->ctx_handle.value = NULL;
267 ap->context = GSS_C_NO_CONTEXT;
268 ap->seq_num = 0;
269 ap->gss_proc = RPCSEC_GSS_INIT;
285 ap->my_cred,
286 &ap->context,
287 ap->target_name,
288 ap->mech_type,
289 ap->req_flags,
290 ap->time_req,
335 ap->gss_proc = RPCSEC_GSS_CONTINUE_INIT;
340 if (ap->ctx_handle.length == 0) {
343 GSS_DUP_BUFFER(ap->ctx_handle,
345 } else if (!GSS_BUFFERS_EQUAL(ap->ctx_handle,
362 ap->seq_window = call_res.seq_window;
376 if (!validate_seqwin(ap)) {
384 ap->established = TRUE;
385 ap->seq_num = 1;
386 ap->gss_proc = RPCSEC_GSS_DATA;
387 ap->invalid = FALSE;
393 if (ap->context != GSS_C_NO_CONTEXT)
421 rpc_gss_data *ap = AUTH_PRIVATE(auth); local
437 if ((mech = __rpc_gss_oid_to_mech(ap->mech_type)) == NULL)
443 ap->qop = qop_num;
444 ap->service = service;
452 marshall_creds(ap, xdrs) in marshall_creds() argument
453 rpc_gss_data *ap; in marshall_creds()
461 ag_creds.version = ap->version;
462 ag_creds.gss_proc = ap->gss_proc;
463 ag_creds.seq_num = ap->seq_num;
464 ag_creds.service = ap->service;
469 if (ap->ctx_handle.length > 0)
470 ag_creds.ctx_handle = ap->ctx_handle;
501 marshall_verf(ap, xdrs, buf) in marshall_verf() argument
502 rpc_gss_data *ap; in marshall_verf()
514 if (!ap->established) {
524 if ((major = gss_sign(&minor, ap->context, ap->qop, &in_buf,
527 ap->invalid = TRUE;
567 validate_seqwin(rpc_gss_data *ap) in validate_seqwin() argument
574 seq_win_net = (uint_t)htonl(ap->seq_window); in validate_seqwin()
577 tok_buf.length = ap->verifier->oa_length; in validate_seqwin()
578 tok_buf.value = ap->verifier->oa_base; in validate_seqwin()
579 major = gss_verify(&minor, ap->context, &msg_buf, &tok_buf, &qop_state); in validate_seqwin()
595 rpc_gss_data *ap = AUTH_PRIVATE(auth); local
606 if (!ap->established) {
607 if (ap->verifier == NULL) {
608 ap->verifier = malloc(sizeof (struct opaque_auth));
609 memset(ap->verifier, 0, sizeof (struct opaque_auth));
611 ap->verifier->oa_base = malloc(verf->oa_length);
613 if (ap->verifier->oa_length > 0)
614 free(ap->verifier->oa_base);
616 ap->verifier->oa_base = malloc(verf->oa_length);
618 ap->verifier->oa_length = verf->oa_length;
619 bcopy(verf->oa_base, ap->verifier->oa_base, verf->oa_length);
623 seq_num_net = (uint_t)htonl(ap->seq_num);
628 major = gss_verify(&minor, ap->context, &msg_buf, &tok_buf, &qop_state);
645 rpc_gss_data *ap = AUTH_PRIVATE(auth); local
659 !ap->established) {
665 if (ap->context != GSS_C_NO_CONTEXT) {
666 (void) gss_delete_sec_context(&minor_stat, &ap->context,
668 ap->context = GSS_C_NO_CONTEXT;
670 if (ap->ctx_handle.length != 0) {
672 &ap->ctx_handle);
673 ap->ctx_handle.length = 0;
674 ap->ctx_handle.value = NULL;
681 if (!ap->established) {
682 ap->invalid = TRUE;
689 if (rpc_gss_seccreate_pvt(&gssstat, &minor_stat, auth, ap,
693 ap->invalid = TRUE;
708 rpc_gss_data *ap = AUTH_PRIVATE(auth); local
711 free((char *)ap);
727 rpc_gss_data *ap = AUTH_PRIVATE(auth); local
733 if (ap->ctx_handle.length != 0) {
734 ap->gss_proc = RPCSEC_GSS_DESTROY;
737 (void) clnt_call(ap->clnt, NULLPROC, xdr_void, NULL,
740 (void) gss_release_buffer(&minor_stat, &ap->ctx_handle);
741 ap->ctx_handle.length = 0;
742 ap->ctx_handle.value = NULL;
748 if (ap->context != GSS_C_NO_CONTEXT) {
749 (void) gss_delete_sec_context(&minor_stat, &ap->context, NULL);
750 ap->context = GSS_C_NO_CONTEXT;
757 if (ap->my_cred == GSS_C_NO_CREDENTIAL)
758 (void) gss_release_cred(&minor_stat, &ap->my_cred);
763 if (ap->target_name != NULL) {
764 (void) gss_release_name(&minor_stat, &ap->target_name);
765 ap->target_name = NULL;
771 if (ap->verifier != NULL) {
772 if (ap->verifier->oa_length > 0)
773 free(ap->verifier->oa_base);
774 free(ap->verifier);
775 ap->verifier = NULL;
794 rpc_gss_data *ap = AUTH_PRIVATE(auth); local
802 if (ap->invalid)
808 if (ap->established)
809 ap->seq_num++;
822 if (!marshall_creds(ap, &xdrs))
828 if (!marshall_verf(ap, &xdrs, tmp_buf))
842 if (!ap->established || ap->service == rpc_gss_svc_none)
845 return (__rpc_gss_wrap_data(ap->service, ap->qop, ap->context,
846 ap->seq_num, out_xdrs, xdr_func, xdr_ptr));
860 rpc_gss_data *ap = AUTH_PRIVATE(auth); local
866 if (!ap->established || ap->service == rpc_gss_svc_none)
869 return (__rpc_gss_unwrap_data(ap->service,
870 ap->context,
871 ap->seq_num,
872 ap->qop,
882 rpc_gss_data *ap = AUTH_PRIVATE(auth); local
884 if (!ap->established || max_tp_unit_len <= 0)
887 return (__find_max_data_length(ap->service,
888 ap->context,
889 ap->qop,