s4-kdc: default kvno for inter-domain trusts to zero
authorAndrew Tridgell <tridge@samba.org>
Fri, 16 Sep 2011 01:15:27 +0000 (11:15 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 19 Sep 2011 00:57:03 +0000 (10:57 +1000)
the exact value doesn't matter, as both Samba and windows check
against the latest password, but the old default of -1 caused ASN.1
parsing errors on windows, which prevented it answering TGS requests

thanks to Hongwei Sun for finding this from a ttt trace

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/kdc/db-glue.c

index cdc318a4a8e7fedc4a0d6f3dbffd02bb305ce265..52bacd0f9d1fb6c428f1adb009af7cb2878897ae 100644 (file)
@@ -896,7 +896,15 @@ static krb5_error_code samba_kdc_trust_message2entry(krb5_context context,
                goto out;
        }
 
-       entry_ex->entry.kvno = -1;
+       entry_ex->entry.kvno = 0;
+       /*
+         we usually don't have a TRUST_AUTH_TYPE_VERSION field, as
+         windows doesn't create one, so we rely on the fact that both
+         windows and Samba don't actually check the kvno and instead
+         just check against the latest password blob. If we do have a
+         TRUST_AUTH_TYPE_VERSION field then we do use it, otherwise
+         we just use 0.
+        */
        for (i=0; i < password_blob.count; i++) {
                if (password_blob.current.array[i].AuthType == TRUST_AUTH_TYPE_VERSION) {
                        entry_ex->entry.kvno = password_blob.current.array[i].AuthInfo.version.version;