vfy_increds.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <k5-int.h>
extern krb5_error_code krb5_libdefault_boolean();
static krb5_error_code
{
flags = 0; /* turns off OPENCLOSE mode */
return(code);
return(code);
goto cleanup;
continue;
if (code)
goto cleanup;
}
if (code != KRB5_CC_END)
goto cleanup;
code = 0;
if (code)
else
if (code)
else
return(code);
}
{
/* KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN */
if (server_arg) {
server = server_arg;
} else {
KRB5_NT_SRV_HST, &server)) {
goto cleanup;
} else {
/*
* Solaris Kerberos:
* We check first up to see whether 'verify_ap_req_fail' is
* set to false, because if FALSE there is no point in
* proceeding any further with the strict TGT verification check
*/
int nofail;
"verify_ap_req_nofail",
&nofail) == 0) {
/*
* Solaris Kerberos:
* If the administrator has configured the system such
* that its OK to fail this strict TGT verification check
* (i.e. verify_ap_req_nofail = false), set the
* 'ret' code to 0 and cleanup.
*/
if (!nofail) {
ret = 0;
goto cleanup;
}
}
}
}
/* first, check if the server is in the keytab. If not, there's
no reason to continue. rd_req does all this, but there's
no way to know that a given error is caused by a missing
keytab or key, and not by some other problem. */
if (keytab_arg) {
keytab = keytab_arg;
} else {
goto cleanup;
}
/* this means there is no keying material. This is ok, as long as
it is not prohibited by the configuration */
if (options &&
if (options->ap_req_nofail)
goto cleanup;
}
}
/* If the creds are for the server principal, we're set, just do
a mk_req. Otherwise, do a get_credentials first. */
/* make an ap_req */
&ap_req))
goto cleanup;
} else {
/* this is unclean, but it's the easiest way without ripping the
library into very small pieces. store the client's initial cred
in a memory ccache, then call the library. Later, we'll copy
everything except the initial cred into the ccache we return to
the user. A clean implementation would involve library
internals with a coherent idea of "in" and "out". */
/* insert the initial cred into the ccache */
goto cleanup;
goto cleanup;
goto cleanup;
/* set up for get_creds */
goto cleanup;
&out_creds))
goto cleanup;
/* make an ap_req */
&ap_req))
goto cleanup;
}
/* wipe the auth context for mk_req */
if (authcon) {
}
/* verify the ap_req */
goto cleanup;
/* if we get this far, then the verification succeeded. We can
still fail if the library stuff here fails, but that's it */
if (ccache_arg && ccache) {
if (*ccache_arg == NULL) {
if (retcc)
} else {
*ccache_arg = retcc;
}
} else {
server);
}
}
/* if any of the above paths returned an errors, then ret is set
accordingly. either that, or it's zero, which is fine, too */
if (!server_arg && server)
if (!keytab_arg && keytab)
if (ccache)
if (out_creds)
if (authcon)
return(ret);
}