summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2022-01-06 16:42:33 +1300
committerJoseph Sutton <jsutton@samba.org>2022-01-19 20:50:35 +0000
commit1954e50f266256c9e153c9613f49f9d9f5dbf67b (patch)
treed905b7398411151be4b8771804494cf0acf2a54f
parenta24280dc72d05828befdf4bd1288bbea1e97e08c (diff)
downloadsamba-1954e50f266256c9e153c9613f49f9d9f5dbf67b.tar.gz
s4:torture: Adapt KDC canon test to Heimdal upstream changes
NOTE: This commit finally works again! Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source4/torture/krb5/kdc-canon-heimdal.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source4/torture/krb5/kdc-canon-heimdal.c b/source4/torture/krb5/kdc-canon-heimdal.c
index 1c9cedafbbc..f4e447399b5 100644
--- a/source4/torture/krb5/kdc-canon-heimdal.c
+++ b/source4/torture/krb5/kdc-canon-heimdal.c
@@ -747,14 +747,18 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
server_creds),
0, "krb5_free_cred_contents failed");
+ torture_assert_int_equal(tctx,
+ test_context->packet_count,
+ 1, "Expected krb5_get_creds to send one packet");
+
} else {
torture_assert_int_equal(tctx, k5ret, KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN,
assertion_message);
+ /* Account for get_cred_kdc_capath() and get_cred_kdc_referral() fallback */
+ torture_assert_int_equal(tctx,
+ test_context->packet_count,
+ 2, "Expected krb5_get_creds to send 2 packets");
}
-
- torture_assert_int_equal(tctx,
- test_context->packet_count,
- 1, "Expected krb5_get_creds to send packets");
}
/*
@@ -816,7 +820,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
torture_assert(tctx,
test_accept_ticket(tctx,
samba_cmdline_get_creds(),
- spn,
+ expected_principal_string,
client_to_server),
"test_accept_ticket failed - failed to accept the ticket we just created");
} else if (test_data->canonicalize == true
@@ -828,7 +832,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
torture_assert(tctx,
test_accept_ticket(tctx,
samba_cmdline_get_creds(),
- principal_string,
+ expected_principal_string,
client_to_server),
"test_accept_ticket failed - failed to accept the ticket we just created");
} else if (test_data->canonicalize == false