]> git.ipfire.org Git - thirdparty/krb5.git/commit
Simplify SAM-2 as_key handling 924/head
authorGreg Hudson <ghudson@mit.edu>
Sun, 5 May 2019 22:53:27 +0000 (18:53 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 6 May 2019 19:18:42 +0000 (15:18 -0400)
commitd48670c51460e9a74b4f4a9966f85ca6f77c1d8b
tree04bfb9fcfc523b1fb30f752c02e319c4d47169ed
parent4ded6dbc23d27068567943bccf4d2d986b6f7d08
Simplify SAM-2 as_key handling

The ctx->gak_fct() call in sam2_process() used an empty salt instead
of the default salt when the KDC did not supply an explicit salt.
This bug arose when commit bc096a77ffdab283d77c2e0fc1fdd15b9f77eb41
changed the internal contracts around salts but did not adjust the
SAM-2 code.  Commit e9aa891fcdb4c08d39902ab89afb268042b60c86 fixed the
resulting bug, but mistakenly did not adjust the gak_fct call to use
the correct salt.

Later on, the code contains a redundant call to krb5_c_string_to_key()
in the non-USE_SAD_AS_KEY modes, replacing ctx->as_key.  This call was
properly adjusted by commit e9aa891fcdb4c08d39902ab89afb268042b60c86,
so the improper gak_fct call did not manifest as a bug.

Fix the gak_fct call to supply the correct salt, and remove the
redundant string_to_key operation.
src/lib/krb5/krb/preauth_sam2.c