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