Lines Matching refs:gps
189 struct gssapi_ph1_state *gps; in gssapi_init() local
195 gps = racoon_calloc(1, sizeof (struct gssapi_ph1_state)); in gssapi_init()
196 if (gps == NULL) { in gssapi_init()
200 gps->gss_context = GSS_C_NO_CONTEXT; in gssapi_init()
201 gps->gss_cred = GSS_C_NO_CREDENTIAL; in gssapi_init()
203 gssapi_set_state(iph1, gps); in gssapi_init()
257 GSS_C_NO_OID_SET, GSS_C_BOTH, &gps->gss_cred, NULL, NULL); in gssapi_init()
277 struct gssapi_ph1_state *gps; in gssapi_get_itoken() local
286 gps = gssapi_get_state(iph1); in gssapi_get_itoken()
309 rtoken = gps->gsscnt_p == 0 ? dummy : &gps->gss_p[gps->gsscnt_p - 1]; in gssapi_get_itoken()
310 itoken = &gps->gss[gps->gsscnt]; in gssapi_get_itoken()
312 gps->gss_status = gss_init_sec_context(&min_stat, gps->gss_cred, in gssapi_get_itoken()
313 &gps->gss_context, partner, GSS_C_NO_OID, in gssapi_get_itoken()
319 if (GSS_ERROR(gps->gss_status)) { in gssapi_get_itoken()
331 gps->gss_status); in gssapi_get_itoken()
337 gps->gsscnt++; in gssapi_get_itoken()
348 struct gssapi_ph1_state *gps; in gssapi_get_rtoken() local
357 gps = gssapi_get_state(iph1); in gssapi_get_rtoken()
359 rtoken = &gps->gss_p[gps->gsscnt_p - 1]; in gssapi_get_rtoken()
360 itoken = &gps->gss[gps->gsscnt]; in gssapi_get_rtoken()
362 gps->gss_status = gss_accept_sec_context(&min_stat, &gps->gss_context, in gssapi_get_rtoken()
363 gps->gss_cred, rtoken, GSS_C_NO_CHANNEL_BINDINGS, &client_name, in gssapi_get_rtoken()
366 if (GSS_ERROR(gps->gss_status)) { in gssapi_get_rtoken()
392 gps->gsscnt++; in gssapi_get_rtoken()
403 struct gssapi_ph1_state *gps; in gssapi_save_received_token() local
410 gps = gssapi_get_state(iph1); in gssapi_save_received_token()
412 gsstoken = &gps->gss_p[gps->gsscnt_p]; in gssapi_save_received_token()
417 gps->gsscnt_p++; in gssapi_save_received_token()
425 struct gssapi_ph1_state *gps; in gssapi_get_token_to_send() local
429 gps = gssapi_get_state(iph1); in gssapi_get_token_to_send()
430 if (gps == NULL) { in gssapi_get_token_to_send()
435 gsstoken = &gps->gss[gps->gsscnt - 1]; in gssapi_get_token_to_send()
446 struct gssapi_ph1_state *gps; in gssapi_get_itokens() local
451 gps = gssapi_get_state(iph1); in gssapi_get_itokens()
452 if (gps == NULL) { in gssapi_get_itokens()
458 for (i = len = 0; i < gps->gsscnt; i++) in gssapi_get_itokens()
459 len += gps->gss[i].length; in gssapi_get_itokens()
465 for (i = 0; i < gps->gsscnt; i++) { in gssapi_get_itokens()
466 memcpy(p, gps->gss[i].value, gps->gss[i].length); in gssapi_get_itokens()
467 p += gps->gss[i].length; in gssapi_get_itokens()
473 "%d itokens of length %zu\n", gps->gsscnt, (*tokens)->l); in gssapi_get_itokens()
481 struct gssapi_ph1_state *gps; in gssapi_get_rtokens() local
486 gps = gssapi_get_state(iph1); in gssapi_get_rtokens()
487 if (gps == NULL) { in gssapi_get_rtokens()
499 for (i = len = 0; i < gps->gsscnt_p; i++) in gssapi_get_rtokens()
500 len += gps->gss_p[i].length; in gssapi_get_rtokens()
506 for (i = 0; i < gps->gsscnt_p; i++) { in gssapi_get_rtokens()
507 memcpy(p, gps->gss_p[i].value, gps->gss_p[i].length); in gssapi_get_rtokens()
508 p += gps->gss_p[i].length; in gssapi_get_rtokens()
519 struct gssapi_ph1_state *gps; in gssapi_wraphash() local
525 gps = gssapi_get_state(iph1); in gssapi_wraphash()
526 if (gps == NULL) { in gssapi_wraphash()
543 maj_stat = gss_wrap(&min_stat, gps->gss_context, 1, GSS_C_QOP_DEFAULT, in gssapi_wraphash()
579 struct gssapi_ph1_state *gps; in gssapi_unwraphash() local
585 gps = gssapi_get_state(iph1); in gssapi_unwraphash()
586 if (gps == NULL) { in gssapi_unwraphash()
599 maj_stat = gss_unwrap(&min_stat, gps->gss_context, hash_in, hash_out, in gssapi_unwraphash()
624 struct gssapi_ph1_state *gps; in gssapi_set_id_sent() local
626 gps = gssapi_get_state(iph1); in gssapi_set_id_sent()
628 gps->gss_flags |= GSSFLAG_ID_SENT; in gssapi_set_id_sent()
634 struct gssapi_ph1_state *gps; in gssapi_id_sent() local
636 gps = gssapi_get_state(iph1); in gssapi_id_sent()
638 return (gps->gss_flags & GSSFLAG_ID_SENT) != 0; in gssapi_id_sent()
644 struct gssapi_ph1_state *gps; in gssapi_set_id_rcvd() local
646 gps = gssapi_get_state(iph1); in gssapi_set_id_rcvd()
648 gps->gss_flags |= GSSFLAG_ID_RCVD; in gssapi_set_id_rcvd()
654 struct gssapi_ph1_state *gps; in gssapi_id_rcvd() local
656 gps = gssapi_get_state(iph1); in gssapi_id_rcvd()
658 return (gps->gss_flags & GSSFLAG_ID_RCVD) != 0; in gssapi_id_rcvd()
664 struct gssapi_ph1_state *gps; in gssapi_free_state() local
667 gps = gssapi_get_state(iph1); in gssapi_free_state()
669 if (gps == NULL) in gssapi_free_state()
674 if (gps->gss_cred != GSS_C_NO_CREDENTIAL) { in gssapi_free_state()
675 maj_stat = gss_release_cred(&min_stat, &gps->gss_cred); in gssapi_free_state()
680 racoon_free(gps); in gssapi_free_state()