Skip to content

Commit

Permalink
Fix decoding of mkey kvno in mkey_aux tl-data
Browse files Browse the repository at this point in the history
krb5_dbe_lookup_mkey_aux was decoding a 16-bit value directly into an
int, resulting in the wrong value on big-endian platforms.  The
consequences are mostly invisible because we ignore this field and try
all mkey_aux nodes in krb5_def_fetch_mkey_list.

(cherry picked from commit 64ec294)

ticket: 7738
version_fixed: 1.12
status: resolved
  • Loading branch information
greghudson authored and tlyu committed Oct 30, 2013
1 parent fe82fb9 commit 79e91cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/kdb/kdb5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ krb5_dbe_lookup_mkey_aux(krb5_context context, krb5_db_entry *entry,
krb5_mkey_aux_node **mkey_aux_data_list)
{
krb5_tl_data tl_data;
krb5_int16 version;
krb5_int16 version, mkey_kvno;
krb5_mkey_aux_node *head_data = NULL, *new_data = NULL,
*prev_data = NULL;
krb5_octet *curloc; /* current location pointer */
Expand Down Expand Up @@ -1661,7 +1661,8 @@ krb5_dbe_lookup_mkey_aux(krb5_context context, krb5_db_entry *entry,
}
memset(new_data, 0, sizeof(krb5_mkey_aux_node));

krb5_kdb_decode_int16(curloc, new_data->mkey_kvno);
krb5_kdb_decode_int16(curloc, mkey_kvno);
new_data->mkey_kvno = mkey_kvno;
curloc += sizeof(krb5_ui_2);
krb5_kdb_decode_int16(curloc, new_data->latest_mkey.key_data_kvno);
curloc += sizeof(krb5_ui_2);
Expand Down

0 comments on commit 79e91cf

Please sign in to comment.