Lines Matching refs:k5
593 k5_begin(opts, k5, k4) in k5_begin() argument
595 struct k5_data* k5;
604 code = krb5_init_context(&k5->ctx);
609 errctx = k5->ctx;
612 code = krb5_cc_resolve(k5->ctx, opts->k5_cache_name, &k5->cc);
621 if ((code = krb5_cc_default(k5->ctx, &k5->cc))) {
630 if ((code = krb5_parse_name(k5->ctx, opts->principal_name,
631 &k5->me))) {
642 code = krb5_sname_to_principal(k5->ctx, NULL, NULL,
643 KRB5_NT_SRV_HST, &k5->me);
651 code = krb5_cc_get_principal(k5->ctx, k5->cc,
652 &k5->me);
664 if (code = krb5_sname_to_principal(k5->ctx, NULL, ROOT_UNAME,
665 KRB5_NT_SRV_HST, &k5->me)) {
671 if ((code = krb5_parse_name(k5->ctx, name,
672 &k5->me)))
682 code = krb5_unparse_name(k5->ctx, k5->me, &k5->name);
687 opts->principal_name = k5->name;
693 code = krb5_524_conv_principal(k5->ctx, k5->me,
706 k5_end(k5) in k5_end() argument
707 struct k5_data* k5; in k5_end()
709 if (k5->name)
710 krb5_free_unparsed_name(k5->ctx, k5->name);
711 if (k5->me)
712 krb5_free_principal(k5->ctx, k5->me);
713 if (k5->cc)
714 krb5_cc_close(k5->ctx, k5->cc);
715 if (k5->ctx)
716 krb5_free_context(k5->ctx);
718 memset(k5, 0, sizeof(*k5));
854 k5_kinit(opts, k5) in k5_kinit() argument
856 struct k5_data* k5;
871 code = krb5_get_init_creds_opt_alloc(k5->ctx, &options);
888 if ((code = krb5_timeofday(k5->ctx, &now))) {
896 krb_realm = krb5_princ_realm(k5->ctx, k5->me)->data;
898 profile_get_options_string(k5->ctx->profile, realmdef, config_times);
899 profile_get_options_string(k5->ctx->profile, appdef, config_times);
934 profile_get_options_boolean(k5->ctx->profile,
936 profile_get_options_boolean(k5->ctx->profile,
980 code = krb5_os_localaddr(k5->ctx, &addresses);
992 code = krb5_kt_resolve(k5->ctx, opts->keytab_name, &keytab);
1001 code = krb5_get_init_creds_opt_set_pa(k5->ctx, options,
1013 code = krb5_get_init_creds_password(k5->ctx, &my_creds, k5->me,
1020 code = krb5_get_init_creds_keytab(k5->ctx, &my_creds, k5->me,
1027 code = krb5_get_validated_creds(k5->ctx, &my_creds, k5->me, k5->cc,
1031 code = krb5_get_renewed_creds(k5->ctx, &my_creds, k5->me, k5->cc,
1071 code = krb5_cc_initialize(k5->ctx, k5->cc, k5->me);
1078 code = krb5_cc_store_cred(k5->ctx, k5->cc, &my_creds);
1095 krb5_get_init_creds_opt_free(k5->ctx, options);
1096 if (my_creds.client == k5->me) {
1104 krb5_free_cred_contents(k5->ctx, &my_creds);
1106 krb5_kt_close(k5->ctx, keytab);
1210 static int try_convert524(k5) in try_convert524() argument
1211 struct k5_data* k5; in try_convert524()
1230 if ((code = krb5_build_principal(k5->ctx,
1232 krb5_princ_realm(k5->ctx, k5->me)->length,
1233 krb5_princ_realm(k5->ctx, k5->me)->data,
1235 krb5_princ_realm(k5->ctx, k5->me)->data,
1242 increds.client = k5->me;
1249 if ((code = krb5_get_credentials(k5->ctx, 0,
1250 k5->cc,
1257 if ((icode = krb524_convert_creds_kdc(k5->ctx,
1289 krb5_free_creds(k5->ctx, v5creds);
1291 krb5_free_cred_contents(k5->ctx, &increds);
1293 krb5_free_principal(k5->ctx, kpcserver);
1304 struct k5_data k5; local
1343 memset(&k5, 0, sizeof(k5));
1350 got_k5 = k5_begin(&opts, &k5, &k4);
1353 authed_k5 = k5_kinit(&opts, &k5);
1356 authed_k4 = try_convert524(&k5);
1359 authed_k4 = k4_kinit(&opts, &k4, k5.ctx);
1369 k5_end(&k5);