diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-08-27 15:52:47 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-08-28 07:57:28 +1000 |
commit | 1ed607057087cd5e9f1deebe472a1a6d9009a32f (patch) | |
tree | 122fa7512f59026db356bed04716269a902cb783 /lib/krb5_wrap | |
parent | 0f7aa3db52ac10177993e8f05569c7d378d66440 (diff) | |
download | samba-1ed607057087cd5e9f1deebe472a1a6d9009a32f.tar.gz |
lib/krb5_wrap: Move kerberos_enctype_to_bitmap() into krb5_wrap
Diffstat (limited to 'lib/krb5_wrap')
-rw-r--r-- | lib/krb5_wrap/krb5_samba.c | 21 | ||||
-rw-r--r-- | lib/krb5_wrap/krb5_samba.h | 2 |
2 files changed, 23 insertions, 0 deletions
diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c index 54cde89706c..171908aecc1 100644 --- a/lib/krb5_wrap/krb5_samba.c +++ b/lib/krb5_wrap/krb5_samba.c @@ -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, diff --git a/lib/krb5_wrap/krb5_samba.h b/lib/krb5_wrap/krb5_samba.h index 42e19b57899..87990e1ae81 100644 --- a/lib/krb5_wrap/krb5_samba.h +++ b/lib/krb5_wrap/krb5_samba.h @@ -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, |