Lines Matching full:context

38 decrypt_tkt_enc_part (krb5_context context,  in decrypt_tkt_enc_part()  argument
48 ret = krb5_crypto_init(context, key, 0, &crypto); in decrypt_tkt_enc_part()
51 ret = krb5_decrypt_EncryptedData (context, in decrypt_tkt_enc_part()
56 krb5_crypto_destroy(context, crypto); in decrypt_tkt_enc_part()
62 krb5_set_error_message(context, ret, in decrypt_tkt_enc_part()
70 decrypt_authenticator (krb5_context context, in decrypt_authenticator() argument
81 ret = krb5_crypto_init(context, key, 0, &crypto); in decrypt_authenticator()
84 ret = krb5_decrypt_EncryptedData (context, in decrypt_authenticator()
91 ret = krb5_decrypt_EncryptedData (context, in decrypt_authenticator()
96 krb5_crypto_destroy(context, crypto); in decrypt_authenticator()
107 krb5_decode_ap_req(krb5_context context, in krb5_decode_ap_req() argument
118 krb5_clear_error_message (context); in krb5_decode_ap_req()
123 krb5_clear_error_message (context); in krb5_decode_ap_req()
128 krb5_clear_error_message (context); in krb5_decode_ap_req()
135 check_transited(krb5_context context, Ticket *ticket, EncTicketPart *enc) in check_transited() argument
155 ret = krb5_domain_x500_decode(context, enc->transited.contents, in check_transited()
161 ret = krb5_check_transited(context, enc->crealm, in check_transited()
171 find_etypelist(krb5_context context, in find_etypelist() argument
216 krb5_clear_error_message(context); in find_etypelist()
224 krb5_decrypt_ticket(krb5_context context, in krb5_decrypt_ticket() argument
232 ret = decrypt_tkt_enc_part (context, key, &ticket->enc_part, &t); in krb5_decrypt_ticket()
240 krb5_timeofday (context, &now); in krb5_decrypt_ticket()
243 if(start - now > context->max_skew in krb5_decrypt_ticket()
247 krb5_clear_error_message (context); in krb5_decrypt_ticket()
250 if(now - t.endtime > context->max_skew) { in krb5_decrypt_ticket()
252 krb5_clear_error_message (context); in krb5_decrypt_ticket()
257 ret = check_transited(context, ticket, &t); in krb5_decrypt_ticket()
273 krb5_verify_authenticator_checksum(krb5_context context, in krb5_verify_authenticator_checksum() argument
283 ret = krb5_auth_con_getauthenticator (context, in krb5_verify_authenticator_checksum()
289 krb5_free_authenticator(context, &authenticator); in krb5_verify_authenticator_checksum()
292 ret = krb5_auth_con_getkey(context, ac, &key); in krb5_verify_authenticator_checksum()
294 krb5_free_authenticator(context, &authenticator); in krb5_verify_authenticator_checksum()
297 ret = krb5_crypto_init(context, key, 0, &crypto); in krb5_verify_authenticator_checksum()
300 ret = krb5_verify_checksum (context, in krb5_verify_authenticator_checksum()
306 krb5_crypto_destroy(context, crypto); in krb5_verify_authenticator_checksum()
308 krb5_free_authenticator(context, &authenticator); in krb5_verify_authenticator_checksum()
309 krb5_free_keyblock(context, key); in krb5_verify_authenticator_checksum()
315 krb5_verify_ap_req(krb5_context context, in krb5_verify_ap_req() argument
324 return krb5_verify_ap_req2 (context, in krb5_verify_ap_req()
336 krb5_verify_ap_req2(krb5_context context, in krb5_verify_ap_req2() argument
357 ret = krb5_auth_con_init (context, &ac); in krb5_verify_ap_req2()
365 krb5_clear_error_message (context); in krb5_verify_ap_req2()
370 ret = krb5_decrypt_ticket(context, &ap_req->ticket, in krb5_verify_ap_req2()
374 krb5_free_keyblock(context, ac->keyblock); in krb5_verify_ap_req2()
377 ret = krb5_decrypt_ticket(context, &ap_req->ticket, in krb5_verify_ap_req2()
385 ret = _krb5_principalname2krb5_principal(context, in krb5_verify_ap_req2()
390 ret = _krb5_principalname2krb5_principal(context, in krb5_verify_ap_req2()
396 ret = decrypt_authenticator (context, in krb5_verify_ap_req2()
408 _krb5_principalname2krb5_principal(context, in krb5_verify_ap_req2()
412 _krb5_principalname2krb5_principal(context, in krb5_verify_ap_req2()
416 res = krb5_principal_compare (context, p1, p2); in krb5_verify_ap_req2()
417 krb5_free_principal (context, p1); in krb5_verify_ap_req2()
418 krb5_free_principal (context, p2); in krb5_verify_ap_req2()
421 krb5_clear_error_message (context); in krb5_verify_ap_req2()
430 && !krb5_address_search (context, in krb5_verify_ap_req2()
434 krb5_clear_error_message (context); in krb5_verify_ap_req2()
442 krb5_timeofday (context, &now); in krb5_verify_ap_req2()
444 if (abs(ac->authenticator->ctime - now) > context->max_skew) { in krb5_verify_ap_req2()
446 krb5_clear_error_message (context); in krb5_verify_ap_req2()
452 krb5_auth_con_setremoteseqnumber(context, ac, in krb5_verify_ap_req2()
458 ret = krb5_auth_con_setremotesubkey(context, ac, in krb5_verify_ap_req2()
464 ret = find_etypelist(context, ac, &etypes); in krb5_verify_ap_req2()
474 if (krb5_enctype_valid(context, etypes.val[i]) == 0) { in krb5_verify_ap_req2()
482 ret = krb5_copy_keyblock(context, &t->ticket.key, &ac->keyblock); in krb5_verify_ap_req2()
498 krb5_free_ticket (context, t); in krb5_verify_ap_req2()
503 krb5_auth_con_free (context, ac); in krb5_verify_ap_req2()
508 krb5_free_ticket (context, t); in krb5_verify_ap_req2()
510 krb5_auth_con_free (context, ac); in krb5_verify_ap_req2()
533 * krb5_rd_req_ctx(). The caller should free the context with
534 * krb5_rd_req_in_ctx_free() when done with the context.
536 * @param context Keberos 5 context.
545 krb5_rd_req_in_ctx_alloc(krb5_context context, krb5_rd_req_in_ctx *ctx) in krb5_rd_req_in_ctx_alloc() argument
549 krb5_set_error_message(context, ENOMEM, in krb5_rd_req_in_ctx_alloc()
553 (*ctx)->check_pac = (context->flags & KRB5_CTX_F_CHECK_PAC) ? 1 : 0; in krb5_rd_req_in_ctx_alloc()
560 * @param context Keberos 5 context.
572 krb5_rd_req_in_set_keytab(krb5_context context, in krb5_rd_req_in_set_keytab() argument
583 * @param context Keberos 5 context.
593 krb5_rd_req_in_set_pac_check(krb5_context context, in krb5_rd_req_in_set_pac_check() argument
603 krb5_rd_req_in_set_keyblock(krb5_context context, in krb5_rd_req_in_set_keyblock() argument
612 krb5_rd_req_out_get_ap_req_options(krb5_context context, in krb5_rd_req_out_get_ap_req_options() argument
621 krb5_rd_req_out_get_ticket(krb5_context context, in krb5_rd_req_out_get_ticket() argument
625 return krb5_copy_ticket(context, out->ticket, ticket); in krb5_rd_req_out_get_ticket()
629 krb5_rd_req_out_get_keyblock(krb5_context context, in krb5_rd_req_out_get_keyblock() argument
633 return krb5_copy_keyblock(context, out->keyblock, keyblock); in krb5_rd_req_out_get_keyblock()
641 * @param context a Kerberos 5 context.
649 krb5_rd_req_out_get_server(krb5_context context, in krb5_rd_req_out_get_server() argument
653 return krb5_copy_principal(context, out->server, principal); in krb5_rd_req_out_get_server()
657 krb5_rd_req_in_ctx_free(krb5_context context, krb5_rd_req_in_ctx ctx) in krb5_rd_req_in_ctx_free() argument
665 * @param context Keberos 5 context.
666 * @param ctx krb5_rd_req_out_ctx context to free.
672 krb5_rd_req_out_ctx_free(krb5_context context, krb5_rd_req_out_ctx ctx) in krb5_rd_req_out_ctx_free() argument
675 krb5_free_ticket(context, ctx->ticket); in krb5_rd_req_out_ctx_free()
677 krb5_free_keyblock(context, ctx->keyblock); in krb5_rd_req_out_ctx_free()
679 krb5_free_principal(context, ctx->server); in krb5_rd_req_out_ctx_free()
688 krb5_rd_req(krb5_context context, in krb5_rd_req() argument
700 ret = krb5_rd_req_in_ctx_alloc(context, &in); in krb5_rd_req()
704 ret = krb5_rd_req_in_set_keytab(context, in, keytab); in krb5_rd_req()
706 krb5_rd_req_in_ctx_free(context, in); in krb5_rd_req()
710 ret = krb5_rd_req_ctx(context, auth_context, inbuf, server, in, &out); in krb5_rd_req()
711 krb5_rd_req_in_ctx_free(context, in); in krb5_rd_req()
718 ret = krb5_copy_ticket(context, out->ticket, ticket); in krb5_rd_req()
724 krb5_rd_req_out_ctx_free(context, out); in krb5_rd_req()
733 krb5_rd_req_with_keyblock(krb5_context context, in krb5_rd_req_with_keyblock() argument
745 ret = krb5_rd_req_in_ctx_alloc(context, &in); in krb5_rd_req_with_keyblock()
749 ret = krb5_rd_req_in_set_keyblock(context, in, keyblock); in krb5_rd_req_with_keyblock()
751 krb5_rd_req_in_ctx_free(context, in); in krb5_rd_req_with_keyblock()
755 ret = krb5_rd_req_ctx(context, auth_context, inbuf, server, in, &out); in krb5_rd_req_with_keyblock()
756 krb5_rd_req_in_ctx_free(context, in); in krb5_rd_req_with_keyblock()
763 ret = krb5_copy_ticket(context, out->ticket, ticket); in krb5_rd_req_with_keyblock()
769 krb5_rd_req_out_ctx_free(context, out); in krb5_rd_req_with_keyblock()
778 get_key_from_keytab(krb5_context context, in get_key_from_keytab() argument
790 krb5_kt_default(context, &real_keytab); in get_key_from_keytab()
799 ret = krb5_kt_get_entry (context, in get_key_from_keytab()
806 ret = krb5_copy_keyblock(context, &entry.keyblock, out_key); in get_key_from_keytab()
807 krb5_kt_free_entry(context, &entry); in get_key_from_keytab()
810 krb5_kt_close(context, real_keytab); in get_key_from_keytab()
819 * @param context Keberos 5 context.
820 * @param auth_context the authentication context, can be NULL, then
821 * default values for the authentication context will used.
840 krb5_rd_req_ctx(krb5_context context, in krb5_rd_req_ctx() argument
857 krb5_set_error_message(context, ENOMEM, in krb5_rd_req_ctx()
863 ret = krb5_auth_con_init(context, auth_context); in krb5_rd_req_ctx()
868 ret = krb5_decode_ap_req(context, inbuf, &ap_req); in krb5_rd_req_ctx()
873 ret = _krb5_principalname2krb5_principal(context, in krb5_rd_req_ctx()
883 krb5_set_error_message(context, ret, in krb5_rd_req_ctx()
893 ret = krb5_copy_keyblock(context, in krb5_rd_req_ctx()
899 ret = krb5_copy_keyblock(context, in krb5_rd_req_ctx()
907 krb5_kt_default(context, &keytab); in krb5_rd_req_ctx()
914 ret = _krb5_principalname2krb5_principal(context, in krb5_rd_req_ctx()
923 ret = get_key_from_keytab(context, in krb5_rd_req_ctx()
930 if (service == NULL && (context->flags & KRB5_CTX_F_RD_REQ_IGNORE) == 0) in krb5_rd_req_ctx()
944 ret = krb5_verify_ap_req2(context, in krb5_rd_req_ctx()
971 ret = krb5_kt_start_seq_get(context, id, &cursor); in krb5_rd_req_ctx()
979 ret = krb5_kt_next_entry(context, id, &entry, &cursor); in krb5_rd_req_ctx()
981 _krb5_kt_principal_not_found(context, ret, id, o->server, in krb5_rd_req_ctx()
988 krb5_kt_free_entry (context, &entry); in krb5_rd_req_ctx()
992 ret = krb5_verify_ap_req2(context, in krb5_rd_req_ctx()
1002 krb5_kt_free_entry (context, &entry); in krb5_rd_req_ctx()
1012 ret = krb5_copy_keyblock(context, in krb5_rd_req_ctx()
1016 krb5_kt_free_entry (context, &entry); in krb5_rd_req_ctx()
1020 ret = krb5_copy_principal(context, entry.principal, &p); in krb5_rd_req_ctx()
1022 krb5_kt_free_entry (context, &entry); in krb5_rd_req_ctx()
1025 krb5_free_principal(context, o->ticket->server); in krb5_rd_req_ctx()
1028 krb5_kt_free_entry (context, &entry); in krb5_rd_req_ctx()
1032 krb5_kt_end_seq_get (context, id, &cursor); in krb5_rd_req_ctx()
1040 ret = krb5_ticket_get_authorization_data_type(context, in krb5_rd_req_ctx()
1045 ret = krb5_pac_parse(context, data.data, data.length, &pac); in krb5_rd_req_ctx()
1050 ret = krb5_pac_verify(context, in krb5_rd_req_ctx()
1056 krb5_pac_free(context, pac); in krb5_rd_req_ctx()
1065 krb5_rd_req_out_ctx_free(context, o); in krb5_rd_req_ctx()
1072 krb5_free_principal(context, service); in krb5_rd_req_ctx()
1075 krb5_kt_close(context, keytab); in krb5_rd_req_ctx()