summaryrefslogtreecommitdiff
path: root/source4/kdc
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2012-03-31 01:15:36 -0400
committerAndreas Schneider <asn@samba.org>2012-04-12 12:06:42 +0200
commit6de578a8f7a4ed2defeb778c089bdff0b8cef6cd (patch)
treee0941f228f5088050ad81e69c551603da30ad6b4 /source4/kdc
parentb226955587ee3a45c25bef2783e13e82d2f9048c (diff)
downloadsamba-6de578a8f7a4ed2defeb778c089bdff0b8cef6cd.tar.gz
samba-6de578a8f7a4ed2defeb778c089bdff0b8cef6cd.tar.bz2
samba-6de578a8f7a4ed2defeb778c089bdff0b8cef6cd.zip
s4-auth-krb: Move function to db-glue.c and make it static.
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>
Diffstat (limited to 'source4/kdc')
-rw-r--r--source4/kdc/db-glue.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/kdc/db-glue.c b/source4/kdc/db-glue.c
index 77c84303a5..95a524d605 100644
--- a/source4/kdc/db-glue.c
+++ b/source4/kdc/db-glue.c
@@ -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;