remove trailing whitespace
This commit is contained in:
@@ -259,7 +259,7 @@ make_cred_from_ccred(krb5_context context,
|
||||
if (cred->addresses.val == NULL)
|
||||
goto nomem;
|
||||
cred->addresses.len = i;
|
||||
|
||||
|
||||
for (i = 0; i < cred->addresses.len; i++) {
|
||||
cred->addresses.val[i].addr_type = incred->addresses[i]->type;
|
||||
ret = krb5_data_copy(&cred->addresses.val[i].address,
|
||||
@@ -546,7 +546,7 @@ acc_resolve(krb5_context context, krb5_ccache *id, const char *res)
|
||||
error = (*a->ccache->func->get_kdc_time_offset)(a->ccache,
|
||||
cc_credentials_v5,
|
||||
&offset);
|
||||
if (error == 0)
|
||||
if (error == 0)
|
||||
context->kdc_sec_offset = offset;
|
||||
|
||||
} else if (error == ccErrCCacheNotFound) {
|
||||
@@ -887,7 +887,7 @@ acc_get_version(krb5_context context,
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct cache_iter {
|
||||
cc_context_t context;
|
||||
cc_ccache_iterator_t iter;
|
||||
@@ -961,7 +961,7 @@ acc_get_cache_next(krb5_context context, krb5_cc_cursor cursor, krb5_ccache *id)
|
||||
acc_close(context, *id);
|
||||
*id = NULL;
|
||||
return translate_cc_error(context, error);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1031,7 +1031,7 @@ acc_get_default_name(krb5_context context, char **str)
|
||||
(*cc->func->release)(cc);
|
||||
return translate_cc_error(context, error);
|
||||
}
|
||||
|
||||
|
||||
error = asprintf(str, "API:%s", name->data);
|
||||
(*name->func->release)(name);
|
||||
(*cc->func->release)(cc);
|
||||
|
@@ -224,7 +224,7 @@ krb5_acl_match_string(krb5_context context,
|
||||
return EACCES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* krb5_acl_match_file matches ACL format against each line in a file
|
||||
* using krb5_acl_match_string(). Lines starting with # are treated
|
||||
|
@@ -421,7 +421,7 @@ ipv6_mask_boundary(krb5_context context, const krb5_address *inaddr,
|
||||
sub_len = min(8, len);
|
||||
|
||||
m = 0xff << (8 - sub_len);
|
||||
|
||||
|
||||
laddr.s6_addr[i] = addr.s6_addr[i] & m;
|
||||
haddr.s6_addr[i] = (addr.s6_addr[i] & m) | ~m;
|
||||
|
||||
@@ -491,7 +491,7 @@ arange_parse_addr (krb5_context context,
|
||||
krb5_free_addresses(context, &addrmask);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
address += p - address + 1;
|
||||
|
||||
num = strtol(address, &q, 10);
|
||||
@@ -508,7 +508,7 @@ arange_parse_addr (krb5_context context,
|
||||
|
||||
} else {
|
||||
krb5_addresses low, high;
|
||||
|
||||
|
||||
strsep_copy(&address, "-", buf, sizeof(buf));
|
||||
ret = krb5_parse_address(context, buf, &low);
|
||||
if(ret)
|
||||
@@ -517,14 +517,14 @@ arange_parse_addr (krb5_context context,
|
||||
krb5_free_addresses(context, &low);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
strsep_copy(&address, "-", buf, sizeof(buf));
|
||||
ret = krb5_parse_address(context, buf, &high);
|
||||
if(ret) {
|
||||
krb5_free_addresses(context, &low);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
if(high.len != 1 && high.val[0].addr_type != low.val[0].addr_type) {
|
||||
krb5_free_addresses(context, &low);
|
||||
krb5_free_addresses(context, &high);
|
||||
@@ -610,7 +610,7 @@ arange_print_addr (const krb5_address *addr, char *str, size_t len)
|
||||
if (l > len)
|
||||
l = len;
|
||||
size = l;
|
||||
|
||||
|
||||
ret = krb5_print_address (&a->low, str + size, len - size, &l);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -656,7 +656,7 @@ arange_order_addr(krb5_context context,
|
||||
abort();
|
||||
UNREACHABLE(return 0);
|
||||
}
|
||||
|
||||
|
||||
if(a2->addr_type == KRB5_ADDRESS_ARANGE) {
|
||||
struct arange *b = a2->address.data;
|
||||
tmp1 = krb5_address_order(context, &a->low, &b->low);
|
||||
|
@@ -218,7 +218,7 @@ string_to_key_test(krb5_context context)
|
||||
opaque.data = iter;
|
||||
opaque.length = sizeof(iter);
|
||||
_krb5_put_int(iter, keys[i].iterations, 4);
|
||||
|
||||
|
||||
if (keys[i].pbkdf2) {
|
||||
unsigned char keyout[32];
|
||||
|
||||
@@ -229,13 +229,13 @@ string_to_key_test(krb5_context context)
|
||||
salt.saltvalue.data, salt.saltvalue.length,
|
||||
keys[i].iterations,
|
||||
keys[i].keylen, keyout);
|
||||
|
||||
|
||||
if (memcmp(keyout, keys[i].pbkdf2, keys[i].keylen) != 0) {
|
||||
krb5_warnx(context, "%d: pbkdf2", i);
|
||||
val = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (verbose) {
|
||||
printf("PBKDF2:\n");
|
||||
hex_dump_data(keyout, keys[i].keylen);
|
||||
@@ -257,7 +257,7 @@ string_to_key_test(krb5_context context)
|
||||
val = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (key.keyvalue.length != keys[i].keylen) {
|
||||
krb5_warnx(context, "%d: key wrong length (%lu/%lu)",
|
||||
i, (unsigned long)key.keyvalue.length,
|
||||
@@ -265,13 +265,13 @@ string_to_key_test(krb5_context context)
|
||||
val = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (memcmp(key.keyvalue.data, keys[i].key, keys[i].keylen) != 0) {
|
||||
krb5_warnx(context, "%d: key wrong", i);
|
||||
val = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (verbose) {
|
||||
printf("key:\n");
|
||||
hex_dump_data(key.keyvalue.data, key.keyvalue.length);
|
||||
@@ -380,7 +380,7 @@ krb_enc_iov2(krb5_context context,
|
||||
|
||||
free(p);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Now decrypt use iov
|
||||
*/
|
||||
|
||||
@@ -393,7 +393,7 @@ krb_enc_iov2(krb5_context context,
|
||||
|
||||
free(iov[1].data.data);
|
||||
free(iov[2].data.data);
|
||||
|
||||
|
||||
iov[1].data.data = p;
|
||||
iov[1].data.length += iov[2].data.length;
|
||||
|
||||
@@ -607,9 +607,9 @@ krb_enc_test(krb5_context context)
|
||||
cipher.data = krbencs[i].edata;
|
||||
plain.length = krbencs[i].plen;
|
||||
plain.data = krbencs[i].pdata;
|
||||
|
||||
|
||||
ret = krb_enc(context, crypto, krbencs[i].usage, &cipher, &plain);
|
||||
|
||||
|
||||
if (ret)
|
||||
errx(1, "krb_enc failed with %d for test %d", ret, i);
|
||||
|
||||
@@ -661,7 +661,7 @@ iov_test(krb5_context context)
|
||||
ret = krb5_crypto_length(context, crypto, KRB5_CRYPTO_TYPE_HEADER, &len);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_crypto_length");
|
||||
|
||||
|
||||
signonly.data = "This should be signed";
|
||||
signonly.length = strlen(signonly.data);
|
||||
in.data = "inputdata";
|
||||
@@ -682,7 +682,7 @@ iov_test(krb5_context context)
|
||||
iov[4].flags = KRB5_CRYPTO_TYPE_PADDING;
|
||||
iov[5].flags = KRB5_CRYPTO_TYPE_TRAILER;
|
||||
|
||||
ret = krb5_crypto_length_iov(context, crypto, iov,
|
||||
ret = krb5_crypto_length_iov(context, crypto, iov,
|
||||
sizeof(iov)/sizeof(iov[0]));
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_crypto_length_iov");
|
||||
@@ -712,11 +712,11 @@ iov_test(krb5_context context)
|
||||
* Encrypt
|
||||
*/
|
||||
|
||||
ret = krb5_encrypt_iov_ivec(context, crypto, 7, iov,
|
||||
ret = krb5_encrypt_iov_ivec(context, crypto, 7, iov,
|
||||
sizeof(iov)/sizeof(iov[0]), NULL);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_encrypt_iov_ivec");
|
||||
|
||||
|
||||
/*
|
||||
* Decrypt
|
||||
*/
|
||||
@@ -779,11 +779,11 @@ iov_test(krb5_context context)
|
||||
* Encrypt
|
||||
*/
|
||||
|
||||
ret = krb5_encrypt_iov_ivec(context, crypto, 7,
|
||||
ret = krb5_encrypt_iov_ivec(context, crypto, 7,
|
||||
iov, sizeof(iov)/sizeof(iov[0]), NULL);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_encrypt_iov_ivec");
|
||||
|
||||
|
||||
/*
|
||||
* Decrypt
|
||||
*/
|
||||
|
@@ -72,7 +72,7 @@ krb5_aname_to_localname (krb5_context context,
|
||||
ret = krb5_copy_principal(context, aname, &rootprinc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
userok = krb5_kuserok(context, rootprinc, res);
|
||||
krb5_free_principal(context, rootprinc);
|
||||
if (!userok)
|
||||
|
@@ -47,7 +47,7 @@ krb5_appdefault_boolean(krb5_context context, const char *appname,
|
||||
if(realm != NULL)
|
||||
def_val = krb5_config_get_bool_default(context, NULL, def_val,
|
||||
"realms", realm, option, NULL);
|
||||
|
||||
|
||||
def_val = krb5_config_get_bool_default(context, NULL, def_val,
|
||||
"appdefaults",
|
||||
option,
|
||||
|
@@ -290,7 +290,7 @@ krb5_auth_con_getlocalsubkey(krb5_context context,
|
||||
return copy_key(context, auth_context->local_subkey, keyblock);
|
||||
}
|
||||
|
||||
/* coverity[+alloc : arg-*2] */
|
||||
/* coverity[+alloc : arg-*2] */
|
||||
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
|
||||
krb5_auth_con_getremotesubkey(krb5_context context,
|
||||
krb5_auth_context auth_context,
|
||||
|
@@ -38,7 +38,7 @@
|
||||
/**
|
||||
* @page krb5_ccache_intro The credential cache functions
|
||||
* @section section_krb5_ccache Kerberos credential caches
|
||||
*
|
||||
*
|
||||
* krb5_ccache structure holds a Kerberos credential cache.
|
||||
*
|
||||
* Heimdal support the follow types of credential caches:
|
||||
@@ -837,7 +837,7 @@ krb5_cc_set_flags(krb5_context context,
|
||||
{
|
||||
return (*id->ops->set_flags)(context, id, flags);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the flags of `id', store them in `flags'.
|
||||
*
|
||||
@@ -1144,7 +1144,7 @@ krb5_cc_cache_match (krb5_context context,
|
||||
ret = krb5_cc_get_principal(context, cache, &principal);
|
||||
if (ret == 0) {
|
||||
krb5_boolean match;
|
||||
|
||||
|
||||
match = krb5_principal_compare(context, principal, client);
|
||||
krb5_free_principal(context, principal);
|
||||
if (match)
|
||||
@@ -1245,7 +1245,7 @@ build_conf_principals(krb5_context context, krb5_ccache id,
|
||||
krb5_free_principal(context, client);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return TRUE (non zero) if the principal is a configuration
|
||||
* principal (generated part of krb5_cc_set_config()). Returns FALSE
|
||||
@@ -1267,7 +1267,7 @@ krb5_is_config_principal(krb5_context context,
|
||||
if (principal->name.name_string.len == 0 ||
|
||||
strcmp(principal->name.name_string.val[0], KRB5_CONF_NAME) != 0)
|
||||
return FALSE;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1306,11 +1306,11 @@ krb5_cc_set_config(krb5_context context, krb5_ccache id,
|
||||
/* not that anyone care when this expire */
|
||||
cred.times.authtime = time(NULL);
|
||||
cred.times.endtime = cred.times.authtime + 3600 * 24 * 30;
|
||||
|
||||
|
||||
ret = krb5_data_copy(&cred.ticket, data->data, data->length);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
ret = krb5_cc_store_cred(context, id, &cred);
|
||||
}
|
||||
|
||||
@@ -1396,7 +1396,7 @@ krb5_cccol_cursor_new(krb5_context context, krb5_cccol_cursor *cursor)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get next credential cache from the iteration.
|
||||
* Get next credential cache from the iteration.
|
||||
*
|
||||
* @param context A Kerberos 5 context
|
||||
* @param cursor the iteration cursor
|
||||
@@ -1418,13 +1418,13 @@ krb5_cccol_cursor_next(krb5_context context, krb5_cccol_cursor cursor,
|
||||
krb5_ccache *cache)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
|
||||
|
||||
*cache = NULL;
|
||||
|
||||
while (cursor->idx < context->num_cc_ops) {
|
||||
|
||||
if (cursor->cursor == NULL) {
|
||||
ret = krb5_cc_cache_get_first (context,
|
||||
ret = krb5_cc_cache_get_first (context,
|
||||
context->cc_ops[cursor->idx]->prefix,
|
||||
&cursor->cursor);
|
||||
if (ret) {
|
||||
@@ -1493,7 +1493,7 @@ krb5_cccol_cursor_free(krb5_context context, krb5_cccol_cursor *cursor)
|
||||
|
||||
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
|
||||
krb5_cc_last_change_time(krb5_context context,
|
||||
krb5_ccache id,
|
||||
krb5_ccache id,
|
||||
krb5_timestamp *mtime)
|
||||
{
|
||||
*mtime = 0;
|
||||
@@ -1630,7 +1630,7 @@ krb5_cc_get_lifetime(krb5_context context, krb5_ccache id, time_t *t)
|
||||
|
||||
*t = 0;
|
||||
now = time(NULL);
|
||||
|
||||
|
||||
ret = krb5_cc_start_seq_get(context, id, &cursor);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -1644,7 +1644,7 @@ krb5_cc_get_lifetime(krb5_context context, krb5_ccache id, time_t *t)
|
||||
}
|
||||
krb5_free_cred_contents(context, &cred);
|
||||
}
|
||||
|
||||
|
||||
krb5_cc_end_seq_get(context, id, &cursor);
|
||||
|
||||
return ret;
|
||||
|
@@ -197,7 +197,7 @@ setpw_send_request (krb5_context context,
|
||||
chpw.targname = NULL;
|
||||
chpw.targrealm = NULL;
|
||||
}
|
||||
|
||||
|
||||
ASN1_MALLOC_ENCODE(ChangePasswdDataMS, pwd_data.data, pwd_data.length,
|
||||
&chpw, &len, ret);
|
||||
if (ret) {
|
||||
@@ -302,7 +302,7 @@ process_reply (krb5_context context,
|
||||
_krb5_get_int(reply, &size, 4);
|
||||
if (size + 4 < len)
|
||||
continue;
|
||||
memmove(reply, reply + 4, size);
|
||||
memmove(reply, reply + 4, size);
|
||||
len = size;
|
||||
break;
|
||||
}
|
||||
@@ -586,7 +586,7 @@ change_password_loop (krb5_context context,
|
||||
|
||||
if (!replied) {
|
||||
replied = 0;
|
||||
|
||||
|
||||
ret = (*proc->send_req) (context,
|
||||
&auth_context,
|
||||
creds,
|
||||
|
@@ -248,7 +248,7 @@ cfstring2cstring(CFStringRef string)
|
||||
{
|
||||
CFIndex len;
|
||||
char *str;
|
||||
|
||||
|
||||
str = (char *) CFStringGetCStringPtr(string, kCFStringEncodingUTF8);
|
||||
if (str)
|
||||
return strdup(str);
|
||||
@@ -258,7 +258,7 @@ cfstring2cstring(CFStringRef string)
|
||||
str = malloc(len);
|
||||
if (str == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
if (!CFStringGetCString (string, str, len, kCFStringEncodingUTF8)) {
|
||||
free (str);
|
||||
return NULL;
|
||||
@@ -297,7 +297,7 @@ parse_plist_config(krb5_context context, const char *path, krb5_config_section *
|
||||
CFReadStreamRef s;
|
||||
CFDictionaryRef d;
|
||||
CFURLRef url;
|
||||
|
||||
|
||||
url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (UInt8 *)path, strlen(path), FALSE);
|
||||
if (url == NULL) {
|
||||
krb5_clear_error_message(context);
|
||||
@@ -319,7 +319,7 @@ parse_plist_config(krb5_context context, const char *path, krb5_config_section *
|
||||
|
||||
#ifdef HAVE_CFPROPERTYLISTCREATEWITHSTREAM
|
||||
d = (CFDictionaryRef)CFPropertyListCreateWithStream(NULL, s, 0, kCFPropertyListImmutable, NULL, NULL);
|
||||
#else
|
||||
#else
|
||||
d = (CFDictionaryRef)CFPropertyListCreateFromStream(NULL, s, 0, kCFPropertyListImmutable, NULL, NULL);
|
||||
#endif
|
||||
CFRelease(s);
|
||||
@@ -439,7 +439,7 @@ krb5_config_parse_file_multi (krb5_context context,
|
||||
home = getenv("HOME");
|
||||
|
||||
if (home == NULL) {
|
||||
struct passwd *pw = getpwuid(getuid());
|
||||
struct passwd *pw = getpwuid(getuid());
|
||||
if(pw != NULL)
|
||||
home = pw->pw_dir;
|
||||
}
|
||||
@@ -453,7 +453,7 @@ krb5_config_parse_file_multi (krb5_context context,
|
||||
fname = newfname;
|
||||
}
|
||||
#else /* KRB5_USE_PATH_TOKENS */
|
||||
if (asprintf(&newfname, "%%{USERCONFIG}%s", &fname[1]) < 0 ||
|
||||
if (asprintf(&newfname, "%%{USERCONFIG}%s", &fname[1]) < 0 ||
|
||||
newfname == NULL)
|
||||
{
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
@@ -475,7 +475,7 @@ krb5_config_parse_file_multi (krb5_context context,
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
krb5_set_error_message(context, ENOENT,
|
||||
krb5_set_error_message(context, ENOENT,
|
||||
"no support for plist configuration files");
|
||||
return ENOENT;
|
||||
#endif
|
||||
@@ -489,7 +489,7 @@ krb5_config_parse_file_multi (krb5_context context,
|
||||
free(newfname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
if (newfname)
|
||||
free(newfname);
|
||||
fname = newfname = exp_fname;
|
||||
@@ -505,7 +505,7 @@ krb5_config_parse_file_multi (krb5_context context,
|
||||
free(newfname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
ret = krb5_config_parse_debug (&f, res, &lineno, &str);
|
||||
fclose(f.f);
|
||||
if (ret) {
|
||||
@@ -768,7 +768,7 @@ krb5_config_vget_list (krb5_context context,
|
||||
*
|
||||
* @ingroup krb5_support
|
||||
*/
|
||||
|
||||
|
||||
KRB5_LIB_FUNCTION const char* KRB5_LIB_CALL
|
||||
krb5_config_get_string (krb5_context context,
|
||||
const krb5_config_section *c,
|
||||
|
@@ -317,7 +317,7 @@ kt_ops_copy(krb5_context context, const krb5_context src_context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char *sysplugin_dirs[] = {
|
||||
static const char *sysplugin_dirs[] = {
|
||||
LIBDIR "/plugin/krb5",
|
||||
#ifdef __APPLE__
|
||||
"/Library/KerberosPlugins/KerberosFrameworkPlugins",
|
||||
@@ -332,7 +332,7 @@ init_context_once(void *ctx)
|
||||
krb5_context context = ctx;
|
||||
|
||||
_krb5_load_plugins(context, "krb5", sysplugin_dirs);
|
||||
|
||||
|
||||
bindtextdomain(HEIMDAL_TEXTDOMAIN, HEIMDAL_LOCALEDIR);
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ krb5_init_context(krb5_context *context)
|
||||
ret = hx509_context_init(&p->hx509ctx);
|
||||
if (ret)
|
||||
goto out;
|
||||
#endif
|
||||
#endif
|
||||
if (rk_SOCK_INIT())
|
||||
p->flags |= KRB5_CTX_F_SOCKETS_INITIALIZED;
|
||||
|
||||
@@ -433,7 +433,7 @@ copy_etypes (krb5_context context,
|
||||
|
||||
*ret_enctypes = malloc(sizeof(ret_enctypes[0]) * i);
|
||||
if (*ret_enctypes == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
}
|
||||
@@ -481,7 +481,7 @@ krb5_copy_context(krb5_context context, krb5_context *out)
|
||||
p->default_cc_name = strdup(context->default_cc_name);
|
||||
if (context->default_cc_name_env)
|
||||
p->default_cc_name_env = strdup(context->default_cc_name_env);
|
||||
|
||||
|
||||
if (context->etypes) {
|
||||
ret = copy_etypes(context, context->etypes, &p->etypes);
|
||||
if (ret)
|
||||
@@ -494,7 +494,7 @@ krb5_copy_context(krb5_context context, krb5_context *out)
|
||||
}
|
||||
|
||||
if (context->default_realms) {
|
||||
ret = krb5_copy_host_realm(context,
|
||||
ret = krb5_copy_host_realm(context,
|
||||
context->default_realms, &p->default_realms);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -736,7 +736,7 @@ krb5_prepend_config_files_default(const char *filelist, char ***pfilenames)
|
||||
krb5_free_config_files(defpp);
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
*pfilenames = pp;
|
||||
return 0;
|
||||
}
|
||||
|
@@ -228,7 +228,7 @@ krb5_compare_creds(krb5_context context, krb5_flags whichfields,
|
||||
match = krb5_principal_compare (context, mcreds->client,
|
||||
creds->client);
|
||||
}
|
||||
|
||||
|
||||
if (match && (whichfields & KRB5_TC_MATCH_KEYTYPE))
|
||||
match = mcreds->session.keytype == creds->session.keytype;
|
||||
|
||||
|
@@ -477,7 +477,7 @@ verify_checksum(krb5_context context,
|
||||
if(ct->verify) {
|
||||
ret = (*ct->verify)(context, dkey, data, len, usage, cksum);
|
||||
if (ret)
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("Decrypt integrity check failed for checksum "
|
||||
"type %s, key type %s", ""),
|
||||
ct->name, (crypto != NULL)? crypto->et->name : "(none)");
|
||||
@@ -1672,7 +1672,7 @@ krb5_crypto_length(krb5_context context,
|
||||
krb5_set_error_message(context, EINVAL, "not a derived crypto");
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
|
||||
switch(type) {
|
||||
case KRB5_CRYPTO_TYPE_EMPTY:
|
||||
*len = 0;
|
||||
@@ -2103,7 +2103,7 @@ krb5_crypto_destroy(krb5_context context,
|
||||
|
||||
/**
|
||||
* Return the blocksize used algorithm referenced by the crypto context
|
||||
*
|
||||
*
|
||||
* @param context Kerberos context
|
||||
* @param crypto crypto context to query
|
||||
* @param blocksize the resulting blocksize
|
||||
@@ -2124,7 +2124,7 @@ krb5_crypto_getblocksize(krb5_context context,
|
||||
|
||||
/**
|
||||
* Return the encryption type used by the crypto context
|
||||
*
|
||||
*
|
||||
* @param context Kerberos context
|
||||
* @param crypto crypto context to query
|
||||
* @param enctype the resulting encryption type
|
||||
@@ -2145,7 +2145,7 @@ krb5_crypto_getenctype(krb5_context context,
|
||||
|
||||
/**
|
||||
* Return the padding size used by the crypto context
|
||||
*
|
||||
*
|
||||
* @param context Kerberos context
|
||||
* @param crypto crypto context to query
|
||||
* @param padsize the return padding size
|
||||
@@ -2166,7 +2166,7 @@ krb5_crypto_getpadsize(krb5_context context,
|
||||
|
||||
/**
|
||||
* Return the confounder size used by the crypto context
|
||||
*
|
||||
*
|
||||
* @param context Kerberos context
|
||||
* @param crypto crypto context to query
|
||||
* @param confoundersize the returned confounder size
|
||||
|
@@ -1,19 +1,19 @@
|
||||
/***********************************************************************
|
||||
* Copyright (c) 2009, Secure Endpoints Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
@@ -26,7 +26,7 @@
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
**********************************************************************/
|
||||
|
||||
#include<windows.h>
|
||||
|
@@ -636,7 +636,7 @@
|
||||
* @endcode
|
||||
*
|
||||
* - time
|
||||
*
|
||||
*
|
||||
* Format of the time is: YYYYmmddHHMMSS, corresponding to strftime
|
||||
* format "%Y%m%d%k%M%S".
|
||||
*
|
||||
|
@@ -2,19 +2,19 @@
|
||||
/***********************************************************************
|
||||
* Copyright (c) 2009, Secure Endpoints Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
@@ -27,7 +27,7 @@
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
**********************************************************************/
|
||||
|
||||
#include "krb5_locl.h"
|
||||
@@ -168,7 +168,7 @@ _expand_userid(krb5_context context, PTYPE param, const char *postfix, char **re
|
||||
|
||||
if (le != 0) {
|
||||
if (context)
|
||||
krb5_set_error_message(context, rv,
|
||||
krb5_set_error_message(context, rv,
|
||||
"Can't open thread token (GLE=%d)", le);
|
||||
goto _exit;
|
||||
}
|
||||
@@ -247,7 +247,7 @@ _expand_csidl(krb5_context context, PTYPE folder, const char *postfix, char **re
|
||||
if (context)
|
||||
krb5_set_error_message(context, EINVAL, "Unable to determine folder path");
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
len = strlen(path);
|
||||
|
||||
@@ -464,7 +464,7 @@ _krb5_expand_path_tokens(krb5_context context,
|
||||
return ENOMEM;
|
||||
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
size_t append_len = strlen(append);
|
||||
char * new_str = realloc(*ppath_out, len + append_len + 1);
|
||||
|
@@ -454,7 +454,7 @@ fcc_initialize(krb5_context context,
|
||||
}
|
||||
}
|
||||
ret |= krb5_store_principal(sp, primary_principal);
|
||||
|
||||
|
||||
ret |= write_storage(context, sp, fd);
|
||||
|
||||
krb5_storage_free(sp);
|
||||
@@ -879,7 +879,7 @@ fcc_get_version(krb5_context context,
|
||||
|
||||
return FCACHE(id)->version;
|
||||
}
|
||||
|
||||
|
||||
struct fcache_iter {
|
||||
int first;
|
||||
};
|
||||
|
@@ -249,16 +249,16 @@ init_tgs_req (krb5_context context,
|
||||
ret = krb5_auth_con_init(context, &ac);
|
||||
if(ret)
|
||||
goto fail;
|
||||
|
||||
|
||||
ret = krb5_auth_con_generatelocalsubkey(context, ac, &krbtgt->session);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
|
||||
ret = set_auth_data (context, &t->req_body, &in_creds->authdata,
|
||||
ac->local_subkey);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
|
||||
ret = make_pa_tgs_req(context,
|
||||
ac,
|
||||
&t->req_body,
|
||||
@@ -385,7 +385,7 @@ decrypt_tkt_with_subkey (krb5_context context,
|
||||
&dec_rep->enc_part,
|
||||
&size);
|
||||
if (ret)
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("Failed to decode encpart in ticket", ""));
|
||||
krb5_data_free (&data);
|
||||
return ret;
|
||||
@@ -442,7 +442,7 @@ get_cred_kdc(krb5_context context,
|
||||
self.name = impersonate_principal->name;
|
||||
self.realm = impersonate_principal->realm;
|
||||
self.auth = estrdup("Kerberos");
|
||||
|
||||
|
||||
ret = _krb5_s4u2self_to_checksumdata(context, &self, &data);
|
||||
if (ret) {
|
||||
free(self.auth);
|
||||
@@ -477,7 +477,7 @@ get_cred_kdc(krb5_context context,
|
||||
goto out;
|
||||
if (len != size)
|
||||
krb5_abortx(context, "internal asn1 error");
|
||||
|
||||
|
||||
ret = krb5_padata_add(context, &padata, KRB5_PADATA_FOR_USER, buf, len);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -611,7 +611,7 @@ get_cred_kdc_address(krb5_context context,
|
||||
|
||||
krb5_appdefault_boolean(context, NULL, krbtgt->server->realm,
|
||||
"no-addresses", FALSE, &noaddr);
|
||||
|
||||
|
||||
if (!noaddr) {
|
||||
krb5_get_all_client_addrs(context, &addresses);
|
||||
/* XXX this sucks. */
|
||||
@@ -736,7 +736,7 @@ get_cred_kdc_capath_worker(krb5_context context,
|
||||
krb5_creds *in_creds,
|
||||
krb5_const_realm try_realm,
|
||||
krb5_principal impersonate_principal,
|
||||
Ticket *second_ticket,
|
||||
Ticket *second_ticket,
|
||||
krb5_creds **out_creds,
|
||||
krb5_creds ***ret_tgts)
|
||||
{
|
||||
@@ -811,7 +811,7 @@ get_cred_kdc_capath_worker(krb5_context context,
|
||||
krb5_free_principal(context, tmp_creds.client);
|
||||
return ret;
|
||||
}
|
||||
/*
|
||||
/*
|
||||
* if either of the chain or the ok_as_delegate was stripped
|
||||
* by the kdc, make sure we strip it too.
|
||||
*/
|
||||
@@ -844,7 +844,7 @@ get_cred_kdc_capath_worker(krb5_context context,
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
krb5_free_principal(context, tmp_creds.server);
|
||||
krb5_free_principal(context, tmp_creds.client);
|
||||
*out_creds = calloc(1, sizeof(**out_creds));
|
||||
@@ -862,7 +862,7 @@ get_cred_kdc_capath_worker(krb5_context context,
|
||||
}
|
||||
krb5_free_creds(context, tgt);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
get_cred(server)
|
||||
@@ -885,7 +885,7 @@ get_cred_kdc_capath(krb5_context context,
|
||||
krb5_ccache ccache,
|
||||
krb5_creds *in_creds,
|
||||
krb5_principal impersonate_principal,
|
||||
Ticket *second_ticket,
|
||||
Ticket *second_ticket,
|
||||
krb5_creds **out_creds,
|
||||
krb5_creds ***ret_tgts)
|
||||
{
|
||||
@@ -920,7 +920,7 @@ get_cred_kdc_referral(krb5_context context,
|
||||
krb5_ccache ccache,
|
||||
krb5_creds *in_creds,
|
||||
krb5_principal impersonate_principal,
|
||||
Ticket *second_ticket,
|
||||
Ticket *second_ticket,
|
||||
krb5_creds **out_creds,
|
||||
krb5_creds ***ret_tgts)
|
||||
{
|
||||
@@ -948,7 +948,7 @@ get_cred_kdc_referral(krb5_context context,
|
||||
/* find tgt for the clients base realm */
|
||||
{
|
||||
krb5_principal tgtname;
|
||||
|
||||
|
||||
ret = krb5_make_principal(context, &tgtname,
|
||||
client_realm,
|
||||
KRB5_TGS_NAME,
|
||||
@@ -956,7 +956,7 @@ get_cred_kdc_referral(krb5_context context,
|
||||
NULL);
|
||||
if(ret)
|
||||
return ret;
|
||||
|
||||
|
||||
ret = find_cred(context, ccache, tgtname, *ret_tgts, &tgt);
|
||||
krb5_free_principal(context, tgtname);
|
||||
if (ret)
|
||||
@@ -1034,9 +1034,9 @@ get_cred_kdc_referral(krb5_context context,
|
||||
goto out;
|
||||
}
|
||||
tickets++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* if either of the chain or the ok_as_delegate was stripped
|
||||
* by the kdc, make sure we strip it too.
|
||||
*/
|
||||
@@ -1082,7 +1082,7 @@ _krb5_get_cred_kdc_any(krb5_context context,
|
||||
krb5_ccache ccache,
|
||||
krb5_creds *in_creds,
|
||||
krb5_principal impersonate_principal,
|
||||
Ticket *second_ticket,
|
||||
Ticket *second_ticket,
|
||||
krb5_creds **out_creds,
|
||||
krb5_creds ***ret_tgts)
|
||||
{
|
||||
@@ -1167,7 +1167,7 @@ krb5_get_credentials_with_flags(krb5_context context,
|
||||
*out_creds = res_creds;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
krb5_timeofday(context, &timeret);
|
||||
if(res_creds->times.endtime > timeret) {
|
||||
*out_creds = res_creds;
|
||||
@@ -1384,7 +1384,7 @@ krb5_get_creds(krb5_context context,
|
||||
krb5_free_principal(context, in_creds.client);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
krb5_timeofday(context, &timeret);
|
||||
if(res_creds->times.endtime > timeret) {
|
||||
*out_creds = res_creds;
|
||||
@@ -1469,7 +1469,7 @@ krb5_get_renewed_creds(krb5_context context,
|
||||
}
|
||||
} else {
|
||||
const char *realm = krb5_principal_get_realm(context, client);
|
||||
|
||||
|
||||
ret = krb5_make_principal(context, &in.server, realm, KRB5_TGS_NAME,
|
||||
realm, NULL);
|
||||
if (ret) {
|
||||
|
@@ -76,7 +76,7 @@ _krb5_get_default_principal_local (krb5_context context,
|
||||
else
|
||||
ret = krb5_make_principal(context, princ, NULL, "root", NULL);
|
||||
} else {
|
||||
struct passwd *pw = getpwuid(uid);
|
||||
struct passwd *pw = getpwuid(uid);
|
||||
if(pw != NULL)
|
||||
user = pw->pw_name;
|
||||
else {
|
||||
|
@@ -225,7 +225,7 @@ krb5_get_forwarded_creds (krb5_context context,
|
||||
if (!noaddr)
|
||||
paddrs = &addrs;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* If tickets have addresses, get the address of the remote host.
|
||||
*/
|
||||
@@ -241,7 +241,7 @@ krb5_get_forwarded_creds (krb5_context context,
|
||||
hostname, gai_strerror(ret));
|
||||
return ret2;
|
||||
}
|
||||
|
||||
|
||||
ret = add_addrs (context, &addrs, ai);
|
||||
freeaddrinfo (ai);
|
||||
if (ret)
|
||||
@@ -287,9 +287,9 @@ krb5_get_forwarded_creds (krb5_context context,
|
||||
if (auth_context->flags & KRB5_AUTH_CONTEXT_DO_TIME) {
|
||||
krb5_timestamp sec;
|
||||
int32_t usec;
|
||||
|
||||
|
||||
krb5_us_timeofday (context, &sec, &usec);
|
||||
|
||||
|
||||
ALLOC(enc_krb_cred_part.timestamp, 1);
|
||||
if (enc_krb_cred_part.timestamp == NULL) {
|
||||
ret = ENOMEM;
|
||||
@@ -418,7 +418,7 @@ krb5_get_forwarded_creds (krb5_context context,
|
||||
* used. Heimdal 0.7.2 and newer have code to try both in the
|
||||
* receiving end.
|
||||
*/
|
||||
|
||||
|
||||
ret = krb5_crypto_init(context, auth_context->keyblock, 0, &crypto);
|
||||
if (ret) {
|
||||
free(buf);
|
||||
|
@@ -74,7 +74,7 @@ make_pa_enc_timestamp(krb5_context context, PA_DATA *pa,
|
||||
krb5_crypto_destroy(context, crypto);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
ASN1_MALLOC_ENCODE(EncryptedData, buf, buf_size, &encdata, &len, ret);
|
||||
free_EncryptedData(&encdata);
|
||||
if (ret)
|
||||
@@ -298,7 +298,7 @@ init_as_req (krb5_context context,
|
||||
add_padata(context, a->padata, creds->client,
|
||||
key_proc, keyseed, a->req_body.etype.val,
|
||||
a->req_body.etype.len, NULL);
|
||||
|
||||
|
||||
/* make a v4 salted pa-data */
|
||||
salt.salttype = KRB5_PW_SALT;
|
||||
krb5_data_zero(&salt.saltvalue);
|
||||
@@ -481,12 +481,12 @@ krb5_get_in_cred(krb5_context context,
|
||||
if(pa) {
|
||||
salt.salttype = pa->padata_type;
|
||||
salt.saltvalue = pa->padata_value;
|
||||
|
||||
|
||||
ret = (*key_proc)(context, etype, salt, keyseed, &key);
|
||||
} else {
|
||||
/* make a v5 salted pa-data */
|
||||
ret = krb5_get_pw_salt (context, creds->client, &salt);
|
||||
|
||||
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = (*key_proc)(context, etype, salt, keyseed, &key);
|
||||
@@ -494,7 +494,7 @@ krb5_get_in_cred(krb5_context context,
|
||||
}
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
{
|
||||
unsigned flags = EXTRACT_TICKET_TIMESYNC;
|
||||
if (opts.request_anonymous)
|
||||
|
@@ -61,14 +61,14 @@ krb5_get_init_creds_opt_alloc(krb5_context context,
|
||||
*opt = NULL;
|
||||
o = calloc(1, sizeof(*o));
|
||||
if (o == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
o->opt_private = calloc(1, sizeof(*o->opt_private));
|
||||
if (o->opt_private == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
N_("malloc: out of memory", ""));
|
||||
free(o);
|
||||
return ENOMEM;
|
||||
|
@@ -71,7 +71,7 @@ typedef struct krb5_get_init_creds_ctx {
|
||||
KRB_ERROR error;
|
||||
AS_REP as_rep;
|
||||
EncKDCRepPart enc_part;
|
||||
|
||||
|
||||
krb5_prompter_fct prompter;
|
||||
void *prompter_data;
|
||||
|
||||
@@ -313,14 +313,14 @@ process_last_request(krb5_context context,
|
||||
if (lr->val[i].lr_value <= t) {
|
||||
switch (abs(lr->val[i].lr_type)) {
|
||||
case LR_PW_EXPTIME :
|
||||
report_expiration(context, ctx->prompter,
|
||||
report_expiration(context, ctx->prompter,
|
||||
ctx->prompter_data,
|
||||
"Your password will expire at ",
|
||||
lr->val[i].lr_value);
|
||||
reported = TRUE;
|
||||
break;
|
||||
case LR_ACCT_EXPTIME :
|
||||
report_expiration(context, ctx->prompter,
|
||||
report_expiration(context, ctx->prompter,
|
||||
ctx->prompter_data,
|
||||
"Your account will expire at ",
|
||||
lr->val[i].lr_value);
|
||||
@@ -333,7 +333,7 @@ process_last_request(krb5_context context,
|
||||
if (!reported
|
||||
&& ctx->enc_part.key_expiration
|
||||
&& *ctx->enc_part.key_expiration <= t) {
|
||||
report_expiration(context, ctx->prompter,
|
||||
report_expiration(context, ctx->prompter,
|
||||
ctx->prompter_data,
|
||||
"Your password/account will expire at ",
|
||||
*ctx->enc_part.key_expiration);
|
||||
@@ -367,7 +367,7 @@ get_init_creds_common(krb5_context context,
|
||||
|
||||
if (options->opt_private) {
|
||||
if (options->opt_private->password) {
|
||||
ret = krb5_init_creds_set_password(context, ctx,
|
||||
ret = krb5_init_creds_set_password(context, ctx,
|
||||
options->opt_private->password);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -384,7 +384,7 @@ get_init_creds_common(krb5_context context,
|
||||
ctx->keyproc = default_s2k_func;
|
||||
|
||||
/* Enterprise name implicitly turns on canonicalize */
|
||||
if ((ctx->ic_flags & KRB5_INIT_CREDS_CANONICALIZE) ||
|
||||
if ((ctx->ic_flags & KRB5_INIT_CREDS_CANONICALIZE) ||
|
||||
krb5_principal_get_type(context, client) == KRB5_NT_ENTERPRISE_PRINCIPAL)
|
||||
ctx->flags.canonicalize = 1;
|
||||
|
||||
@@ -1179,14 +1179,14 @@ process_pa_data_to_md(krb5_context context,
|
||||
_krb5_debug(context, 5, "krb5_get_init_creds: "
|
||||
"prepareing PKINIT padata (%s)",
|
||||
(ctx->used_pa_types & USED_PKINIT_W2K) ? "win2k" : "ietf");
|
||||
|
||||
|
||||
if (ctx->used_pa_types & USED_PKINIT_W2K) {
|
||||
krb5_set_error_message(context, KRB5_GET_IN_TKT_LOOP,
|
||||
"Already tried pkinit, looping");
|
||||
return KRB5_GET_IN_TKT_LOOP;
|
||||
}
|
||||
|
||||
ret = pa_data_to_md_pkinit(context, a, creds->client,
|
||||
ret = pa_data_to_md_pkinit(context, a, creds->client,
|
||||
(ctx->used_pa_types & USED_PKINIT),
|
||||
ctx, *out_md);
|
||||
if (ret)
|
||||
@@ -1526,14 +1526,14 @@ krb5_init_creds_set_keytab(krb5_context context,
|
||||
krb5_error_code ret;
|
||||
size_t netypes = 0;
|
||||
int kvno = 0;
|
||||
|
||||
|
||||
a = malloc(sizeof(*a));
|
||||
if (a == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
a->principal = ctx->cred.client;
|
||||
a->keytab = keytab;
|
||||
|
||||
@@ -1568,7 +1568,7 @@ krb5_init_creds_set_keytab(krb5_context context,
|
||||
kvno = entry.vno;
|
||||
} else if (entry.vno != kvno)
|
||||
goto next;
|
||||
|
||||
|
||||
/* check if enctype is supported */
|
||||
if (krb5_enctype_valid(context, entry.keyblock.keytype) != 0)
|
||||
goto next;
|
||||
@@ -1619,7 +1619,7 @@ krb5_init_creds_set_keyblock(krb5_context context,
|
||||
|
||||
/**
|
||||
* The core loop if krb5_get_init_creds() function family. Create the
|
||||
* packets and have the caller send them off to the KDC.
|
||||
* packets and have the caller send them off to the KDC.
|
||||
*
|
||||
* If the caller want all work been done for them, use
|
||||
* krb5_init_creds_get() instead.
|
||||
@@ -1768,13 +1768,13 @@ krb5_init_creds_step(krb5_context context,
|
||||
"options send by KDC", ""));
|
||||
}
|
||||
} else if (ret == KRB5KRB_AP_ERR_SKEW && context->kdc_sec_offset == 0) {
|
||||
/*
|
||||
/*
|
||||
* Try adapt to timeskrew when we are using pre-auth, and
|
||||
* if there was a time skew, try again.
|
||||
*/
|
||||
krb5_set_real_time(context, ctx->error.stime, -1);
|
||||
if (context->kdc_sec_offset)
|
||||
ret = 0;
|
||||
ret = 0;
|
||||
|
||||
_krb5_debug(context, 10, "init_creds: err skew updateing kdc offset to %d",
|
||||
context->kdc_sec_offset);
|
||||
@@ -1793,7 +1793,7 @@ krb5_init_creds_step(krb5_context context,
|
||||
"krb5_get_init_creds: got referal to realm %s",
|
||||
*ctx->error.crealm);
|
||||
|
||||
ret = krb5_principal_set_realm(context,
|
||||
ret = krb5_principal_set_realm(context,
|
||||
ctx->cred.client,
|
||||
*ctx->error.crealm);
|
||||
|
||||
@@ -1934,7 +1934,7 @@ krb5_init_creds_get(krb5_context context, krb5_init_creds_context ctx)
|
||||
if ((flags & 1) == 0)
|
||||
break;
|
||||
|
||||
ret = krb5_sendto_context (context, stctx, &out,
|
||||
ret = krb5_sendto_context (context, stctx, &out,
|
||||
ctx->cred.client->realm, &in);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -2013,7 +2013,7 @@ krb5_get_init_creds_password(krb5_context context,
|
||||
}
|
||||
|
||||
ret = krb5_init_creds_get(context, ctx);
|
||||
|
||||
|
||||
if (ret == 0)
|
||||
process_last_request(context, options, ctx);
|
||||
|
||||
|
@@ -157,7 +157,7 @@ kcm_alloc(krb5_context context, const char *name, krb5_ccache *id)
|
||||
}
|
||||
} else
|
||||
k->name = NULL;
|
||||
|
||||
|
||||
(*id)->data.data = k;
|
||||
(*id)->data.length = sizeof(*k);
|
||||
|
||||
@@ -554,7 +554,7 @@ kcm_get_first (krb5_context context,
|
||||
c = calloc(1, sizeof(*c));
|
||||
if (c == NULL) {
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("malloc: out of memory", ""));
|
||||
return ret;
|
||||
}
|
||||
@@ -577,7 +577,7 @@ kcm_get_first (krb5_context context,
|
||||
if (ptr == NULL) {
|
||||
free(c->uuids);
|
||||
free(c);
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
}
|
||||
@@ -637,7 +637,7 @@ kcm_get_next (krb5_context context,
|
||||
return ret;
|
||||
}
|
||||
|
||||
sret = krb5_storage_write(request,
|
||||
sret = krb5_storage_write(request,
|
||||
&c->uuids[c->offset],
|
||||
sizeof(c->uuids[c->offset]));
|
||||
c->offset++;
|
||||
@@ -789,7 +789,7 @@ kcm_get_cache_first(krb5_context context, krb5_cc_cursor *cursor)
|
||||
c = calloc(1, sizeof(*c));
|
||||
if (c == NULL) {
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("malloc: out of memory", ""));
|
||||
goto out;
|
||||
}
|
||||
@@ -820,7 +820,7 @@ kcm_get_cache_first(krb5_context context, krb5_cc_cursor *cursor)
|
||||
ptr = realloc(c->uuids, sizeof(c->uuids[0]) * (c->length + 1));
|
||||
if (ptr == NULL) {
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("malloc: out of memory", ""));
|
||||
goto out;
|
||||
}
|
||||
@@ -837,7 +837,7 @@ kcm_get_cache_first(krb5_context context, krb5_cc_cursor *cursor)
|
||||
if (ret && c) {
|
||||
free(c->uuids);
|
||||
free(c);
|
||||
} else
|
||||
} else
|
||||
*cursor = c;
|
||||
|
||||
return ret;
|
||||
@@ -869,7 +869,7 @@ kcm_get_cache_next(krb5_context context, krb5_cc_cursor cursor, const krb5_cc_op
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
sret = krb5_storage_write(request,
|
||||
sret = krb5_storage_write(request,
|
||||
&c->uuids[c->offset],
|
||||
sizeof(c->uuids[c->offset]));
|
||||
c->offset++;
|
||||
@@ -956,14 +956,14 @@ kcm_move(krb5_context context, krb5_ccache from, krb5_ccache to)
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
kcm_get_default_name(krb5_context context, const krb5_cc_ops *ops,
|
||||
kcm_get_default_name(krb5_context context, const krb5_cc_ops *ops,
|
||||
const char *defstr, char **str)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
krb5_storage *request, *response;
|
||||
krb5_data response_data;
|
||||
char *name;
|
||||
|
||||
|
||||
*str = NULL;
|
||||
|
||||
ret = krb5_kcm_storage_request(context, KCM_OP_GET_DEFAULT_CACHE, &request);
|
||||
@@ -1039,7 +1039,7 @@ kcm_set_kdc_offset(krb5_context context, krb5_ccache id, krb5_deltat kdc_offset)
|
||||
krb5_kcmcache *k = KCMCACHE(id);
|
||||
krb5_error_code ret;
|
||||
krb5_storage *request;
|
||||
|
||||
|
||||
ret = krb5_kcm_storage_request(context, KCM_OP_SET_KDC_OFFSET, &request);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -1069,7 +1069,7 @@ kcm_get_kdc_offset(krb5_context context, krb5_ccache id, krb5_deltat *kdc_offset
|
||||
krb5_storage *request, *response;
|
||||
krb5_data response_data;
|
||||
int32_t offset;
|
||||
|
||||
|
||||
ret = krb5_kcm_storage_request(context, KCM_OP_GET_KDC_OFFSET, &request);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
@@ -131,7 +131,7 @@ krb5_copy_keyblock (krb5_context context,
|
||||
{
|
||||
krb5_error_code ret;
|
||||
krb5_keyblock *k;
|
||||
|
||||
|
||||
*to = NULL;
|
||||
|
||||
k = calloc (1, sizeof(*k));
|
||||
|
@@ -50,7 +50,7 @@
|
||||
*
|
||||
* A keytab name is on the form type:residual. The residual part is
|
||||
* specific to each keytab-type.
|
||||
*
|
||||
*
|
||||
* When a keytab-name is resolved, the type is matched with an internal
|
||||
* list of keytab types. If there is no matching keytab type,
|
||||
* the default keytab is used. The current default type is FILE.
|
||||
@@ -60,7 +60,7 @@
|
||||
* [defaults]default_keytab_name.
|
||||
*
|
||||
* The keytab types that are implemented in Heimdal are:
|
||||
* - file
|
||||
* - file
|
||||
* store the keytab in a file, the type's name is FILE . The
|
||||
* residual part is a filename. For compatibility with other
|
||||
* Kerberos implemtation WRFILE and JAVA14 is also accepted. WRFILE
|
||||
@@ -437,7 +437,7 @@ krb5_kt_get_full_name(krb5_context context,
|
||||
char type[KRB5_KT_PREFIX_MAX_LEN];
|
||||
char name[MAXPATHLEN];
|
||||
krb5_error_code ret;
|
||||
|
||||
|
||||
*str = NULL;
|
||||
|
||||
ret = krb5_kt_get_type(context, keytab, type, sizeof(type));
|
||||
@@ -566,16 +566,16 @@ _krb5_kt_principal_not_found(krb5_context context,
|
||||
{
|
||||
char princ[256], kvno_str[25], *kt_name;
|
||||
char *enctype_str = NULL;
|
||||
|
||||
|
||||
krb5_unparse_name_fixed (context, principal, princ, sizeof(princ));
|
||||
krb5_kt_get_full_name (context, id, &kt_name);
|
||||
krb5_enctype_to_string(context, enctype, &enctype_str);
|
||||
|
||||
|
||||
if (kvno)
|
||||
snprintf(kvno_str, sizeof(kvno_str), "(kvno %d)", kvno);
|
||||
else
|
||||
kvno_str[0] = '\0';
|
||||
|
||||
|
||||
krb5_set_error_message (context, ret,
|
||||
N_("Failed to find %s%s in keytab %s (%s)",
|
||||
"principal, kvno, keytab file, enctype"),
|
||||
|
@@ -536,7 +536,7 @@ fkt_setup_keytab(krb5_context context,
|
||||
id->version = KRB5_KT_VNO;
|
||||
return krb5_store_int8 (sp, id->version);
|
||||
}
|
||||
|
||||
|
||||
static krb5_error_code KRB5_CALLCONV
|
||||
fkt_add_entry(krb5_context context,
|
||||
krb5_keytab id,
|
||||
|
@@ -348,7 +348,7 @@ akf_add_entry(krb5_context context,
|
||||
strerror(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
ret = krb5_ret_int32(sp, &len);
|
||||
if(ret) {
|
||||
krb5_storage_free(sp);
|
||||
@@ -387,7 +387,7 @@ akf_add_entry(krb5_context context,
|
||||
}
|
||||
|
||||
len++;
|
||||
|
||||
|
||||
if(krb5_storage_seek(sp, 0, SEEK_SET) < 0) {
|
||||
ret = errno;
|
||||
krb5_set_error_message (context, ret,
|
||||
@@ -395,7 +395,7 @@ akf_add_entry(krb5_context context,
|
||||
strerror(ret));
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
ret = krb5_store_int32(sp, len);
|
||||
if(ret) {
|
||||
ret = errno;
|
||||
@@ -410,7 +410,7 @@ akf_add_entry(krb5_context context,
|
||||
N_("seek to end: %s", ""), strerror(ret));
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
ret = krb5_store_int32(sp, entry->vno);
|
||||
if(ret) {
|
||||
krb5_set_error_message(context, ret,
|
||||
|
@@ -163,7 +163,7 @@ manual page.
|
||||
.It ...
|
||||
.It Li }
|
||||
.El
|
||||
This is deprecated, see the
|
||||
This is deprecated, see the
|
||||
.Li capaths
|
||||
section below.
|
||||
.It Li default_cc_type = Va cctype
|
||||
@@ -250,7 +250,7 @@ Setting this flag to
|
||||
make it store the MIT way, this is default for Heimdal 0.7.
|
||||
.It Li check-rd-req-server
|
||||
If set to "ignore", the framework will ignore any the server input to
|
||||
.Xr krb5_rd_req 3,
|
||||
.Xr krb5_rd_req 3,
|
||||
this is very useful when the GSS-API server input the
|
||||
wrong server name into the gss_accept_sec_context call.
|
||||
.El
|
||||
@@ -338,7 +338,7 @@ obtain credentials for a service in the
|
||||
.Va server-realm .
|
||||
Secondly, it tells the KDC (and other servers) which realms are
|
||||
allowed in a multi-hop traversal from
|
||||
.Va client-realm
|
||||
.Va client-realm
|
||||
to
|
||||
.Va server-realm .
|
||||
Except for the client case, the order of the realms are not important.
|
||||
|
@@ -185,7 +185,7 @@ decrypts
|
||||
.Fa input
|
||||
and store the data in
|
||||
.Fa output.
|
||||
If
|
||||
If
|
||||
.Fa ivec
|
||||
is
|
||||
.Dv NULL
|
||||
@@ -257,7 +257,7 @@ If some either of
|
||||
.Fa data
|
||||
or
|
||||
.Fa checksum
|
||||
is not needed for the application,
|
||||
is not needed for the application,
|
||||
.Dv NULL
|
||||
can be passed in.
|
||||
.Pp
|
||||
|
@@ -86,7 +86,7 @@ where
|
||||
and
|
||||
.Fa num_realms
|
||||
is the realms between them.
|
||||
If the function returns an error value,
|
||||
If the function returns an error value,
|
||||
.Fa bad_realm
|
||||
will be set to the realm in the list causing the error.
|
||||
.Fn krb5_check_transited
|
||||
|
@@ -217,7 +217,7 @@ and keyblock
|
||||
Note that keyusage is not always used in checksums.
|
||||
.Pp
|
||||
.Nm krb5_checksum_disable
|
||||
globally disables the checksum type.
|
||||
globally disables the checksum type.
|
||||
.\" .Sh EXAMPLE
|
||||
.\" .Sh BUGS
|
||||
.Sh SEE ALSO
|
||||
|
@@ -104,7 +104,7 @@ should be freed by the called with
|
||||
.Fn krb5_free_creds_contents .
|
||||
.Pp
|
||||
.Fn krb5_free_creds
|
||||
frees the content of the
|
||||
frees the content of the
|
||||
.Fa cred
|
||||
structure and the structure itself.
|
||||
.Pp
|
||||
|
@@ -199,7 +199,7 @@ should be the appropriate key-usage.
|
||||
.Fa ivec
|
||||
is a pointer to a initial IV, it is modified to the end IV at the end of
|
||||
the round.
|
||||
Ivec should be the size of
|
||||
Ivec should be the size of
|
||||
If
|
||||
.Dv NULL
|
||||
is passed in, the default IV is used.
|
||||
@@ -229,7 +229,7 @@ and
|
||||
works similarly.
|
||||
.Pp
|
||||
.Fn krb5_decrypt_ticket
|
||||
decrypts the encrypted part of
|
||||
decrypts the encrypted part of
|
||||
.Fa ticket
|
||||
with
|
||||
.Fa key .
|
||||
|
@@ -222,7 +222,7 @@ Getting initial credential ticket for a principal.
|
||||
That may include changing an expired password, and doing preauthentication.
|
||||
This interface that replaces the deprecated
|
||||
.Fa krb5_in_tkt
|
||||
and
|
||||
and
|
||||
.Fa krb5_in_cred
|
||||
functions.
|
||||
.Pp
|
||||
|
@@ -156,7 +156,7 @@ Kerberos 5 Library (libkrb5, -lkrb5)
|
||||
.Fa "const char *filelist"
|
||||
.Fa "char ***pfilenames"
|
||||
.Fc
|
||||
.Ft krb5_error_code
|
||||
.Ft krb5_error_code
|
||||
.Fo krb5_get_default_config_files
|
||||
.Fa "char ***pfilenames"
|
||||
.Fc
|
||||
@@ -211,7 +211,7 @@ libs to
|
||||
This is done by
|
||||
.Fn krb5_init_context .
|
||||
.Pp
|
||||
.Fn krb5_add_et_list
|
||||
.Fn krb5_add_et_list
|
||||
adds a
|
||||
.Xr com_err 3
|
||||
error-code handler
|
||||
@@ -265,7 +265,7 @@ set the list of configuration files to use and re-initialize the
|
||||
configuration from the files.
|
||||
.Pp
|
||||
.Fn krb5_prepend_config_files
|
||||
parse the
|
||||
parse the
|
||||
.Fa filelist
|
||||
and prepend the result to the already existing list
|
||||
.Fa pq
|
||||
@@ -275,7 +275,7 @@ and should be freed with
|
||||
.Fn krb5_free_config_files .
|
||||
.Pp
|
||||
.Fn krb5_prepend_config_files_default
|
||||
parse the
|
||||
parse the
|
||||
.Fa filelist
|
||||
and append that to the default
|
||||
list of configuration files.
|
||||
|
@@ -123,7 +123,7 @@ or
|
||||
.Dv NULL
|
||||
passed in, in that case, it will be allocated and freed internally.
|
||||
.Pp
|
||||
The input data
|
||||
The input data
|
||||
.Fa in_data
|
||||
will have a checksum calculated over it and checksum will be
|
||||
transported in the message to the server.
|
||||
|
@@ -173,7 +173,7 @@ to the string
|
||||
.Fa name
|
||||
should be freed with
|
||||
.Xr free 3 .
|
||||
To the
|
||||
To the
|
||||
.Fa flags
|
||||
argument the following flags can be passed in
|
||||
.Bl -tag -width Ds
|
||||
|
@@ -123,7 +123,7 @@ srv_find_realm(krb5_context context, krb5_krbhst_info ***res, int *count,
|
||||
(*res)[num_srv++] = hi;
|
||||
|
||||
hi->proto = proto_num;
|
||||
|
||||
|
||||
hi->def_port = def_port;
|
||||
if (port != 0)
|
||||
hi->port = port;
|
||||
@@ -134,7 +134,7 @@ srv_find_realm(krb5_context context, krb5_krbhst_info ***res, int *count,
|
||||
}
|
||||
|
||||
*count = num_srv;
|
||||
|
||||
|
||||
rk_dns_free_data(r);
|
||||
return 0;
|
||||
}
|
||||
@@ -508,7 +508,7 @@ fallback_get_hosts(krb5_context context, struct krb5_krbhst_data *kd,
|
||||
ret = asprintf(&host, "%s.%s.", serv_string, kd->realm);
|
||||
else
|
||||
ret = asprintf(&host, "%s-%d.%s.",
|
||||
serv_string, kd->fallback_count, kd->realm);
|
||||
serv_string, kd->fallback_count, kd->realm);
|
||||
|
||||
if (ret < 0 || host == NULL)
|
||||
return ENOMEM;
|
||||
@@ -605,7 +605,7 @@ plugin_get_hosts(krb5_context context,
|
||||
service = _krb5_plugin_get_symbol(e);
|
||||
if (service->minor_version != 0)
|
||||
continue;
|
||||
|
||||
|
||||
(*service->init)(context, &ctx);
|
||||
ret = (*service->lookup)(ctx, type, kd->realm, 0, 0, add_locate, kd);
|
||||
(*service->fini)(ctx);
|
||||
|
@@ -183,7 +183,7 @@ match_local_principals(krb5_context context,
|
||||
ret = krb5_get_default_realms (context, &realms);
|
||||
if (ret)
|
||||
return FALSE;
|
||||
|
||||
|
||||
for (r = realms; *r != NULL; ++r) {
|
||||
if(strcmp(krb5_principal_get_realm(context, principal),
|
||||
*r) != 0)
|
||||
@@ -227,7 +227,7 @@ match_local_principals(krb5_context context,
|
||||
* @param context Kerberos 5 context.
|
||||
* @param principal principal to check if allowed to login
|
||||
* @param luser local user id
|
||||
*
|
||||
*
|
||||
* @return returns TRUE if access should be granted, FALSE otherwise.
|
||||
*
|
||||
* @ingroup krb5_support
|
||||
|
@@ -501,7 +501,7 @@ _krb5_debug(krb5_context context,
|
||||
|
||||
if (context == NULL || context->debug_dest == NULL)
|
||||
return;
|
||||
|
||||
|
||||
va_start(ap, fmt);
|
||||
krb5_vlog(context, context->debug_dest, level, fmt, ap);
|
||||
va_end(ap);
|
||||
|
@@ -220,7 +220,7 @@ mcc_destroy(krb5_context context,
|
||||
l = m->creds;
|
||||
while (l != NULL) {
|
||||
struct link *old;
|
||||
|
||||
|
||||
krb5_free_cred_contents (context, &l->cred);
|
||||
old = l;
|
||||
l = l->next;
|
||||
@@ -347,7 +347,7 @@ mcc_set_flags(krb5_context context,
|
||||
{
|
||||
return 0; /* XXX */
|
||||
}
|
||||
|
||||
|
||||
struct mcache_iter {
|
||||
krb5_mcache *cache;
|
||||
};
|
||||
|
@@ -116,7 +116,7 @@ _krb5_einval(krb5_context context, const char *func, unsigned long argn)
|
||||
#ifndef HEIMDAL_SMALLER
|
||||
krb5_set_error_message(context, EINVAL,
|
||||
N_("programmer error: invalid argument to %s argument %lu",
|
||||
"function:line"),
|
||||
"function:line"),
|
||||
func, argn);
|
||||
if (_krb5_have_debug(context, 10)) {
|
||||
_krb5_debug(context, 10, "invalid argument to function %s argument %lu",
|
||||
|
@@ -224,7 +224,7 @@ krb5_c_decrypt(krb5_context context,
|
||||
krb5_crypto_destroy(context, crypto);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
if (blocksize > ivec->length) {
|
||||
krb5_crypto_destroy(context, crypto);
|
||||
return KRB5_BAD_MSIZE;
|
||||
|
@@ -64,7 +64,7 @@ rr13(unsigned char *buf, size_t len)
|
||||
/* byte offset and shift count */
|
||||
b1 = bb / 8;
|
||||
s1 = bb % 8;
|
||||
|
||||
|
||||
if(bb + 8 > bytes * 8)
|
||||
/* watch for wraparound */
|
||||
s2 = (len + 8 - s1) % 8;
|
||||
|
@@ -74,7 +74,7 @@ krb5_net_write_block(krb5_context context,
|
||||
if (rk_SOCK_ERRNO == EINTR)
|
||||
continue;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_WINSOCK
|
||||
if (ret == 0) {
|
||||
|
@@ -106,7 +106,7 @@ HMAC_MD5_any_checksum(krb5_context context,
|
||||
ret = _krb5_HMAC_MD5_checksum(context, &local_key, data, len, usage, result);
|
||||
if (ret)
|
||||
krb5_data_free(&result->checksum);
|
||||
|
||||
|
||||
krb5_free_keyblock(context, local_key.key);
|
||||
return ret;
|
||||
}
|
||||
|
@@ -300,7 +300,7 @@ cert2epi(hx509_context context, void *ctx, hx509_cert c)
|
||||
IssuerAndSerialNumber iasn;
|
||||
hx509_name issuer;
|
||||
size_t size = 0;
|
||||
|
||||
|
||||
memset(&iasn, 0, sizeof(iasn));
|
||||
|
||||
ret = hx509_cert_get_issuer(c, &issuer);
|
||||
@@ -315,7 +315,7 @@ cert2epi(hx509_context context, void *ctx, hx509_cert c)
|
||||
free_ExternalPrincipalIdentifier(&id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
ret = hx509_cert_get_serialnumber(c, &iasn.serialNumber);
|
||||
if (ret) {
|
||||
free_IssuerAndSerialNumber(&iasn);
|
||||
@@ -434,7 +434,7 @@ build_auth_pack(krb5_context context,
|
||||
ret = _krb5_parse_moduli(context, moduli_file, &ctx->m);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
ctx->u.dh = DH_new();
|
||||
if (ctx->u.dh == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
@@ -484,9 +484,9 @@ build_auth_pack(krb5_context context,
|
||||
&a->clientPublicValue->algorithm.algorithm);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
memset(&dp, 0, sizeof(dp));
|
||||
|
||||
|
||||
ret = BN_to_integer(context, dh->p, &dp.p);
|
||||
if (ret) {
|
||||
free_DomainParameters(&dp);
|
||||
@@ -504,14 +504,14 @@ build_auth_pack(krb5_context context,
|
||||
}
|
||||
dp.j = NULL;
|
||||
dp.validationParms = NULL;
|
||||
|
||||
|
||||
a->clientPublicValue->algorithm.parameters =
|
||||
malloc(sizeof(*a->clientPublicValue->algorithm.parameters));
|
||||
if (a->clientPublicValue->algorithm.parameters == NULL) {
|
||||
free_DomainParameters(&dp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
ASN1_MALLOC_ENCODE(DomainParameters,
|
||||
a->clientPublicValue->algorithm.parameters->data,
|
||||
a->clientPublicValue->algorithm.parameters->length,
|
||||
@@ -521,11 +521,11 @@ build_auth_pack(krb5_context context,
|
||||
return ret;
|
||||
if (size != a->clientPublicValue->algorithm.parameters->length)
|
||||
krb5_abortx(context, "Internal ASN1 encoder error");
|
||||
|
||||
|
||||
ret = BN_to_integer(context, dh->pub_key, &dh_pub_key);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
ASN1_MALLOC_ENCODE(DHPublicKey, dhbuf.data, dhbuf.length,
|
||||
&dh_pub_key, &size, ret);
|
||||
der_free_heim_integer(&dh_pub_key);
|
||||
@@ -558,7 +558,7 @@ build_auth_pack(krb5_context context,
|
||||
return ret;
|
||||
if ((int)size != xlen)
|
||||
krb5_abortx(context, "asn1 internal error");
|
||||
|
||||
|
||||
a->clientPublicValue->algorithm.parameters->data = p;
|
||||
a->clientPublicValue->algorithm.parameters->length = size;
|
||||
|
||||
@@ -602,7 +602,7 @@ build_auth_pack(krb5_context context,
|
||||
a->clientPublicValue->subjectPublicKey.length = dhbuf.length * 8;
|
||||
a->clientPublicValue->subjectPublicKey.data = dhbuf.data;
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
a->supportedCMSTypes = calloc(1, sizeof(*a->supportedCMSTypes));
|
||||
if (a->supportedCMSTypes == NULL)
|
||||
@@ -700,7 +700,7 @@ pk_mk_padata(krb5_context context,
|
||||
oid = &asn1_oid_id_pkcs7_data;
|
||||
} else if (ctx->type == PKINIT_27) {
|
||||
AuthPack ap;
|
||||
|
||||
|
||||
memset(&ap, 0, sizeof(ap));
|
||||
|
||||
ret = build_auth_pack(context, nonce, ctx, req_body, &ap);
|
||||
@@ -757,7 +757,7 @@ pk_mk_padata(krb5_context context,
|
||||
pa_type = KRB5_PADATA_PK_AS_REQ;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.signedAuthPack = buf;
|
||||
req.signedAuthPack = buf;
|
||||
|
||||
if (ctx->trustedCertifiers) {
|
||||
|
||||
@@ -928,7 +928,7 @@ pk_verify_sign(krb5_context context,
|
||||
ret = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
ret = hx509_get_one_cert(context->hx509ctx, signer_certs, &(*signer)->cert);
|
||||
if (ret) {
|
||||
pk_copy_error(context, context->hx509ctx, ret,
|
||||
@@ -1205,9 +1205,9 @@ pk_rd_pa_reply_enckey(krb5_context context,
|
||||
size_t ph = 1 + der_length_len(content.length);
|
||||
unsigned char *ptr = malloc(content.length + ph);
|
||||
size_t l;
|
||||
|
||||
|
||||
memcpy(ptr + ph, content.data, content.length);
|
||||
|
||||
|
||||
ret = der_put_length_and_tag (ptr + ph - 1, ph, content.length,
|
||||
ASN1_C_UNIV, CONS, UT_Sequence, &l);
|
||||
if (ret)
|
||||
@@ -1426,7 +1426,7 @@ pk_rd_pa_reply_dh(krb5_context context,
|
||||
krb5_set_error_message(context, ret, N_("malloc: out of memory", ""));
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
dh_gen_keylen = DH_compute_key(dh_gen_key, kdc_dh_pubkey, ctx->u.dh);
|
||||
if (dh_gen_keylen == -1) {
|
||||
ret = KRB5KRB_ERR_GENERIC;
|
||||
@@ -1490,7 +1490,7 @@ pk_rd_pa_reply_dh(krb5_context context,
|
||||
ret = EINVAL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if (dh_gen_keylen <= 0) {
|
||||
ret = EINVAL;
|
||||
krb5_set_error_message(context, ret,
|
||||
@@ -1557,7 +1557,7 @@ _krb5_pk_rd_pa_reply(krb5_context context,
|
||||
PA_PK_AS_REP rep;
|
||||
heim_octet_string os, data;
|
||||
heim_oid oid;
|
||||
|
||||
|
||||
if (pa->padata_type != KRB5_PADATA_PK_AS_REP) {
|
||||
krb5_set_error_message(context, EINVAL,
|
||||
N_("PKINIT: wrong padata recv", ""));
|
||||
@@ -1587,7 +1587,7 @@ _krb5_pk_rd_pa_reply(krb5_context context,
|
||||
PA_PK_AS_REP_BTMM btmm;
|
||||
free_PA_PK_AS_REP(&rep);
|
||||
memset(&rep, 0, sizeof(rep));
|
||||
|
||||
|
||||
_krb5_debug(context, 5, "krb5_get_init_creds: using BTMM kinit enc reply key");
|
||||
|
||||
ret = decode_PA_PK_AS_REP_BTMM(pa->padata_value.data,
|
||||
@@ -1663,7 +1663,7 @@ _krb5_pk_rd_pa_reply(krb5_context context,
|
||||
#endif
|
||||
|
||||
memset(&w2krep, 0, sizeof(w2krep));
|
||||
|
||||
|
||||
ret = decode_PA_PK_AS_REP_Win2k(pa->padata_value.data,
|
||||
pa->padata_value.length,
|
||||
&w2krep,
|
||||
@@ -1676,12 +1676,12 @@ _krb5_pk_rd_pa_reply(krb5_context context,
|
||||
}
|
||||
|
||||
krb5_clear_error_message(context);
|
||||
|
||||
|
||||
switch (w2krep.element) {
|
||||
case choice_PA_PK_AS_REP_Win2k_encKeyPack: {
|
||||
heim_octet_string data;
|
||||
heim_oid oid;
|
||||
|
||||
|
||||
ret = hx509_cms_unwrap_ContentInfo(&w2krep.u.encKeyPack,
|
||||
&oid, &data, NULL);
|
||||
free_PA_PK_AS_REP_Win2k(&w2krep);
|
||||
@@ -1746,7 +1746,7 @@ hx_pass_prompter(void *data, const hx509_prompt *prompter)
|
||||
default:
|
||||
prompt.type = KRB5_PROMPT_TYPE_PASSWORD;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ret = (*p->prompter)(p->context, p->prompter_data, NULL, NULL, 1, &prompt);
|
||||
if (ret) {
|
||||
@@ -1782,10 +1782,10 @@ _krb5_pk_set_user_id(krb5_context context,
|
||||
"Allocate query to find signing certificate");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
hx509_query_match_option(q, HX509_QUERY_OPTION_PRIVATE_KEY);
|
||||
hx509_query_match_option(q, HX509_QUERY_OPTION_KU_DIGITALSIGNATURE);
|
||||
|
||||
|
||||
if (principal && strncmp("LKDC:SHA1.", krb5_principal_get_realm(context, principal), 9) == 0) {
|
||||
ctx->id->flags |= PKINIT_BTMM;
|
||||
}
|
||||
@@ -1801,7 +1801,7 @@ _krb5_pk_set_user_id(krb5_context context,
|
||||
ret = hx509_cert_get_subject(ctx->id->cert, &name);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
ret = hx509_name_to_string(name, &str);
|
||||
hx509_name_free(&name);
|
||||
if (ret)
|
||||
@@ -1859,7 +1859,7 @@ _krb5_pk_load_id(krb5_context context,
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
if (user_id) {
|
||||
hx509_lock lock;
|
||||
@@ -1869,15 +1869,15 @@ _krb5_pk_load_id(krb5_context context,
|
||||
pk_copy_error(context, context->hx509ctx, ret, "Failed init lock");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
if (password && password[0])
|
||||
hx509_lock_add_password(lock, password);
|
||||
|
||||
|
||||
if (prompter) {
|
||||
p.context = context;
|
||||
p.prompter = prompter;
|
||||
p.prompter_data = prompter_data;
|
||||
|
||||
|
||||
ret = hx509_lock_set_prompter(lock, hx_pass_prompter, &p);
|
||||
if (ret) {
|
||||
hx509_lock_free(lock);
|
||||
@@ -2085,7 +2085,7 @@ _krb5_parse_moduli_line(krb5_context context,
|
||||
"bits on line %d", ""), file, lineno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
ret = parse_integer(context, &p, file, lineno, "p", &m1->p);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -2251,7 +2251,7 @@ _krb5_parse_moduli(krb5_context context, const char *file,
|
||||
return ENOMEM;
|
||||
}
|
||||
m = m2;
|
||||
|
||||
|
||||
m[n] = NULL;
|
||||
|
||||
ret = _krb5_parse_moduli_line(context, file, lineno, buf, &element);
|
||||
@@ -2323,7 +2323,7 @@ _krb5_get_init_creds_opt_free_pkinit(krb5_get_init_creds_opt *opt)
|
||||
break;
|
||||
case USE_RSA:
|
||||
break;
|
||||
case USE_ECDH:
|
||||
case USE_ECDH:
|
||||
#ifdef HAVE_OPENSSL
|
||||
if (ctx->u.eckey)
|
||||
EC_KEY_free(ctx->u.eckey);
|
||||
@@ -2459,7 +2459,7 @@ krb5_get_init_creds_opt_set_pkinit(krb5_context context,
|
||||
krb5_set_error_message(context, EINVAL,
|
||||
N_("No anonymous pkinit support in RSA mode", ""));
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2486,7 +2486,7 @@ krb5_get_init_creds_opt_set_pkinit_user_certs(krb5_context context,
|
||||
N_("PKINIT: on pkinit context", ""));
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
|
||||
_krb5_pk_set_user_id(context, NULL, opt->opt_private->pk_init_ctx, certs);
|
||||
|
||||
return 0;
|
||||
@@ -2519,7 +2519,7 @@ get_ms_san(hx509_context context, hx509_cert cert, char **upn)
|
||||
upn, NULL);
|
||||
else
|
||||
ret = 1;
|
||||
hx509_free_octet_string_list(&list);
|
||||
hx509_free_octet_string_list(&list);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2561,7 +2561,7 @@ krb5_pk_enterprise_cert(krb5_context context,
|
||||
*principal = NULL;
|
||||
if (res)
|
||||
*res = NULL;
|
||||
|
||||
|
||||
if (user_id == NULL) {
|
||||
krb5_set_error_message(context, ENOENT, "no user id");
|
||||
return ENOENT;
|
||||
@@ -2594,7 +2594,7 @@ krb5_pk_enterprise_cert(krb5_context context,
|
||||
"Failed to find PKINIT certificate");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
ret = hx509_get_one_cert(context->hx509ctx, result, &cert);
|
||||
hx509_certs_free(&result);
|
||||
if (ret) {
|
||||
@@ -2621,7 +2621,7 @@ krb5_pk_enterprise_cert(krb5_context context,
|
||||
ret = hx509_certs_init(context->hx509ctx, "MEMORY:", 0, NULL, res);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
ret = hx509_certs_add(context->hx509ctx, *res, cert);
|
||||
if (ret) {
|
||||
hx509_certs_free(res);
|
||||
|
@@ -63,7 +63,7 @@ static HEIMDAL_MUTEX plugin_mutex = HEIMDAL_MUTEX_INITIALIZER;
|
||||
static struct plugin *registered = NULL;
|
||||
static int plugins_needs_scan = 1;
|
||||
|
||||
static const char *sysplugin_dirs[] = {
|
||||
static const char *sysplugin_dirs[] = {
|
||||
LIBDIR "/plugin/krb5",
|
||||
#ifdef __APPLE__
|
||||
"/System/Library/KerberosPlugins/KerberosFrameworkPlugins",
|
||||
@@ -305,7 +305,7 @@ static krb5_error_code
|
||||
add_symbol(krb5_context context, struct krb5_plugin **list, void *symbol)
|
||||
{
|
||||
struct krb5_plugin *e;
|
||||
|
||||
|
||||
e = calloc(1, sizeof(*e));
|
||||
if (e == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
@@ -329,7 +329,7 @@ _krb5_plugin_find(krb5_context context,
|
||||
*list = NULL;
|
||||
|
||||
HEIMDAL_MUTEX_lock(&plugin_mutex);
|
||||
|
||||
|
||||
load_plugins(context);
|
||||
|
||||
for (ret = 0, e = registered; e != NULL; e = e->next) {
|
||||
@@ -379,7 +379,7 @@ _krb5_plugin_free(struct krb5_plugin *list)
|
||||
/*
|
||||
* module - dict of {
|
||||
* ModuleName = [
|
||||
* plugin = object{
|
||||
* plugin = object{
|
||||
* array = { ptr, ctx }
|
||||
* }
|
||||
* ]
|
||||
@@ -556,7 +556,7 @@ search_modules(void *ctx, heim_object_t key, heim_object_t value)
|
||||
return;
|
||||
|
||||
pl = heim_alloc(sizeof(*pl), "struct-plug", plug_free);
|
||||
|
||||
|
||||
cpm = pl->dataptr = dlsym(p->dsohandle, s->name);
|
||||
if (cpm) {
|
||||
int ret;
|
||||
@@ -569,10 +569,10 @@ search_modules(void *ctx, heim_object_t key, heim_object_t value)
|
||||
} else {
|
||||
cpm = pl->dataptr;
|
||||
}
|
||||
|
||||
|
||||
if (cpm && cpm->version >= s->min_version)
|
||||
heim_array_append_value(s->result, pl);
|
||||
|
||||
|
||||
heim_release(pl);
|
||||
}
|
||||
|
||||
@@ -619,11 +619,11 @@ _krb5_plugin_run_f(krb5_context context,
|
||||
s.userctx = userctx;
|
||||
|
||||
heim_dict_iterate_f(dict, search_modules, &s);
|
||||
|
||||
|
||||
heim_release(dict);
|
||||
|
||||
|
||||
HEIMDAL_MUTEX_unlock(&plugin_mutex);
|
||||
|
||||
|
||||
s.ret = KRB5_PLUGIN_NO_HANDLE;
|
||||
|
||||
heim_array_iterate_f(s.result, eval_results, &s);
|
||||
|
@@ -140,7 +140,7 @@ krb5_principal_get_realm(krb5_context context,
|
||||
krb5_const_principal principal)
|
||||
{
|
||||
return princ_realm(principal);
|
||||
}
|
||||
}
|
||||
|
||||
KRB5_LIB_FUNCTION const char* KRB5_LIB_CALL
|
||||
krb5_principal_get_comp_string(krb5_context context,
|
||||
@@ -1028,7 +1028,7 @@ krb5_principal_match(krb5_context context,
|
||||
*
|
||||
* @ingroup krb5_principal
|
||||
*/
|
||||
|
||||
|
||||
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
|
||||
krb5_sname_to_principal (krb5_context context,
|
||||
const char *hostname,
|
||||
@@ -1039,7 +1039,7 @@ krb5_sname_to_principal (krb5_context context,
|
||||
krb5_error_code ret;
|
||||
char localhost[MAXHOSTNAMELEN];
|
||||
char **realms, *host = NULL;
|
||||
|
||||
|
||||
if(type != KRB5_NT_SRV_HST && type != KRB5_NT_UNKNOWN) {
|
||||
krb5_set_error_message(context, KRB5_SNAME_UNSUPP_NAMETYPE,
|
||||
N_("unsupported name type %d", ""),
|
||||
@@ -1053,7 +1053,7 @@ krb5_sname_to_principal (krb5_context context,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("Failed to get local hostname", ""));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
localhost[sizeof(localhost) - 1] = '\0';
|
||||
hostname = localhost;
|
||||
}
|
||||
|
@@ -119,7 +119,7 @@ krb5_rd_cred(krb5_context context,
|
||||
KRB5_KU_KRB_CRED,
|
||||
&cred.enc_part,
|
||||
&enc_krb_cred_part_data);
|
||||
|
||||
|
||||
krb5_crypto_destroy(context, crypto);
|
||||
}
|
||||
|
||||
@@ -135,13 +135,13 @@ krb5_rd_cred(krb5_context context,
|
||||
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
ret = krb5_decrypt_EncryptedData(context,
|
||||
crypto,
|
||||
KRB5_KU_KRB_CRED,
|
||||
&cred.enc_part,
|
||||
&enc_krb_cred_part_data);
|
||||
|
||||
|
||||
krb5_crypto_destroy(context, crypto);
|
||||
}
|
||||
if (ret)
|
||||
@@ -196,7 +196,7 @@ krb5_rd_cred(krb5_context context,
|
||||
auth_context->local_port);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
ret = compare_addrs(context, a, enc_krb_cred_part.r_address,
|
||||
N_("receiver address is wrong "
|
||||
"in received creds", ""));
|
||||
@@ -300,9 +300,9 @@ krb5_rd_cred(krb5_context context,
|
||||
krb5_copy_addresses (context,
|
||||
kci->caddr,
|
||||
&creds->addresses);
|
||||
|
||||
|
||||
(*ret_creds)[i] = creds;
|
||||
|
||||
|
||||
}
|
||||
(*ret_creds)[i] = NULL;
|
||||
|
||||
|
@@ -65,7 +65,7 @@ krb5_rd_rep(krb5_context context,
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = krb5_decrypt_EncryptedData (context,
|
||||
crypto,
|
||||
crypto,
|
||||
KRB5_KU_AP_REQ_ENC_PART,
|
||||
&ap_rep.enc_part,
|
||||
&data);
|
||||
|
@@ -59,7 +59,7 @@ decrypt_tkt_enc_part (krb5_context context,
|
||||
|
||||
ret = decode_EncTicketPart(plain.data, plain.length, decr_part, &len);
|
||||
if (ret)
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("Failed to decode encrypted "
|
||||
"ticket part", ""));
|
||||
krb5_data_free (&plain);
|
||||
@@ -137,7 +137,7 @@ check_transited(krb5_context context, Ticket *ticket, EncTicketPart *enc)
|
||||
char **realms;
|
||||
unsigned int num_realms, n;
|
||||
krb5_error_code ret;
|
||||
|
||||
|
||||
/*
|
||||
* Windows 2000 and 2003 uses this inside their TGT so it's normaly
|
||||
* not seen by others, however, samba4 joined with a Windows AD as
|
||||
@@ -252,7 +252,7 @@ krb5_decrypt_ticket(krb5_context context,
|
||||
krb5_clear_error_message (context);
|
||||
return KRB5KRB_AP_ERR_TKT_EXPIRED;
|
||||
}
|
||||
|
||||
|
||||
if(!t.flags.transited_policy_checked) {
|
||||
ret = check_transited(context, ticket, &t);
|
||||
if(ret) {
|
||||
@@ -404,7 +404,7 @@ krb5_verify_ap_req2(krb5_context context,
|
||||
{
|
||||
krb5_principal p1, p2;
|
||||
krb5_boolean res;
|
||||
|
||||
|
||||
_krb5_principalname2krb5_principal(context,
|
||||
&p1,
|
||||
ac->authenticator->cname,
|
||||
@@ -510,7 +510,7 @@ krb5_verify_ap_req2(krb5_context context,
|
||||
krb5_auth_con_free (context, ac);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
@@ -951,7 +951,7 @@ krb5_rd_req_ctx(krb5_context context,
|
||||
&o->ap_req_options,
|
||||
&o->ticket,
|
||||
KRB5_KU_AP_REQ_AUTH);
|
||||
|
||||
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@@ -974,7 +974,7 @@ krb5_rd_req_ctx(krb5_context context,
|
||||
goto out;
|
||||
|
||||
done = 0;
|
||||
while (!done) {
|
||||
while (!done) {
|
||||
krb5_principal p;
|
||||
|
||||
ret = krb5_kt_next_entry(context, id, &entry, &cursor);
|
||||
@@ -1010,14 +1010,14 @@ krb5_rd_req_ctx(krb5_context context,
|
||||
* and update the service principal in the ticket to match
|
||||
* whatever is in the keytab.
|
||||
*/
|
||||
|
||||
ret = krb5_copy_keyblock(context,
|
||||
|
||||
ret = krb5_copy_keyblock(context,
|
||||
&entry.keyblock,
|
||||
&o->keyblock);
|
||||
if (ret) {
|
||||
krb5_kt_free_entry (context, &entry);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
ret = krb5_copy_principal(context, entry.principal, &p);
|
||||
if (ret) {
|
||||
@@ -1026,7 +1026,7 @@ krb5_rd_req_ctx(krb5_context context,
|
||||
}
|
||||
krb5_free_principal(context, o->ticket->server);
|
||||
o->ticket->server = p;
|
||||
|
||||
|
||||
krb5_kt_free_entry (context, &entry);
|
||||
|
||||
done = 1;
|
||||
@@ -1048,7 +1048,7 @@ krb5_rd_req_ctx(krb5_context context,
|
||||
krb5_data_free(&data);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
ret = krb5_pac_verify(context,
|
||||
pac,
|
||||
o->ticket->ticket.authtime,
|
||||
|
@@ -282,14 +282,14 @@ krb5_rc_get_name(krb5_context context,
|
||||
{
|
||||
return id->name;
|
||||
}
|
||||
|
||||
|
||||
KRB5_LIB_FUNCTION const char* KRB5_LIB_CALL
|
||||
krb5_rc_get_type(krb5_context context,
|
||||
krb5_rcache id)
|
||||
{
|
||||
return "FILE";
|
||||
}
|
||||
|
||||
|
||||
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
|
||||
krb5_get_server_rcache(krb5_context context,
|
||||
const krb5_data *piece,
|
||||
|
@@ -240,7 +240,7 @@ default_db(krb5_context context, sqlite3 **db)
|
||||
krb5_clear_error_message(context);
|
||||
return ENOENT;
|
||||
}
|
||||
|
||||
|
||||
#ifdef TRACEME
|
||||
sqlite3_trace(*db, trace, NULL);
|
||||
#endif
|
||||
@@ -770,7 +770,7 @@ scc_store_cred(krb5_context context,
|
||||
bind_principal(context, s->db, s->iprincipal, 1, creds->server);
|
||||
sqlite3_bind_int(s->iprincipal, 2, 1);
|
||||
sqlite3_bind_int(s->iprincipal, 3, credid);
|
||||
|
||||
|
||||
do {
|
||||
ret = sqlite3_step(s->iprincipal);
|
||||
} while (ret == SQLITE_ROW);
|
||||
@@ -788,7 +788,7 @@ scc_store_cred(krb5_context context,
|
||||
bind_principal(context, s->db, s->iprincipal, 1, creds->client);
|
||||
sqlite3_bind_int(s->iprincipal, 2, 0);
|
||||
sqlite3_bind_int(s->iprincipal, 3, credid);
|
||||
|
||||
|
||||
do {
|
||||
ret = sqlite3_step(s->iprincipal);
|
||||
} while (ret == SQLITE_ROW);
|
||||
@@ -837,7 +837,7 @@ scc_get_principal(krb5_context context,
|
||||
s->name, s->file);
|
||||
return KRB5_CC_END;
|
||||
}
|
||||
|
||||
|
||||
if (sqlite3_column_type(s->scache, 0) != SQLITE_TEXT) {
|
||||
sqlite3_reset(s->scache);
|
||||
krb5_set_error_message(context, KRB5_CC_END,
|
||||
@@ -1103,7 +1103,7 @@ scc_remove_cred(krb5_context context,
|
||||
ret = decode_creds(context, data, len, &creds);
|
||||
if (ret)
|
||||
break;
|
||||
|
||||
|
||||
ret = krb5_compare_creds(context, which, mcreds, &creds);
|
||||
krb5_free_cred_contents(context, &creds);
|
||||
if (ret) {
|
||||
@@ -1144,7 +1144,7 @@ scc_set_flags(krb5_context context,
|
||||
{
|
||||
return 0; /* XXX */
|
||||
}
|
||||
|
||||
|
||||
struct cache_iter {
|
||||
char *drop;
|
||||
sqlite3 *db;
|
||||
@@ -1315,7 +1315,7 @@ scc_move(krb5_context context, krb5_ccache from, krb5_ccache to)
|
||||
|
||||
if (sto->cid != SCACHE_INVALID_CID) {
|
||||
/* drop old cache entry */
|
||||
|
||||
|
||||
sqlite3_bind_int(sfrom->dcache, 1, sto->cid);
|
||||
do {
|
||||
ret = sqlite3_step(sfrom->dcache);
|
||||
|
@@ -268,7 +268,7 @@ send_via_proxy (krb5_context context,
|
||||
int ret;
|
||||
krb5_socket_t s = rk_INVALID_SOCKET;
|
||||
char portstr[NI_MAXSERV];
|
||||
|
||||
|
||||
if (proxy == NULL)
|
||||
return ENOMEM;
|
||||
if (strncmp (proxy, "http://", 7) == 0)
|
||||
@@ -339,7 +339,7 @@ send_via_plugin(krb5_context context,
|
||||
service = _krb5_plugin_get_symbol(e);
|
||||
if (service->minor_version != 0)
|
||||
continue;
|
||||
|
||||
|
||||
(*service->init)(context, &ctx);
|
||||
ret = (*service->send_to_kdc)(context, ctx, hi,
|
||||
timeout, send_data, receive);
|
||||
@@ -366,7 +366,7 @@ send_via_plugin(krb5_context context,
|
||||
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
|
||||
krb5_sendto (krb5_context context,
|
||||
const krb5_data *send_data,
|
||||
krb5_krbhst_handle handle,
|
||||
krb5_krbhst_handle handle,
|
||||
krb5_data *receive)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
@@ -511,7 +511,7 @@ _krb5_copy_send_to_kdc_func(krb5_context context, krb5_context to)
|
||||
{
|
||||
if (context->send_to_kdc)
|
||||
return krb5_set_send_to_kdc_func(to,
|
||||
context->send_to_kdc->func,
|
||||
context->send_to_kdc->func,
|
||||
context->send_to_kdc->data);
|
||||
else
|
||||
return krb5_set_send_to_kdc_func(to, NULL, NULL);
|
||||
|
@@ -71,7 +71,7 @@ main(int argc, char **argv)
|
||||
krb5_storage *sp;
|
||||
krb5_context context;
|
||||
krb5_principal principal;
|
||||
|
||||
|
||||
|
||||
krb5_init_context(&context);
|
||||
|
||||
|
@@ -1398,7 +1398,7 @@ krb5_ret_creds(krb5_storage *sp, krb5_creds *creds)
|
||||
ret = krb5_ret_data (sp, &creds->second_ticket);
|
||||
cleanup:
|
||||
if(ret) {
|
||||
#if 0
|
||||
#if 0
|
||||
krb5_free_cred_contents(context, creds); /* XXX */
|
||||
#endif
|
||||
}
|
||||
@@ -1583,7 +1583,7 @@ krb5_ret_creds_tag(krb5_storage *sp,
|
||||
|
||||
cleanup:
|
||||
if(ret) {
|
||||
#if 0
|
||||
#if 0
|
||||
krb5_free_cred_contents(context, creds); /* XXX */
|
||||
#endif
|
||||
}
|
||||
|
@@ -73,7 +73,7 @@ fd_free(krb5_storage * sp)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @return A krb5_storage on success, or NULL on out of memory error.
|
||||
*
|
||||
|
@@ -70,10 +70,10 @@ test_match_string(krb5_context context)
|
||||
RETVAL(context, ret, 0, "liternal fnmatch");
|
||||
ret = krb5_acl_match_string(context, "foo/bar", "f", "foo/*");
|
||||
RETVAL(context, ret, 0, "foo/*");
|
||||
ret = krb5_acl_match_string(context, "foo/bar.example.org", "f",
|
||||
ret = krb5_acl_match_string(context, "foo/bar.example.org", "f",
|
||||
"foo/*.example.org");
|
||||
RETVAL(context, ret, 0, "foo/*.example.org");
|
||||
ret = krb5_acl_match_string(context, "foo/bar.example.com", "f",
|
||||
ret = krb5_acl_match_string(context, "foo/bar.example.com", "f",
|
||||
"foo/*.example.org");
|
||||
RETVAL(context, ret, EACCES, "foo/*.example.com");
|
||||
|
||||
|
@@ -188,7 +188,7 @@ main(int argc, char **argv)
|
||||
|
||||
if (argc < 3)
|
||||
usage(1);
|
||||
|
||||
|
||||
principal = argv[0];
|
||||
keytab = argv[1];
|
||||
ccache = argv[2];
|
||||
|
@@ -67,7 +67,7 @@ test_default_name(krb5_context context)
|
||||
|
||||
if (strcmp(p1, p2) != 0)
|
||||
krb5_errx (context, 1, "krb5_cc_default_name no longer same");
|
||||
|
||||
|
||||
ret = krb5_cc_set_default_name(context, test_cc_name);
|
||||
if (p == NULL)
|
||||
krb5_errx (context, 1, "krb5_cc_set_default_name 1 failed");
|
||||
@@ -180,7 +180,7 @@ test_init_vs_destroy(krb5_context context, const char *type)
|
||||
krb5_cc_get_type(context, id),
|
||||
krb5_cc_get_name(context, id)) < 0 || n == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
|
||||
|
||||
ret = krb5_cc_resolve(context, n, &id2);
|
||||
free(n);
|
||||
|
@@ -61,15 +61,15 @@ check_config_file(krb5_context context, char *filelist, char **res, int def)
|
||||
if (def) {
|
||||
char **deflist;
|
||||
int j;
|
||||
|
||||
|
||||
ret = krb5_get_default_config_files(&deflist);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "get_default_config_files");
|
||||
|
||||
|
||||
for (j = 0 ; pp[i] && deflist[j]; i++, j++)
|
||||
if (strcmp(pp[i], deflist[j]) != 0)
|
||||
krb5_errx(context, 1, "'%s' != '%s'", pp[i], deflist[j]);
|
||||
|
||||
|
||||
if (deflist[j] != NULL)
|
||||
krb5_errx(context, 1, "pp ended before def list");
|
||||
krb5_free_config_files(deflist);
|
||||
@@ -225,7 +225,7 @@ check_escaped_strings(void)
|
||||
|
||||
if (*s || *e)
|
||||
errx(1, "Configuation string list for value [%s] has incorrect length.",
|
||||
config_strings_tests[i].name);
|
||||
config_strings_tests[i].name);
|
||||
|
||||
krb5_config_free_strings(ps);
|
||||
}
|
||||
|
@@ -127,7 +127,7 @@ test_cf2(krb5_context context)
|
||||
&k2);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_string_to_key_data_salt");
|
||||
|
||||
|
||||
ret = krb5_crypto_init(context, &k2, 0, &c2);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_crypto_init");
|
||||
|
@@ -58,7 +58,7 @@ test_get_init_creds(krb5_context context,
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_get_init_creds_opt_alloc");
|
||||
|
||||
|
||||
|
||||
ret = krb5_get_init_creds_opt_set_process_last_req(context,
|
||||
opt,
|
||||
lr_proc,
|
||||
|
@@ -280,9 +280,9 @@ main(int argc, char **argv)
|
||||
|
||||
test_empty_keytab(context, "MEMORY:foo");
|
||||
test_empty_keytab(context, "FILE:foo");
|
||||
|
||||
|
||||
test_memory_keytab(context, "MEMORY:foo", "MEMORY:foo2");
|
||||
|
||||
|
||||
}
|
||||
|
||||
krb5_free_context(context);
|
||||
|
@@ -99,7 +99,7 @@ static const char *user = "w2003final$";
|
||||
* This pac from Christan Krause
|
||||
*/
|
||||
|
||||
static const unsigned char saved_pac2[] =
|
||||
static const unsigned char saved_pac2[] =
|
||||
"\x05\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\xc8\x01\x00\x00"
|
||||
"\x58\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x18\x00\x00\x00"
|
||||
"\x20\x02\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x70\x00\x00\x00"
|
||||
@@ -170,10 +170,10 @@ main(int argc, char **argv)
|
||||
ret = krb5_init_context(&context);
|
||||
if (ret)
|
||||
errx(1, "krb5_init_contex");
|
||||
|
||||
|
||||
krb5_enctype_enable(context, ETYPE_DES_CBC_MD5);
|
||||
|
||||
ret = krb5_parse_name_flags(context, user,
|
||||
ret = krb5_parse_name_flags(context, user,
|
||||
KRB5_PRINCIPAL_PARSE_NO_REALM, &p);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_parse_name");
|
||||
@@ -242,24 +242,24 @@ main(int argc, char **argv)
|
||||
krb5_data_free(&data);
|
||||
}
|
||||
free(list);
|
||||
|
||||
|
||||
ret = _krb5_pac_sign(context, pac2, authtime, p,
|
||||
&member_keyblock, &kdc_keyblock, &data);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "_krb5_pac_sign 4");
|
||||
|
||||
|
||||
krb5_pac_free(context, pac2);
|
||||
|
||||
ret = krb5_pac_parse(context, data.data, data.length, &pac2);
|
||||
krb5_data_free(&data);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_pac_parse 4");
|
||||
|
||||
|
||||
ret = krb5_pac_verify(context, pac2, authtime, p,
|
||||
&member_keyblock, &kdc_keyblock);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_pac_verify 4");
|
||||
|
||||
|
||||
krb5_pac_free(context, pac2);
|
||||
}
|
||||
|
||||
|
@@ -213,7 +213,7 @@ fooTicket(void)
|
||||
ASN1_MALLOC_ENCODE(Ticket, data.data, data.length, &t, &size, ret);
|
||||
if (ret)
|
||||
errx(1, "ASN1_MALLOC_ENCODE(Ticket)");
|
||||
|
||||
|
||||
rk_dumpdata("foo", data.data, data.length);
|
||||
free(data.data);
|
||||
}
|
||||
|
@@ -96,7 +96,7 @@ main(int argc, char **argv)
|
||||
if (ret)
|
||||
errx(1, "krb5_init_contex");
|
||||
|
||||
ret = krb5_plugin_register(context, PLUGIN_TYPE_DATA,
|
||||
ret = krb5_plugin_register(context, PLUGIN_TYPE_DATA,
|
||||
KRB5_PLUGIN_LOCATE, &resolve);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_plugin_register");
|
||||
|
@@ -203,14 +203,14 @@ test_truncate(krb5_context context, krb5_storage *sp, int fd)
|
||||
|
||||
krb5_store_string(sp, "hej");
|
||||
krb5_storage_truncate(sp, 2);
|
||||
|
||||
|
||||
if (fstat(fd, &sb) != 0)
|
||||
krb5_err(context, 1, errno, "fstat");
|
||||
if (sb.st_size != 2)
|
||||
krb5_errx(context, 1, "length not 2");
|
||||
|
||||
krb5_storage_truncate(sp, 1024);
|
||||
|
||||
|
||||
if (fstat(fd, &sb) != 0)
|
||||
krb5_err(context, 1, errno, "fstat");
|
||||
if (sb.st_size != 1024)
|
||||
|
@@ -54,7 +54,7 @@ check_linear(krb5_context context,
|
||||
krb5_data_zero(&tr);
|
||||
|
||||
va_start(va, realm);
|
||||
|
||||
|
||||
while (realm) {
|
||||
inrealms = erealloc(inrealms, (num_inrealms + 2) * sizeof(inrealms[0]));
|
||||
inrealms[num_inrealms] = rk_UNCONST(realm);
|
||||
|
@@ -639,7 +639,7 @@ decrypt_tkt (krb5_context context,
|
||||
&size);
|
||||
krb5_data_free (&data);
|
||||
if (ret) {
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("Failed to decode encpart in ticket", ""));
|
||||
return ret;
|
||||
}
|
||||
@@ -828,7 +828,7 @@ _krb5_extract_ticket(krb5_context context,
|
||||
creds->addresses.val = NULL;
|
||||
}
|
||||
creds->flags.b = rep->enc_part.flags;
|
||||
|
||||
|
||||
creds->authdata.len = 0;
|
||||
creds->authdata.val = NULL;
|
||||
|
||||
|
@@ -55,7 +55,7 @@ free_realms(struct tr_realm *r)
|
||||
r = r->next;
|
||||
free(p->realm);
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -71,7 +71,7 @@ make_path(krb5_context context, struct tr_realm *r,
|
||||
from = to;
|
||||
to = str;
|
||||
}
|
||||
|
||||
|
||||
if(strcmp(from + strlen(from) - strlen(to), to) == 0){
|
||||
p = from;
|
||||
while(1){
|
||||
|
@@ -199,11 +199,11 @@ cleanup:
|
||||
|
||||
/**
|
||||
* Validate the newly fetch credential, see also krb5_verify_init_creds().
|
||||
*
|
||||
*
|
||||
* @param context a Kerberos 5 context
|
||||
* @param creds the credentials to verify
|
||||
* @param client the client name to match up
|
||||
* @param ccache the credential cache to use
|
||||
* @param ccache the credential cache to use
|
||||
* @param service a service name to use, used with
|
||||
* krb5_sname_to_principal() to build a hostname to use to
|
||||
* verify.
|
||||
@@ -229,7 +229,7 @@ krb5_get_validated_creds(krb5_context context,
|
||||
return KRB5_PRINC_NOMATCH;
|
||||
}
|
||||
|
||||
ret = krb5_sname_to_principal (context, NULL, service,
|
||||
ret = krb5_sname_to_principal (context, NULL, service,
|
||||
KRB5_NT_SRV_HST, &server);
|
||||
if(ret)
|
||||
return ret;
|
||||
|
@@ -195,7 +195,7 @@ krb5_verify_user_opt(krb5_context context,
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = KRB5_CONFIG_NODEFREALM;
|
||||
|
||||
|
||||
for (r = realms; *r != NULL && ret != 0; ++r) {
|
||||
ret = krb5_principal_set_realm(context, principal, *r);
|
||||
if (ret) {
|
||||
|
@@ -37,7 +37,7 @@
|
||||
static krb5_error_code _warnerr(krb5_context context, int do_errtext,
|
||||
krb5_error_code code, int level, const char *fmt, va_list ap)
|
||||
__attribute__((__format__(__printf__, 5, 0)));
|
||||
|
||||
|
||||
static krb5_error_code
|
||||
_warnerr(krb5_context context, int do_errtext,
|
||||
krb5_error_code code, int level, const char *fmt, va_list ap)
|
||||
@@ -69,7 +69,7 @@ _warnerr(krb5_context context, int do_errtext,
|
||||
*arg= "<unknown error>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(context && context->warn_dest)
|
||||
krb5_log(context, context->warn_dest, level, xfmt, args[0], args[1]);
|
||||
else
|
||||
|
Reference in New Issue
Block a user