]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/krb5_wrap: Move kerberos_enctype_to_bitmap() into krb5_wrap
authorAndrew Bartlett <abartlet@samba.org>
Mon, 27 Aug 2012 05:52:47 +0000 (15:52 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 27 Aug 2012 21:57:28 +0000 (07:57 +1000)
lib/krb5_wrap/krb5_samba.c
lib/krb5_wrap/krb5_samba.h
source4/kdc/db-glue.c

index 54cde89706ca294fd4482d68f7f265ba282e85cc..171908aecc151a9671947359df6a5c30cf2e92bf 100644 (file)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "krb5_samba.h"
 #include "lib/util/asn1.h"
+#include "librpc/gen_ndr/netlogon.h"
 
 #ifndef KRB5_AUTHDATA_WIN2K_PAC
 #define KRB5_AUTHDATA_WIN2K_PAC 128
@@ -2346,6 +2347,26 @@ const krb5_enctype *samba_all_enctypes(void)
        return enctypes;
 };
 
+/* 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;
+       }
+}
+
 #else /* HAVE_KRB5 */
  /* this saves a few linking headaches */
  int cli_krb5_get_ticket(TALLOC_CTX *mem_ctx,
index 42e19b57899fd108d073503d43d153a7c15e1e82..87990e1ae8194404aea798915c1bf62294182d32 100644 (file)
@@ -295,6 +295,8 @@ krb5_boolean smb_krb5_kt_compare(krb5_context context,
 
 const krb5_enctype *samba_all_enctypes(void);
 
+uint32_t kerberos_enctype_to_bitmap(krb5_enctype enc_type_enum);
+
 #endif /* HAVE_KRB5 */
 
 int cli_krb5_get_ticket(TALLOC_CTX *mem_ctx,
index 7bb2db2fb05ded872b8c63f6f92c70a7041f3f66..ab606e8e237f578f318c2ad74f9f71c7f39223a3 100644 (file)
@@ -67,26 +67,6 @@ static const char *trust_attrs[] = {
 };
 
 
-/* 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;