summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2012-04-26 15:01:48 -0400
committerSimo Sorce <idra@samba.org>2012-05-04 16:51:28 +0200
commit94b9af6ac6e7d524398d971c44cc5569cf70346f (patch)
tree47dbdc58d0bff7861369cb1443d77603d253d5c4 /source4
parent07953e19fc01ee424f0ae5e65799ea7c029082f2 (diff)
downloadsamba-94b9af6ac6e7d524398d971c44cc5569cf70346f.tar.gz
samba-94b9af6ac6e7d524398d971c44cc5569cf70346f.tar.bz2
samba-94b9af6ac6e7d524398d971c44cc5569cf70346f.zip
Fix keytab_copy to compile with MIT librariues too
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/kerberos/keytab_copy.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/source4/auth/kerberos/keytab_copy.c b/source4/auth/kerberos/keytab_copy.c
index 657e4ef805..3dd687dec2 100644
--- a/source4/auth/kerberos/keytab_copy.c
+++ b/source4/auth/kerberos/keytab_copy.c
@@ -40,11 +40,11 @@
static krb5_boolean
compare_keyblock(const krb5_keyblock *a, const krb5_keyblock *b)
{
- if(a->keytype != b->keytype ||
- a->keyvalue.length != b->keyvalue.length ||
- memcmp(a->keyvalue.data, b->keyvalue.data, a->keyvalue.length) != 0)
- return FALSE;
- return TRUE;
+ if (KRB5_KEY_TYPE(a) != KRB5_KEY_TYPE(b) ||
+ KRB5_KEY_LENGTH(a) != KRB5_KEY_LENGTH(b) ||
+ memcmp(KRB5_KEY_DATA(a), KRB5_KEY_DATA(b), KRB5_KEY_LENGTH(a)) != 0)
+ return false;
+ return true;
}
static krb5_error_code copy_one_entry(krb5_context context,
@@ -63,7 +63,9 @@ static krb5_error_code copy_one_entry(krb5_context context,
name_str = NULL; /* XXX */
return ret;
}
- ret = krb5_enctype_to_string(context, entry.keyblock.keytype, &etype_str);
+ ret = smb_krb5_enctype_to_string(context,
+ KRB5_KEY_TYPE(KRB5_KT_KEY(&entry)),
+ &etype_str);
if(ret) {
krb5_set_error_message(context, ret, "krb5_enctype_to_string");
etype_str = NULL; /* XXX */
@@ -72,16 +74,16 @@ static krb5_error_code copy_one_entry(krb5_context context,
ret = krb5_kt_get_entry(context, dst_keytab,
entry.principal,
entry.vno,
- entry.keyblock.keytype,
+ KRB5_KEY_TYPE(KRB5_KT_KEY(&entry)),
&dummy);
if(ret == 0) {
/* this entry is already in the new keytab, so no need to
copy it; if the keyblocks are not the same, something
is weird, so complain about that */
- if(!compare_keyblock(&entry.keyblock, &dummy.keyblock)) {
- krb5_warn(context, 0, "entry with different keyvalue "
+ if (!compare_keyblock(KRB5_KT_KEY(&entry), KRB5_KT_KEY(&dummy))) {
+ DEBUG(2, ("copy_one_entry: entry with different keyvalue "
"already exists for %s, keytype %s, kvno %d",
- name_str, etype_str, entry.vno);
+ name_str, etype_str, entry.vno));
}
krb5_kt_free_entry(context, &dummy);
krb5_kt_free_entry (context, &entry);