summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-27 15:51:52 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-28 07:57:28 +1000
commit0f7aa3db52ac10177993e8f05569c7d378d66440 (patch)
tree18a8689a994fd5fc705488658c52452adc88e75b
parent861353972d967ecbd1552d49f157f8e04904bcce (diff)
downloadsamba-0f7aa3db52ac10177993e8f05569c7d378d66440.tar.gz
lib/krb5_wrap: Bring list of all enc types into krb5_wrap
-rw-r--r--lib/krb5_wrap/krb5_samba.c14
-rw-r--r--lib/krb5_wrap/krb5_samba.h2
-rw-r--r--source4/libnet/libnet_export_keytab.c11
3 files changed, 17 insertions, 10 deletions
diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c
index 2d237ffa124..54cde89706c 100644
--- a/lib/krb5_wrap/krb5_samba.c
+++ b/lib/krb5_wrap/krb5_samba.c
@@ -2332,6 +2332,20 @@ char *smb_get_krb5_error_message(krb5_context context,
return ret;
}
+const krb5_enctype *samba_all_enctypes(void)
+{
+ /* TODO: Find a way not to have to use a fixed list */
+ static const krb5_enctype enctypes[] = {
+ KRB5_ENCTYPE_DES_CBC_CRC,
+ KRB5_ENCTYPE_DES_CBC_MD5,
+ KRB5_ENCTYPE_AES128_CTS_HMAC_SHA1_96,
+ KRB5_ENCTYPE_AES256_CTS_HMAC_SHA1_96,
+ KRB5_ENCTYPE_ARCFOUR_HMAC_MD5,
+ 0
+ };
+ return enctypes;
+};
+
#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 9db43b7535d..42e19b57899 100644
--- a/lib/krb5_wrap/krb5_samba.h
+++ b/lib/krb5_wrap/krb5_samba.h
@@ -293,6 +293,8 @@ krb5_boolean smb_krb5_kt_compare(krb5_context context,
krb5_enctype enctype);
#endif
+const krb5_enctype *samba_all_enctypes(void);
+
#endif /* HAVE_KRB5 */
int cli_krb5_get_ticket(TALLOC_CTX *mem_ctx,
diff --git a/source4/libnet/libnet_export_keytab.c b/source4/libnet/libnet_export_keytab.c
index b30bf12faa7..9763726e2b6 100644
--- a/source4/libnet/libnet_export_keytab.c
+++ b/source4/libnet/libnet_export_keytab.c
@@ -63,16 +63,7 @@ NTSTATUS libnet_export_keytab(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, s
}
if (r->in.principal) {
- /* TODO: Find a way not to have to use a fixed list */
- krb5_enctype enctypes[] = {
- KRB5_ENCTYPE_DES_CBC_CRC,
- KRB5_ENCTYPE_DES_CBC_MD5,
- KRB5_ENCTYPE_AES128_CTS_HMAC_SHA1_96,
- KRB5_ENCTYPE_AES256_CTS_HMAC_SHA1_96,
- KRB5_ENCTYPE_ARCFOUR_HMAC_MD5,
- 0
- };
- ret = kt_copy_one_principal(smb_krb5_context->krb5_context, from_keytab, r->in.keytab_name, r->in.principal, 0, enctypes);
+ ret = kt_copy_one_principal(smb_krb5_context->krb5_context, from_keytab, r->in.keytab_name, r->in.principal, 0, samba_all_enctypes);
} else {
unlink(r->in.keytab_name);
ret = kt_copy(smb_krb5_context->krb5_context, from_keytab, r->in.keytab_name);