Rename contents to keyvalue.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1888 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -121,10 +121,10 @@ krb5_auth_con_getkey(krb5_context context,
|
||||
if (*keyblock == NULL)
|
||||
return ENOMEM;
|
||||
(*keyblock)->keytype = auth_context->key.keytype;
|
||||
(*keyblock)->contents.length = 0;
|
||||
return krb5_data_copy (&(*keyblock)->contents,
|
||||
auth_context->key.contents.data,
|
||||
auth_context->key.contents.length);
|
||||
(*keyblock)->keyvalue.length = 0;
|
||||
return krb5_data_copy (&(*keyblock)->keyvalue,
|
||||
auth_context->key.keyvalue.data,
|
||||
auth_context->key.keyvalue.length);
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
@@ -136,10 +136,10 @@ krb5_auth_con_getlocalsubkey(krb5_context context,
|
||||
if (*keyblock == NULL)
|
||||
return ENOMEM;
|
||||
(*keyblock)->keytype = auth_context->local_subkey.keytype;
|
||||
(*keyblock)->contents.length = 0;
|
||||
return krb5_data_copy (&(*keyblock)->contents,
|
||||
auth_context->local_subkey.contents.data,
|
||||
auth_context->local_subkey.contents.length);
|
||||
(*keyblock)->keyvalue.length = 0;
|
||||
return krb5_data_copy (&(*keyblock)->keyvalue,
|
||||
auth_context->local_subkey.keyvalue.data,
|
||||
auth_context->local_subkey.keyvalue.length);
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
@@ -151,18 +151,18 @@ krb5_auth_con_getremotesubkey(krb5_context context,
|
||||
if (*keyblock == NULL)
|
||||
return ENOMEM;
|
||||
(*keyblock)->keytype = auth_context->remote_subkey.keytype;
|
||||
(*keyblock)->contents.length = 0;
|
||||
return krb5_data_copy (&(*keyblock)->contents,
|
||||
auth_context->remote_subkey.contents.data,
|
||||
auth_context->remote_subkey.contents.length);
|
||||
(*keyblock)->keyvalue.length = 0;
|
||||
return krb5_data_copy (&(*keyblock)->keyvalue,
|
||||
auth_context->remote_subkey.keyvalue.data,
|
||||
auth_context->remote_subkey.keyvalue.length);
|
||||
}
|
||||
|
||||
void
|
||||
krb5_free_keyblock(krb5_context context,
|
||||
krb5_keyblock *keyblock)
|
||||
{
|
||||
memset(keyblock->contents.data, 0, keyblock->contents.length);
|
||||
krb5_data_free (&keyblock->contents);
|
||||
memset(keyblock->keyvalue.data, 0, keyblock->keyvalue.length);
|
||||
krb5_data_free (&keyblock->keyvalue);
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
|
@@ -15,7 +15,7 @@ krb5_decrypt (krb5_context context,
|
||||
des_cblock key;
|
||||
des_key_schedule schedule;
|
||||
|
||||
memcpy (&key, keyblock->contents.data, sizeof(key));
|
||||
memcpy (&key, keyblock->keyvalue.data, sizeof(key));
|
||||
des_set_key (&key, schedule);
|
||||
des_cbc_encrypt ((des_cblock *)ptr, (des_cblock *)ptr, len,
|
||||
schedule, &key, DES_DECRYPT);
|
||||
|
@@ -14,7 +14,7 @@ krb5_generate_seq_number(krb5_context context,
|
||||
|
||||
if (key->keytype != KEYTYPE_DES)
|
||||
abort ();
|
||||
memmove (c, key->contents.data, sizeof(c));
|
||||
memmove (c, key->keyvalue.data, sizeof(c));
|
||||
des_new_random_key(&c);
|
||||
q = 0;
|
||||
for (p = (u_char *)c, i = 0; i < sizeof(c); ++i, ++p)
|
||||
|
@@ -16,15 +16,15 @@ krb5_generate_subkey(krb5_context context,
|
||||
if (k == NULL)
|
||||
return ENOMEM;
|
||||
k->keytype = key->keytype;
|
||||
k->contents.length = 0;
|
||||
ret = krb5_data_copy (&k->contents,
|
||||
key->contents.data,
|
||||
key->contents.length);
|
||||
k->keyvalue.length = 0;
|
||||
ret = krb5_data_copy (&k->keyvalue,
|
||||
key->keyvalue.data,
|
||||
key->keyvalue.length);
|
||||
if (ret) {
|
||||
free(k);
|
||||
return ret;
|
||||
}
|
||||
des_new_random_key ((des_cblock *)k->contents.data);
|
||||
des_new_random_key ((des_cblock *)k->keyvalue.data);
|
||||
*subkey = k;
|
||||
return 0;
|
||||
}
|
||||
|
@@ -67,8 +67,8 @@ extract_ticket(krb5_context context,
|
||||
err = (*decrypt_proc)(context, key, decryptarg, rep);
|
||||
if (err)
|
||||
return err;
|
||||
memset (key->contents.data, 0, key->contents.length);
|
||||
krb5_data_free (&key->contents);
|
||||
memset (key->keyvalue.data, 0, key->keyvalue.length);
|
||||
krb5_data_free (&key->keyvalue);
|
||||
free (key);
|
||||
|
||||
principalname2krb5_principal(&creds->server,
|
||||
@@ -111,10 +111,10 @@ extract_ticket(krb5_context context,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
creds->session.contents.length = 0;
|
||||
creds->session.contents.data = NULL;
|
||||
creds->session.keyvalue.length = 0;
|
||||
creds->session.keyvalue.data = NULL;
|
||||
creds->session.keytype = rep->part2.key.keytype;
|
||||
err = krb5_data_copy (&creds->session.contents,
|
||||
err = krb5_data_copy (&creds->session.keyvalue,
|
||||
rep->part2.key.keyvalue.data,
|
||||
rep->part2.key.keyvalue.length);
|
||||
memset (rep->part2.key.keyvalue.data, 0,
|
||||
@@ -161,10 +161,14 @@ krb5_get_in_tkt(krb5_context context,
|
||||
a.req_body.sname = malloc(sizeof(*a.req_body.sname));
|
||||
krb5_principal2principalname (a.req_body.cname, creds->client);
|
||||
krb5_principal2principalname (a.req_body.sname, creds->server);
|
||||
#ifdef USE_ASN1_PRINCIPAL
|
||||
copy_Realm(&creds->client->realm, &a.req_body.realm);
|
||||
#else
|
||||
a.req_body.realm = malloc(creds->client->realm.length + 1);
|
||||
strncpy (a.req_body.realm, creds->client->realm.data,
|
||||
creds->client->realm.length);
|
||||
a.req_body.realm[creds->client->realm.length] = '\0';
|
||||
#endif
|
||||
|
||||
a.req_body.till = creds->times.endtime;
|
||||
a.req_body.nonce = 17;
|
||||
|
@@ -17,8 +17,8 @@ key_proc (krb5_context context,
|
||||
if (*key == NULL)
|
||||
return ENOMEM;
|
||||
(*key)->keytype = type;
|
||||
(*key)->contents.length = 0;
|
||||
(*key)->contents.data = NULL;
|
||||
(*key)->keyvalue.length = 0;
|
||||
(*key)->keyvalue.data = NULL;
|
||||
if (password == NULL) {
|
||||
des_read_pw_string (buf, sizeof(buf), "Password: ", 0);
|
||||
password = buf;
|
||||
|
@@ -22,9 +22,9 @@ krb5_mk_req_extended(krb5_context context,
|
||||
}
|
||||
|
||||
(*auth_context)->key.keytype = in_creds->session.keytype;
|
||||
krb5_data_copy (&(*auth_context)->key.contents,
|
||||
in_creds->session.contents.data,
|
||||
in_creds->session.contents.length);
|
||||
krb5_data_copy (&(*auth_context)->key.keyvalue,
|
||||
in_creds->session.keyvalue.data,
|
||||
in_creds->session.keyvalue.length);
|
||||
|
||||
r = krb5_create_checksum (context,
|
||||
CKSUMTYPE_RSA_MD4,
|
||||
|
@@ -96,7 +96,7 @@ krb5_rd_req_with_keyblock(krb5_context context,
|
||||
/* save key */
|
||||
|
||||
(*auth_context)->key.keytype = t->tkt.key.keytype;
|
||||
krb5_data_copy(&(*auth_context)->key.contents,
|
||||
krb5_data_copy(&(*auth_context)->key.keyvalue,
|
||||
t->tkt.key.keyvalue.data,
|
||||
t->tkt.key.keyvalue.length);
|
||||
|
||||
|
Reference in New Issue
Block a user