• Chuck Lever's avatar
    SUNRPC: Hoist KDF into struct gss_krb5_enctype · 2691a27d
    Chuck Lever authored
    Each Kerberos enctype can have a different KDF. Refactor the key
    derivation path to support different KDFs for the enctypes
    introduced in subsequent patches.
    
    In particular, expose the key derivation function in struct
    gss_krb5_enctype instead of the enctype's preferred random-to-key
    function. The latter is usually the identity function and is only
    ever called during key derivation, so have each KDF call it
    directly.
    
    A couple of extra clean-ups:
    - Deduplicate the set_cdata() helper
    - Have ->derive_key return negative errnos, in accordance with usual
      kernel coding conventions
    
    This patch is a little bigger than I'd like, but these are all
    mechanical changes and they are all to the same areas of code. No
    behavior change is intended.
    Tested-by: default avatarScott Mayhew <smayhew@redhat.com>
    Reviewed-by: default avatarSimo Sorce <simo@redhat.com>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    2691a27d
gss_krb5_keys.c 10.1 KB