Skip to content

Commit

Permalink
Reset key-generation parameters for each enctype
Browse files Browse the repository at this point in the history
In add_key_pwd, initialize s2k_params to NULL inside the loop over
enctypes instead of outside the loop, so that if the afs3 salt type
is used it does not contaminate later enctype/salt pairs in the list.

ticket: 7733
tags: pullup
target_version: 1.12
  • Loading branch information
kaduk committed Oct 25, 2013
1 parent 0db3c9a commit 381cf01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/kdb/kdb_cpw.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, passwd,
krb5_keysalt key_salt;
krb5_keyblock key;
krb5_data pwd;
krb5_data afs_params = string2data("\1"), *s2k_params = NULL;
krb5_data afs_params = string2data("\1"), *s2k_params;
int i, j, k;
krb5_key_data tmp_key_data;
krb5_key_data *tptr;
Expand All @@ -402,6 +402,7 @@ add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, passwd,
krb5_boolean similar;

similar = 0;
s2k_params = NULL;

/*
* We could use krb5_keysalt_iterate to replace this loop, or use
Expand Down

0 comments on commit 381cf01

Please sign in to comment.