2 Unix SMB/CIFS implementation.
3 kerberos utility library
4 Copyright (C) Andrew Tridgell 2001
5 Copyright (C) Remus Koos 2001
6 Copyright (C) Nalin Dahyabhai <nalin@redhat.com> 2004.
7 Copyright (C) Jeremy Allison 2004.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #define LIBADS_CCACHE_NAME "MEMORY:libads"
31 we use a prompter to avoid a crash bug in the kerberos libs when
32 dealing with empty passwords
33 this prompter is just a string copy ...
35 static krb5_error_code
36 kerb_prompter(krb5_context ctx
, void *data
,
40 krb5_prompt prompts
[])
42 if (num_prompts
== 0) return 0;
44 memset(prompts
[0].reply
->data
, '\0', prompts
[0].reply
->length
);
45 if (prompts
[0].reply
->length
> 0) {
47 strncpy(prompts
[0].reply
->data
, data
, prompts
[0].reply
->length
-1);
48 prompts
[0].reply
->length
= strlen(prompts
[0].reply
->data
);
50 prompts
[0].reply
->length
= 0;
57 simulate a kinit, putting the tgt in the given cache location. If cache_name == NULL
58 place in default cache location.
61 int kerberos_kinit_password_ext(const char *principal
,
65 time_t *renew_till_time
,
66 const char *cache_name
,
68 time_t renewable_time
)
70 krb5_context ctx
= NULL
;
71 krb5_error_code code
= 0;
72 krb5_ccache cc
= NULL
;
76 krb5_get_init_creds_opt opt
;
79 initialize_krb5_error_table();
80 if ((code
= krb5_init_context(&ctx
)))
83 if (time_offset
!= 0) {
84 krb5_set_real_time(ctx
, time(NULL
) + time_offset
, 0);
87 DEBUG(10,("kerberos_kinit_password: using %s as ccache\n",
88 cache_name
? cache_name
: krb5_cc_default_name(ctx
)));
90 if ((code
= krb5_cc_resolve(ctx
, cache_name
? cache_name
: krb5_cc_default_name(ctx
), &cc
))) {
91 krb5_free_context(ctx
);
95 if ((code
= krb5_parse_name(ctx
, principal
, &me
))) {
96 krb5_free_context(ctx
);
100 #if 0 /* This code causes problems with MIT krb5 1.3 when asking for a
101 TGT for the machine account */
102 krb5_get_init_creds_opt_init(&opt
);
103 krb5_get_init_creds_opt_set_renew_life(&opt
, renewable_time
);
104 krb5_get_init_creds_opt_set_forwardable(&opt
, 1);
108 #ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PAC_REQUEST
109 krb5_get_init_creds_opt_set_pac_request(ctx
, &opt
, True
);
114 if ((code
= krb5_get_init_creds_password(ctx
, &my_creds
, me
, CONST_DISCARD(char *,password
),
115 kerb_prompter
, NULL
, 0, NULL
, &opt
)))
117 if ((code
= krb5_get_init_creds_password(ctx
, &my_creds
, me
, CONST_DISCARD(char *,password
),
118 kerb_prompter
, NULL
, 0, NULL
, NULL
)))
121 krb5_free_principal(ctx
, me
);
122 krb5_free_context(ctx
);
126 if ((code
= krb5_cc_initialize(ctx
, cc
, me
))) {
127 krb5_free_cred_contents(ctx
, &my_creds
);
128 krb5_free_principal(ctx
, me
);
129 krb5_free_context(ctx
);
133 if ((code
= krb5_cc_store_cred(ctx
, cc
, &my_creds
))) {
134 krb5_cc_close(ctx
, cc
);
135 krb5_free_cred_contents(ctx
, &my_creds
);
136 krb5_free_principal(ctx
, me
);
137 krb5_free_context(ctx
);
142 *expire_time
= (time_t) my_creds
.times
.endtime
;
145 if (renew_till_time
) {
146 *renew_till_time
= (time_t) my_creds
.times
.renew_till
;
149 krb5_cc_close(ctx
, cc
);
150 krb5_free_cred_contents(ctx
, &my_creds
);
151 krb5_free_principal(ctx
, me
);
152 krb5_free_context(ctx
);
159 /* run kinit to setup our ccache */
160 int ads_kinit_password(ADS_STRUCT
*ads
)
164 const char *account_name
;
168 /* this will end up getting a ticket for DOMAIN@RUSTED.REA.LM */
169 account_name
= lp_workgroup();
171 /* always use the sAMAccountName for security = domain */
172 /* global_myname()$@REA.LM */
173 if ( lp_security() == SEC_DOMAIN
) {
174 fstr_sprintf( acct_name
, "%s$", global_myname() );
175 account_name
= acct_name
;
178 /* This looks like host/global_myname()@REA.LM */
179 account_name
= ads
->auth
.user_name
;
182 if (asprintf(&s
, "%s@%s", account_name
, ads
->auth
.realm
) == -1) {
183 return KRB5_CC_NOMEM
;
186 if (!ads
->auth
.password
) {
187 return KRB5_LIBOS_CANTREADPWD
;
190 ret
= kerberos_kinit_password_ext(s
, ads
->auth
.password
, ads
->auth
.time_offset
,
191 &ads
->auth
.expire
, NULL
, NULL
, False
, ads
->auth
.renewable
);
194 DEBUG(0,("kerberos_kinit_password %s failed: %s\n",
195 s
, error_message(ret
)));
201 int ads_kdestroy(const char *cc_name
)
203 krb5_error_code code
;
204 krb5_context ctx
= NULL
;
205 krb5_ccache cc
= NULL
;
207 initialize_krb5_error_table();
208 if ((code
= krb5_init_context (&ctx
))) {
209 DEBUG(3, ("ads_kdestroy: kdb5_init_context failed: %s\n",
210 error_message(code
)));
215 if ((code
= krb5_cc_default(ctx
, &cc
))) {
216 krb5_free_context(ctx
);
220 if ((code
= krb5_cc_resolve(ctx
, cc_name
, &cc
))) {
221 DEBUG(3, ("ads_kdestroy: krb5_cc_resolve failed: %s\n",
222 error_message(code
)));
223 krb5_free_context(ctx
);
228 if ((code
= krb5_cc_destroy (ctx
, cc
))) {
229 DEBUG(3, ("ads_kdestroy: krb5_cc_destroy failed: %s\n",
230 error_message(code
)));
233 krb5_free_context (ctx
);
237 /************************************************************************
238 Routine to fetch the salting principal for a service. Active
239 Directory may use a non-obvious principal name to generate the salt
240 when it determines the key to use for encrypting tickets for a service,
241 and hopefully we detected that when we joined the domain.
242 ************************************************************************/
244 static char *kerberos_secrets_fetch_salting_principal(const char *service
, int enctype
)
249 asprintf(&key
, "%s/%s/enctype=%d", SECRETS_SALTING_PRINCIPAL
, service
, enctype
);
253 ret
= (char *)secrets_fetch(key
, NULL
);
258 /************************************************************************
259 Routine to get the salting principal for this service. Active
260 Directory may use a non-obvious principal name to generate the salt
261 when it determines the key to use for encrypting tickets for a service,
262 and hopefully we detected that when we joined the domain.
263 Caller must free if return is not null.
264 ************************************************************************/
266 krb5_principal
kerberos_fetch_salt_princ_for_host_princ(krb5_context context
,
267 krb5_principal host_princ
,
270 char *unparsed_name
= NULL
, *salt_princ_s
= NULL
;
271 krb5_principal ret_princ
= NULL
;
273 if (krb5_unparse_name(context
, host_princ
, &unparsed_name
) != 0) {
274 return (krb5_principal
)NULL
;
277 if ((salt_princ_s
= kerberos_secrets_fetch_salting_principal(unparsed_name
, enctype
)) == NULL
) {
278 krb5_free_unparsed_name(context
, unparsed_name
);
279 return (krb5_principal
)NULL
;
282 if (krb5_parse_name(context
, salt_princ_s
, &ret_princ
) != 0) {
283 krb5_free_unparsed_name(context
, unparsed_name
);
284 SAFE_FREE(salt_princ_s
);
285 return (krb5_principal
)NULL
;
287 krb5_free_unparsed_name(context
, unparsed_name
);
288 SAFE_FREE(salt_princ_s
);
292 /************************************************************************
293 Routine to set the salting principal for this service. Active
294 Directory may use a non-obvious principal name to generate the salt
295 when it determines the key to use for encrypting tickets for a service,
296 and hopefully we detected that when we joined the domain.
297 Setting principal to NULL deletes this entry.
298 ************************************************************************/
300 BOOL
kerberos_secrets_store_salting_principal(const char *service
,
302 const char *principal
)
306 krb5_context context
= NULL
;
307 krb5_principal princ
= NULL
;
308 char *princ_s
= NULL
;
309 char *unparsed_name
= NULL
;
311 krb5_init_context(&context
);
315 if (strchr_m(service
, '@')) {
316 asprintf(&princ_s
, "%s", service
);
318 asprintf(&princ_s
, "%s@%s", service
, lp_realm());
321 if (krb5_parse_name(context
, princ_s
, &princ
) != 0) {
325 if (krb5_unparse_name(context
, princ
, &unparsed_name
) != 0) {
329 asprintf(&key
, "%s/%s/enctype=%d", SECRETS_SALTING_PRINCIPAL
, unparsed_name
, enctype
);
334 if ((principal
!= NULL
) && (strlen(principal
) > 0)) {
335 ret
= secrets_store(key
, principal
, strlen(principal
) + 1);
337 ret
= secrets_delete(key
);
346 krb5_free_unparsed_name(context
, unparsed_name
);
349 krb5_free_context(context
);
355 /************************************************************************
356 Routine to get initial credentials as a service ticket for the local machine.
357 Returns a buffer initialized with krb5_mk_req_extended.
358 ************************************************************************/
360 static krb5_error_code
get_service_ticket(krb5_context ctx
,
362 const char *service_principal
,
366 krb5_creds creds
, *new_creds
= NULL
;
367 char *service_s
= NULL
;
368 char *machine_account
= NULL
, *password
= NULL
;
370 krb5_auth_context auth_context
= NULL
;
371 krb5_error_code err
= 0;
375 asprintf(&machine_account
, "%s$@%s", global_myname(), lp_realm());
376 if (machine_account
== NULL
) {
379 password
= secrets_fetch_machine_password(lp_workgroup(), NULL
, NULL
);
380 if (password
== NULL
) {
383 if ((err
= kerberos_kinit_password(machine_account
, password
,
384 0, LIBADS_CCACHE_NAME
)) != 0) {
385 DEBUG(0,("get_service_ticket: kerberos_kinit_password %s failed: %s\n",
387 error_message(err
)));
391 /* Ok - the above call has gotten a TGT. Now we need to get a service
392 ticket to ourselves. */
394 /* Set up the enctype and client and server principal fields for krb5_get_credentials. */
395 kerberos_set_creds_enctype(&creds
, enctype
);
397 if ((err
= krb5_cc_get_principal(ctx
, ccache
, &creds
.client
))) {
398 DEBUG(3, ("get_service_ticket: krb5_cc_get_principal failed: %s\n",
399 error_message(err
)));
403 if (strchr_m(service_principal
, '@')) {
404 asprintf(&service_s
, "%s", service_principal
);
406 asprintf(&service_s
, "%s@%s", service_principal
, lp_realm());
409 if ((err
= krb5_parse_name(ctx
, service_s
, &creds
.server
))) {
410 DEBUG(0,("get_service_ticket: krb5_parse_name %s failed: %s\n",
411 service_s
, error_message(err
)));
415 if ((err
= krb5_get_credentials(ctx
, 0, ccache
, &creds
, &new_creds
))) {
416 DEBUG(5,("get_service_ticket: krb5_get_credentials for %s enctype %d failed: %s\n",
417 service_s
, enctype
, error_message(err
)));
421 memset(&in_data
, '\0', sizeof(in_data
));
422 if ((err
= krb5_mk_req_extended(ctx
, &auth_context
, 0, &in_data
,
423 new_creds
, p_outbuf
)) != 0) {
424 DEBUG(0,("get_service_ticket: krb5_mk_req_extended failed: %s\n",
425 error_message(err
)));
432 krb5_auth_con_free(ctx
, auth_context
);
435 krb5_free_creds(ctx
, new_creds
);
438 krb5_free_principal(ctx
, creds
.server
);
441 krb5_free_principal(ctx
, creds
.client
);
444 SAFE_FREE(service_s
);
446 SAFE_FREE(machine_account
);
450 /************************************************************************
451 Check if the machine password can be used in conjunction with the salting_principal
452 to generate a key which will successfully decrypt the AP_REQ already
453 gotten as a message to the local machine.
454 ************************************************************************/
456 static BOOL
verify_service_password(krb5_context ctx
,
458 const char *salting_principal
,
462 krb5_principal salting_kprinc
= NULL
;
463 krb5_ticket
*ticket
= NULL
;
466 char *salting_s
= NULL
;
467 char *machine_account
= NULL
, *password
= NULL
;
468 krb5_auth_context auth_context
= NULL
;
471 memset(&passdata
, '\0', sizeof(passdata
));
472 memset(&key
, '\0', sizeof(key
));
474 asprintf(&machine_account
, "%s$@%s", global_myname(), lp_realm());
475 if (machine_account
== NULL
) {
478 password
= secrets_fetch_machine_password(lp_workgroup(), NULL
, NULL
);
479 if (password
== NULL
) {
483 if (strchr_m(salting_principal
, '@')) {
484 asprintf(&salting_s
, "%s", salting_principal
);
486 asprintf(&salting_s
, "%s@%s", salting_principal
, lp_realm());
489 if ((err
= krb5_parse_name(ctx
, salting_s
, &salting_kprinc
))) {
490 DEBUG(0,("verify_service_password: krb5_parse_name %s failed: %s\n",
491 salting_s
, error_message(err
)));
495 passdata
.length
= strlen(password
);
496 passdata
.data
= (char*)password
;
497 if ((err
= create_kerberos_key_from_string_direct(ctx
, salting_kprinc
, &passdata
, &key
, enctype
))) {
498 DEBUG(0,("verify_service_password: create_kerberos_key_from_string %d failed: %s\n",
499 enctype
, error_message(err
)));
503 if ((err
= krb5_auth_con_init(ctx
, &auth_context
)) != 0) {
504 DEBUG(0,("verify_service_password: krb5_auth_con_init failed %s\n", error_message(err
)));
508 if ((err
= krb5_auth_con_setuseruserkey(ctx
, auth_context
, &key
)) != 0) {
509 DEBUG(0,("verify_service_password: krb5_auth_con_setuseruserkey failed %s\n", error_message(err
)));
513 if (!(err
= krb5_rd_req(ctx
, &auth_context
, in_data
, NULL
, NULL
, NULL
, &ticket
))) {
514 DEBUG(10,("verify_service_password: decrypted message with enctype %u salt %s!\n",
515 (unsigned int)enctype
, salting_s
));
521 memset(&passdata
, 0, sizeof(passdata
));
522 krb5_free_keyblock_contents(ctx
, &key
);
523 if (ticket
!= NULL
) {
524 krb5_free_ticket(ctx
, ticket
);
526 if (salting_kprinc
) {
527 krb5_free_principal(ctx
, salting_kprinc
);
529 SAFE_FREE(salting_s
);
531 SAFE_FREE(machine_account
);
535 /************************************************************************
537 * From the current draft of kerberos-clarifications:
539 * It is not possible to reliably generate a user's key given a pass
540 * phrase without contacting the KDC, since it will not be known
541 * whether alternate salt or parameter values are required.
543 * And because our server has a password, we have this exact problem. We
544 * make multiple guesses as to which principal name provides the salt which
547 ************************************************************************/
549 static void kerberos_derive_salting_principal_for_enctype(const char *service_principal
,
552 krb5_enctype enctype
,
553 krb5_enctype
*enctypes
)
555 char *salting_principals
[3] = {NULL
, NULL
, NULL
}, *second_principal
= NULL
;
556 krb5_error_code err
= 0;
560 memset(&outbuf
, '\0', sizeof(outbuf
));
562 /* Check that the service_principal is useful. */
563 if ((service_principal
== NULL
) || (strlen(service_principal
) == 0)) {
567 /* Generate our first guess -- the principal as-given. */
568 asprintf(&salting_principals
[0], "%s", service_principal
);
569 if ((salting_principals
[0] == NULL
) || (strlen(salting_principals
[0]) == 0)) {
573 /* Generate our second guess -- the computer's principal, as Win2k3. */
574 asprintf(&second_principal
, "host/%s.%s", global_myname(), lp_realm());
575 if (second_principal
!= NULL
) {
576 strlower_m(second_principal
);
577 asprintf(&salting_principals
[1], "%s@%s", second_principal
, lp_realm());
578 SAFE_FREE(second_principal
);
580 if ((salting_principals
[1] == NULL
) || (strlen(salting_principals
[1]) == 0)) {
584 /* Generate our third guess -- the computer's principal, as Win2k. */
585 asprintf(&second_principal
, "HOST/%s", global_myname());
586 if (second_principal
!= NULL
) {
587 strlower_m(second_principal
+ 5);
588 asprintf(&salting_principals
[2], "%s@%s",
589 second_principal
, lp_realm());
590 SAFE_FREE(second_principal
);
592 if ((salting_principals
[2] == NULL
) || (strlen(salting_principals
[2]) == 0)) {
596 /* Get a service ticket for ourselves into our memory ccache. */
597 /* This will commonly fail if there is no principal by that name (and we're trying
598 many names). So don't print a debug 0 error. */
600 if ((err
= get_service_ticket(ctx
, ccache
, service_principal
, enctype
, &outbuf
)) != 0) {
601 DEBUG(3, ("verify_service_password: get_service_ticket failed: %s\n",
602 error_message(err
)));
606 /* At this point we have a message to ourselves, salted only the KDC knows how. We
607 have to work out what that salting is. */
609 /* Try and find the correct salting principal. */
610 for (i
= 0; i
< sizeof(salting_principals
) / sizeof(salting_principals
[i
]); i
++) {
611 if (verify_service_password(ctx
, enctype
, salting_principals
[i
], &outbuf
)) {
616 /* If we failed to get a match, return. */
617 if (i
>= sizeof(salting_principals
) / sizeof(salting_principals
[i
])) {
621 /* If we succeeded, store the principal for use for all enctypes which
622 * share the same cipher and string-to-key function. Doing this here
623 * allows servers which just pass a keytab to krb5_rd_req() to work
625 for (j
= 0; enctypes
[j
] != 0; j
++) {
626 if (enctype
!= enctypes
[j
]) {
627 /* If this enctype isn't compatible with the one which
628 * we used, skip it. */
630 if (!kerberos_compatible_enctypes(ctx
, enctypes
[j
], enctype
))
633 /* If the principal which gives us the proper salt is the one
634 * which we would normally guess, don't bother noting anything
635 * in the secrets tdb. */
636 if (strcmp(service_principal
, salting_principals
[i
]) != 0) {
637 kerberos_secrets_store_salting_principal(service_principal
,
639 salting_principals
[i
]);
645 kerberos_free_data_contents(ctx
, &outbuf
);
646 SAFE_FREE(salting_principals
[0]);
647 SAFE_FREE(salting_principals
[1]);
648 SAFE_FREE(salting_principals
[2]);
649 SAFE_FREE(second_principal
);
652 /************************************************************************
653 Go through all the possible enctypes for this principal.
654 ************************************************************************/
656 static void kerberos_derive_salting_principal_direct(krb5_context context
,
658 krb5_enctype
*enctypes
,
659 char *service_principal
)
663 /* Try for each enctype separately, because the rules are
664 * different for different enctypes. */
665 for (i
= 0; enctypes
[i
] != 0; i
++) {
666 /* Delete secrets entry first. */
667 kerberos_secrets_store_salting_principal(service_principal
, 0, NULL
);
668 #ifdef ENCTYPE_ARCFOUR_HMAC
669 if (enctypes
[i
] == ENCTYPE_ARCFOUR_HMAC
) {
670 /* Of course this'll always work, so just save
671 * ourselves the effort. */
675 /* Try to figure out what's going on with this
677 kerberos_derive_salting_principal_for_enctype(service_principal
,
685 /************************************************************************
686 Wrapper function for the above.
687 ************************************************************************/
689 BOOL
kerberos_derive_salting_principal(char *service_principal
)
691 krb5_context context
= NULL
;
692 krb5_enctype
*enctypes
= NULL
;
693 krb5_ccache ccache
= NULL
;
694 krb5_error_code ret
= 0;
696 initialize_krb5_error_table();
697 if ((ret
= krb5_init_context(&context
)) != 0) {
698 DEBUG(1,("kerberos_derive_cifs_salting_principals: krb5_init_context failed. %s\n",
699 error_message(ret
)));
702 if ((ret
= get_kerberos_allowed_etypes(context
, &enctypes
)) != 0) {
703 DEBUG(1,("kerberos_derive_cifs_salting_principals: get_kerberos_allowed_etypes failed. %s\n",
704 error_message(ret
)));
708 if ((ret
= krb5_cc_resolve(context
, LIBADS_CCACHE_NAME
, &ccache
)) != 0) {
709 DEBUG(3, ("get_service_ticket: krb5_cc_resolve for %s failed: %s\n",
710 LIBADS_CCACHE_NAME
, error_message(ret
)));
714 kerberos_derive_salting_principal_direct(context
, ccache
, enctypes
, service_principal
);
718 free_kerberos_etypes(context
, enctypes
);
721 krb5_cc_destroy(context
, ccache
);
724 krb5_free_context(context
);
727 return ret
? False
: True
;
730 /************************************************************************
731 Core function to try and determine what salt is being used for any keytab
733 ************************************************************************/
735 BOOL
kerberos_derive_cifs_salting_principals(void)
738 char *service
= NULL
;
739 krb5_context context
= NULL
;
740 krb5_enctype
*enctypes
= NULL
;
741 krb5_ccache ccache
= NULL
;
742 krb5_error_code ret
= 0;
745 initialize_krb5_error_table();
746 if ((ret
= krb5_init_context(&context
)) != 0) {
747 DEBUG(1,("kerberos_derive_cifs_salting_principals: krb5_init_context failed. %s\n",
748 error_message(ret
)));
751 if ((ret
= get_kerberos_allowed_etypes(context
, &enctypes
)) != 0) {
752 DEBUG(1,("kerberos_derive_cifs_salting_principals: get_kerberos_allowed_etypes failed. %s\n",
753 error_message(ret
)));
757 if ((ret
= krb5_cc_resolve(context
, LIBADS_CCACHE_NAME
, &ccache
)) != 0) {
758 DEBUG(3, ("get_service_ticket: krb5_cc_resolve for %s failed: %s\n",
759 LIBADS_CCACHE_NAME
, error_message(ret
)));
763 if (asprintf(&service
, "%s$", global_myname()) != -1) {
765 kerberos_derive_salting_principal_direct(context
, ccache
, enctypes
, service
);
768 if (asprintf(&service
, "cifs/%s", global_myname()) != -1) {
770 kerberos_derive_salting_principal_direct(context
, ccache
, enctypes
, service
);
773 if (asprintf(&service
, "host/%s", global_myname()) != -1) {
775 kerberos_derive_salting_principal_direct(context
, ccache
, enctypes
, service
);
778 if (asprintf(&service
, "cifs/%s.%s", global_myname(), lp_realm()) != -1) {
780 kerberos_derive_salting_principal_direct(context
, ccache
, enctypes
, service
);
783 if (asprintf(&service
, "host/%s.%s", global_myname(), lp_realm()) != -1) {
785 kerberos_derive_salting_principal_direct(context
, ccache
, enctypes
, service
);
788 name_to_fqdn(my_fqdn
, global_myname());
789 if (asprintf(&service
, "cifs/%s", my_fqdn
) != -1) {
791 kerberos_derive_salting_principal_direct(context
, ccache
, enctypes
, service
);
794 if (asprintf(&service
, "host/%s", my_fqdn
) != -1) {
796 kerberos_derive_salting_principal_direct(context
, ccache
, enctypes
, service
);
804 free_kerberos_etypes(context
, enctypes
);
807 krb5_cc_destroy(context
, ccache
);
810 krb5_free_context(context
);
815 int kerberos_kinit_password(const char *principal
,
816 const char *password
,
818 const char *cache_name
)
820 return kerberos_kinit_password_ext(principal
,