API proposal: krb5_enctype_to_name

ghudson@MIT.EDU ghudson at MIT.EDU
Fri Jun 4 12:35:49 EDT 2010


I think this is mostly a no-brainer, but I also think API additions
should be discussed in some form.

Currently we have krb5_enctype_to_string(), which provides an
enctype's "out_string", which is something like "DES cbc mode with
RSA-MD5".  Sometimes you want a shorter display, or you want to show
something that can be used as input.

I propose to add:

    krb5_error_code KRB5_CALLCONV
    krb5_enctype_to_name(krb5_enctype enctype, krb5_boolean short,
                         char *buffer, size_t buflen)

If short is FALSE, we return the enctype's canonical name (like
"aes128-cts-hmac-sha1-96").  If short is TRUE, we return the enctype's
shortest alias (like "rc4-hmac" or "aes128-cts").

For reference, krb5_enctype_to_string is:

    krb5_error_code KRB5_CALLCONV
    krb5_enctype_to_string(krb5_enctype enctype, char *buffer, size_t buflen)



More information about the krbdev mailing list