diff options
author | Simo Sorce <idra@samba.org> | 2012-03-30 18:32:07 -0400 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2012-04-12 12:06:42 +0200 |
commit | 23d54e7f92e8fa89944ec4c77634098a46863276 (patch) | |
tree | de964c2106431ab25b88a678096846d66e68cd6d /source4/auth/kerberos | |
parent | 6f7fa0bd2f786ba01fd932f3bb78dee35877a1bc (diff) | |
download | samba-23d54e7f92e8fa89944ec4c77634098a46863276.tar.gz samba-23d54e7f92e8fa89944ec4c77634098a46863276.tar.bz2 samba-23d54e7f92e8fa89944ec4c77634098a46863276.zip |
s4-auth-krb: streamline and rename enctype functions
better express what is being done in the function name.
Diffstat (limited to 'source4/auth/kerberos')
-rw-r--r-- | source4/auth/kerberos/kerberos_util.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source4/auth/kerberos/kerberos_util.c b/source4/auth/kerberos/kerberos_util.c index 11628768de..ade6fd1646 100644 --- a/source4/auth/kerberos/kerberos_util.c +++ b/source4/auth/kerberos/kerberos_util.c @@ -599,7 +599,7 @@ static krb5_error_code keytab_add_keys(TALLOC_CTX *parent_ctx, return 0; } -static krb5_error_code kerberos_enctype_bitmap_to_enctypes(TALLOC_CTX *mem_ctx, +static krb5_error_code ms_suptypes_to_ietf_enctypes(TALLOC_CTX *mem_ctx, uint32_t enctype_bitmap, krb5_enctype **enctypes); @@ -652,7 +652,7 @@ static krb5_error_code create_keytab(TALLOC_CTX *parent_ctx, enctype_bitmap = (uint32_t)ldb_msg_find_attr_as_int(msg, "msDS-SupportedEncryptionTypes", ENC_ALL_TYPES); - ret = kerberos_enctype_bitmap_to_enctypes(mem_ctx, enctype_bitmap, &enctypes); + ret = ms_suptypes_to_ietf_enctypes(mem_ctx, enctype_bitmap, &enctypes); if (ret) { *error_string = talloc_asprintf(parent_ctx, "create_keytab: generating list of encryption types failed (%s)\n", smb_get_krb5_error_message(smb_krb5_context->krb5_context, @@ -952,8 +952,9 @@ uint32_t kerberos_enctype_to_bitmap(krb5_enctype enc_type_enum) } } -/* Translate between the Microsoft msDS-SupportedEncryptionTypes values and the IETF encryption type values */ -static krb5_enctype kerberos_enctype_bitmap_to_enctype(uint32_t enctype_bitmap) +/* Translate between the Microsoft msDS-SupportedEncryptionTypes values + * and the IETF encryption type values */ +static krb5_enctype ms_suptype_to_ietf_enctype(uint32_t enctype_bitmap) { switch (enctype_bitmap) { case ENC_CRC32: @@ -970,21 +971,21 @@ static krb5_enctype kerberos_enctype_bitmap_to_enctype(uint32_t enctype_bitmap) return 0; } } - /* Return an array of krb5_enctype values */ -static krb5_error_code kerberos_enctype_bitmap_to_enctypes(TALLOC_CTX *mem_ctx, - uint32_t enctype_bitmap, - krb5_enctype **enctypes) +static krb5_error_code ms_suptypes_to_ietf_enctypes(TALLOC_CTX *mem_ctx, + uint32_t enctype_bitmap, + krb5_enctype **enctypes) { unsigned int i, j = 0; - *enctypes = talloc_zero_array(mem_ctx, krb5_enctype, (8*sizeof(enctype_bitmap))+1); + *enctypes = talloc_zero_array(mem_ctx, krb5_enctype, + (8 * sizeof(enctype_bitmap)) + 1); if (!*enctypes) { return ENOMEM; } - for (i=0; i<(8*sizeof(enctype_bitmap)); i++) { + for (i = 0; i < (8 * sizeof(enctype_bitmap)); i++) { uint32_t bit_value = (1 << i) & enctype_bitmap; if (bit_value & enctype_bitmap) { - (*enctypes)[j] = kerberos_enctype_bitmap_to_enctype(bit_value); + (*enctypes)[j] = ms_suptype_to_ietf_enctype(bit_value); if (!(*enctypes)[j]) { continue; } |