diff --git a/lib/krb5/auth_context.c b/lib/krb5/auth_context.c index ec5dd2b38..346f8941c 100644 --- a/lib/krb5/auth_context.c +++ b/lib/krb5/auth_context.c @@ -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 diff --git a/lib/krb5/decrypt.c b/lib/krb5/decrypt.c index 46252d022..234cdd01e 100644 --- a/lib/krb5/decrypt.c +++ b/lib/krb5/decrypt.c @@ -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); diff --git a/lib/krb5/generate_seq_number.c b/lib/krb5/generate_seq_number.c index e84f7af80..b018f0802 100644 --- a/lib/krb5/generate_seq_number.c +++ b/lib/krb5/generate_seq_number.c @@ -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) diff --git a/lib/krb5/generate_subkey.c b/lib/krb5/generate_subkey.c index 8b56c595f..7c0060bfb 100644 --- a/lib/krb5/generate_subkey.c +++ b/lib/krb5/generate_subkey.c @@ -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; } diff --git a/lib/krb5/get_in_tkt.c b/lib/krb5/get_in_tkt.c index c18ebfa5f..bf0c0b23f 100644 --- a/lib/krb5/get_in_tkt.c +++ b/lib/krb5/get_in_tkt.c @@ -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; diff --git a/lib/krb5/get_in_tkt_pw.c b/lib/krb5/get_in_tkt_pw.c index 8b687f9e1..e35c7fae4 100644 --- a/lib/krb5/get_in_tkt_pw.c +++ b/lib/krb5/get_in_tkt_pw.c @@ -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; diff --git a/lib/krb5/mk_req_ext.c b/lib/krb5/mk_req_ext.c index e9d1aff20..a8fbba650 100644 --- a/lib/krb5/mk_req_ext.c +++ b/lib/krb5/mk_req_ext.c @@ -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, diff --git a/lib/krb5/rd_req.c b/lib/krb5/rd_req.c index b954baf2d..481003d91 100644 --- a/lib/krb5/rd_req.c +++ b/lib/krb5/rd_req.c @@ -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);