krb5 commit: Fix sam2 client preauth after salt changes

Greg Hudson ghudson at MIT.EDU
Thu Oct 18 13:39:23 EDT 2012


https://github.com/krb5/krb5/commit/787cc1e24117e57a9173aaaa16935f6488eb3fec
commit 787cc1e24117e57a9173aaaa16935f6488eb3fec
Author: Greg Hudson <ghudson at mit.edu>
Date:   Thu Oct 18 13:11:28 2012 -0400

    Fix sam2 client preauth after salt changes
    
    Commit bc096a77ffdab283d77c2e0fc1fdd15b9f77eb41 altered the internal
    contracts relating to salts, but neglected to adjust the sam2 preauth
    code to match.  Do that now.
    
    ticket: 7415 (new)
    target_version: 1.11
    tags: pullup

 src/lib/krb5/krb/preauth_sam2.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/krb5/krb/preauth_sam2.c b/src/lib/krb5/krb/preauth_sam2.c
index a5f6395..2280207 100644
--- a/src/lib/krb5/krb/preauth_sam2.c
+++ b/src/lib/krb5/krb/preauth_sam2.c
@@ -153,6 +153,7 @@ sam2_process(krb5_context context, krb5_clpreauth_moddata moddata,
         /* Go ahead and get it now, preserving the ordering of  */
         /* prompts for the user.                                */
 
+        salt = (*rock->default_salt) ? NULL : rock->salt;
         retval = (*rock->gak_fct)(context, request->client, sc2b->sam_etype,
                                   prompter, prompter_data, rock->salt,
                                   rock->s2kparams, rock->as_key,
@@ -199,8 +200,7 @@ sam2_process(krb5_context context, krb5_clpreauth_moddata moddata,
     krb5int_set_prompt_types(context, (krb5_prompt_type *)NULL);
 
     /* Generate salt used by string_to_key() */
-    salt = rock->salt;
-    if (((int) salt->length == -1) && (salt->data == NULL)) {
+    if (*rock->default_salt) {
         if ((retval =
              krb5_principal2salt(context, request->client, &defsalt))) {
             krb5_free_sam_challenge_2(context, sc2);
@@ -209,6 +209,7 @@ sam2_process(krb5_context context, krb5_clpreauth_moddata moddata,
         }
         salt = &defsalt;
     } else {
+        salt = rock->salt;
         defsalt.length = 0;
     }
 


More information about the cvs-krb5 mailing list