Make authcontext->keyblock a pointer.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3916 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1997-11-11 01:51:35 +00:00
parent b0f33bd5de
commit fb0f4ca9c3
8 changed files with 19 additions and 20 deletions

View File

@@ -66,7 +66,7 @@ krb5_mk_priv(krb5_context context,
else if (auth_context->remote_subkey.keytype) else if (auth_context->remote_subkey.keytype)
key = &auth_context->remote_subkey; key = &auth_context->remote_subkey;
else else
key = &auth_context->key; key = auth_context->keyblock;
if (auth_context->enctype) if (auth_context->enctype)
enctype = auth_context->enctype; enctype = auth_context->enctype;

View File

@@ -59,19 +59,19 @@ krb5_mk_rep(krb5_context context,
body.subkey = NULL; body.subkey = NULL;
if ((*auth_context)->flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) { if ((*auth_context)->flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) {
krb5_generate_seq_number (context, krb5_generate_seq_number (context,
&(*auth_context)->key, (*auth_context)->keyblock,
&(*auth_context)->local_seqnumber); &(*auth_context)->local_seqnumber);
body.seq_number = malloc (sizeof(*body.seq_number)); body.seq_number = malloc (sizeof(*body.seq_number));
*(body.seq_number) = (*auth_context)->local_seqnumber; *(body.seq_number) = (*auth_context)->local_seqnumber;
} else } else
body.seq_number = NULL; body.seq_number = NULL;
ap.enc_part.etype = (*auth_context)->key.keytype; ap.enc_part.etype = (*auth_context)->keyblock->keytype;
ap.enc_part.kvno = NULL; ap.enc_part.kvno = NULL;
encode_EncAPRepPart (buf + sizeof(buf) - 1, sizeof(buf), &body, &len); encode_EncAPRepPart (buf + sizeof(buf) - 1, sizeof(buf), &body, &len);
ret = krb5_encrypt (context, buf + sizeof(buf) - len, len, ret = krb5_encrypt (context, buf + sizeof(buf) - len, len,
ap.enc_part.etype, ap.enc_part.etype,
&(*auth_context)->key, &ap.enc_part.cipher); (*auth_context)->keyblock, &ap.enc_part.cipher);
if (ret) if (ret)
return ret; return ret;

View File

@@ -66,21 +66,20 @@ krb5_mk_req_extended(krb5_context context,
if(r) if(r)
return r; return r;
free_EncryptionKey (&ac->key); krb5_free_keyblock(context, ac->keyblock);
copy_EncryptionKey (&in_creds->session, krb5_copy_keyblock(context, &in_creds->session, &ac->keyblock);
&ac->key);
if (ac->cksumtype) if (ac->cksumtype)
cksumtype = ac->cksumtype; cksumtype = ac->cksumtype;
else else
krb5_keytype_to_cksumtype (context, ac->key.keytype, &cksumtype); krb5_keytype_to_cksumtype (context, ac->keyblock->keytype, &cksumtype);
if (in_data) { if (in_data) {
r = krb5_create_checksum (context, r = krb5_create_checksum (context,
cksumtype, cksumtype,
in_data->data, in_data->data,
in_data->length, in_data->length,
&ac->key, ac->keyblock,
&c); &c);
c_opt = &c; c_opt = &c;
} else { } else {

View File

@@ -61,7 +61,7 @@ krb5_mk_safe(krb5_context context,
cksumtype = auth_context->cksumtype; cksumtype = auth_context->cksumtype;
else { else {
r = krb5_keytype_to_cksumtype (context, r = krb5_keytype_to_cksumtype (context,
auth_context->key.keytype, auth_context->keyblock->keytype,
&cksumtype); &cksumtype);
if (r) if (r)
return r; return r;
@@ -102,7 +102,7 @@ krb5_mk_safe(krb5_context context,
cksumtype, cksumtype,
buf + sizeof(buf) - len, buf + sizeof(buf) - len,
len, len,
&auth_context->key, auth_context->keyblock,
&s.cksum); &s.cksum);
if (r) if (r)
return r; return r;

View File

@@ -73,7 +73,7 @@ krb5_rd_priv(krb5_context context,
else if (auth_context->remote_subkey.keytype) else if (auth_context->remote_subkey.keytype)
key = &auth_context->remote_subkey; key = &auth_context->remote_subkey;
else else
key = &auth_context->key; key = auth_context->keyblock;
r = krb5_decrypt (context, r = krb5_decrypt (context,
priv.enc_part.cipher.data, priv.enc_part.cipher.data,

View File

@@ -70,7 +70,7 @@ krb5_rd_rep(krb5_context context,
ap_rep.enc_part.cipher.data, ap_rep.enc_part.cipher.data,
ap_rep.enc_part.cipher.length, ap_rep.enc_part.cipher.length,
ap_rep.enc_part.etype, ap_rep.enc_part.etype,
&auth_context->key, auth_context->keyblock,
&data); &data);
if (ret) if (ret)
goto out; goto out;

View File

@@ -169,12 +169,12 @@ krb5_verify_ap_req(krb5_context context,
}else }else
krb5_auth_con_init(context, &ac); krb5_auth_con_init(context, &ac);
if (ap_req->ap_options.use_session_key && auth_context->keyblock){ if (ap_req->ap_options.use_session_key && ac->keyblock){
ret = krb5_decrypt_ticket(context, &ap_req->ticket, ret = krb5_decrypt_ticket(context, &ap_req->ticket,
auth_context->keyblock, ac->keyblock,
&t.ticket); &t.ticket);
krb5_free_keyblock(context, auth_context->keyblock); krb5_free_keyblock(context, ac->keyblock);
auth_context->keyblock = NULL; ac->keyblock = NULL;
}else }else
ret = krb5_decrypt_ticket(context, &ap_req->ticket, ret = krb5_decrypt_ticket(context, &ap_req->ticket,
keyblock, keyblock,
@@ -192,7 +192,7 @@ krb5_verify_ap_req(krb5_context context,
/* save key */ /* save key */
copy_EncryptionKey(&t.ticket.key, &ac->key); krb5_copy_keyblock(context, &t.ticket.key, &ac->keyblock);
ret = decrypt_authenticator (context, ret = decrypt_authenticator (context,
&t.ticket.key, &t.ticket.key,

View File

@@ -133,7 +133,7 @@ krb5_rd_safe(krb5_context context,
r = krb5_verify_checksum (context, r = krb5_verify_checksum (context,
buf + sizeof(buf) - len, buf + sizeof(buf) - len,
len, len,
&auth_context->key, auth_context->keyblock,
&c); &c);
free_Checksum (&c); free_Checksum (&c);
if (r) if (r)