diff options
author | Günther Deschner <gd@samba.org> | 2008-06-18 12:45:57 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-06-24 23:34:05 +0200 |
commit | 0ac8c5d49a8b0d5535eebf80871003f6c19af5eb (patch) | |
tree | f4cf6308a39147b7de4d0e405471ddec30fff136 /source3/libads | |
parent | 7c451b9b89de4fd3243e081551504d2efc6ade2f (diff) | |
download | samba-0ac8c5d49a8b0d5535eebf80871003f6c19af5eb.tar.gz samba-0ac8c5d49a8b0d5535eebf80871003f6c19af5eb.tar.xz samba-0ac8c5d49a8b0d5535eebf80871003f6c19af5eb.zip |
kerberos: make smb_krb5_kt_add_entry public, allow to pass keys without salting them.
Guenther
(This used to be commit 7c4da23be1105dc224033b21eb486e7fcdc7d9c5)
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/kerberos_keytab.c | 16 | ||||
-rw-r--r-- | source3/libads/kerberos_verify.c | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/source3/libads/kerberos_keytab.c b/source3/libads/kerberos_keytab.c index 8e6983897fa..c8ffd734fc2 100644 --- a/source3/libads/kerberos_keytab.c +++ b/source3/libads/kerberos_keytab.c @@ -32,9 +32,13 @@ /********************************************************************** **********************************************************************/ -static int smb_krb5_kt_add_entry( krb5_context context, krb5_keytab keytab, - krb5_kvno kvno, const char *princ_s, - krb5_enctype *enctypes, krb5_data password ) +int smb_krb5_kt_add_entry(krb5_context context, + krb5_keytab keytab, + krb5_kvno kvno, + const char *princ_s, + krb5_enctype *enctypes, + krb5_data password, + bool no_salt) { krb5_error_code ret = 0; krb5_kt_cursor cursor; @@ -166,7 +170,7 @@ static int smb_krb5_kt_add_entry( krb5_context context, krb5_keytab keytab, #ifdef HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK /* Heimdal */ keyp = &kt_entry.keyblock; #endif - if (create_kerberos_key_from_string(context, princ, &password, keyp, enctypes[i])) { + if (create_kerberos_key_from_string(context, princ, &password, keyp, enctypes[i], no_salt)) { continue; } @@ -321,7 +325,7 @@ int ads_keytab_add_entry(ADS_STRUCT *ads, const char *srvPrinc) /* add the fqdn principal to the keytab */ - ret = smb_krb5_kt_add_entry( context, keytab, kvno, princ_s, enctypes, password ); + ret = smb_krb5_kt_add_entry( context, keytab, kvno, princ_s, enctypes, password, false ); if ( ret ) { DEBUG(1,("ads_keytab_add_entry: Failed to add entry to keytab file\n")); goto out; @@ -330,7 +334,7 @@ int ads_keytab_add_entry(ADS_STRUCT *ads, const char *srvPrinc) /* add the short principal name if we have one */ if ( short_princ_s ) { - ret = smb_krb5_kt_add_entry( context, keytab, kvno, short_princ_s, enctypes, password ); + ret = smb_krb5_kt_add_entry( context, keytab, kvno, short_princ_s, enctypes, password, false ); if ( ret ) { DEBUG(1,("ads_keytab_add_entry: Failed to add short entry to keytab file\n")); goto out; diff --git a/source3/libads/kerberos_verify.c b/source3/libads/kerberos_verify.c index a4d7a8e6803..c6671816427 100644 --- a/source3/libads/kerberos_verify.c +++ b/source3/libads/kerberos_verify.c @@ -259,7 +259,7 @@ static krb5_error_code ads_secrets_verify_ticket(krb5_context context, goto out; } - if (create_kerberos_key_from_string(context, host_princ, &password, key, enctypes[i])) { + if (create_kerberos_key_from_string(context, host_princ, &password, key, enctypes[i], false)) { SAFE_FREE(key); continue; } |