s4-auth-krb: Move function to db-glue.c and make it static.
authorSimo Sorce <idra@samba.org>
Sat, 31 Mar 2012 05:15:36 +0000 (01:15 -0400)
committerAndreas Schneider <asn@samba.org>
Thu, 12 Apr 2012 10:06:42 +0000 (12:06 +0200)
kerberos_enctype_to_bitmap is not used anywhere else, so just move it there and
make it static, one less dependency to worry about.

Signed-off-by: Andreas Schneider <asn@samba.org>
source4/auth/kerberos/kerberos.h
source4/auth/kerberos/kerberos_util.c
source4/kdc/db-glue.c

index b5d655a058a1d955cbd09e367176c73845a3f0c5..c57b13eb15ef0593b25ad72067dc73ef60672e43 100644 (file)
@@ -116,7 +116,6 @@ NTSTATUS kerberos_pac_logon_info(TALLOC_CTX *mem_ctx,
 struct loadparm_context;
 struct ldb_message;
 struct ldb_context;
-uint32_t kerberos_enctype_to_bitmap(krb5_enctype enc_type_enum);
 krb5_error_code smb_krb5_update_keytab(TALLOC_CTX *parent_ctx,
                                       struct smb_krb5_context *smb_krb5_context,
                                       struct ldb_context *ldb, 
index 4798df0ee931b9a21e798f9d24f6558d98cfc814..f38bc17212782e84d880e932a784929cec56f5f3 100644 (file)
@@ -347,22 +347,3 @@ krb5_error_code smb_krb5_get_keytab_container(TALLOC_CTX *mem_ctx,
 
        return 0;
 }
-
-/* Translate between the IETF encryption type values and the Microsoft msDS-SupportedEncryptionTypes values */
-uint32_t kerberos_enctype_to_bitmap(krb5_enctype enc_type_enum)
-{
-       switch (enc_type_enum) {
-       case ENCTYPE_DES_CBC_CRC:
-               return ENC_CRC32;
-       case ENCTYPE_DES_CBC_MD5:
-               return ENC_RSA_MD5;
-       case ENCTYPE_ARCFOUR_HMAC_MD5:
-               return ENC_RC4_HMAC_MD5;
-       case ENCTYPE_AES128_CTS_HMAC_SHA1_96:
-               return ENC_HMAC_SHA1_96_AES128;
-       case ENCTYPE_AES256_CTS_HMAC_SHA1_96:
-               return ENC_HMAC_SHA1_96_AES256;
-       default:
-               return 0;
-       }
-}
index 77c84303a526ca31ea9de0c08333238435cc2fd1..95a524d605465002e2597d0942a83073cc088289 100644 (file)
@@ -67,6 +67,27 @@ static const char *trust_attrs[] = {
        NULL
 };
 
+
+/* Translate between the IETF encryption type values and the Microsoft
+ * msDS-SupportedEncryptionTypes values */
+static uint32_t kerberos_enctype_to_bitmap(krb5_enctype enc_type_enum)
+{
+       switch (enc_type_enum) {
+       case ENCTYPE_DES_CBC_CRC:
+               return ENC_CRC32;
+       case ENCTYPE_DES_CBC_MD5:
+               return ENC_RSA_MD5;
+       case ENCTYPE_ARCFOUR_HMAC_MD5:
+               return ENC_RC4_HMAC_MD5;
+       case ENCTYPE_AES128_CTS_HMAC_SHA1_96:
+               return ENC_HMAC_SHA1_96_AES128;
+       case ENCTYPE_AES256_CTS_HMAC_SHA1_96:
+               return ENC_HMAC_SHA1_96_AES256;
+       default:
+               return 0;
+       }
+}
+
 static KerberosTime ldb_msg_find_krb5time_ldap_time(struct ldb_message *msg, const char *attr, KerberosTime default_val)
 {
     const char *tmp;