]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: Fix Orpheus' Lyre tests
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 10 Dec 2021 00:17:53 +0000 (13:17 +1300)
committerJoseph Sutton <jsutton@samba.org>
Wed, 19 Jan 2022 20:50:35 +0000 (20:50 +0000)
The enc-pa-rep request protection allows these tests to now pass as
expected.

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/torture/krb5/kdc-heimdal.c

index dbc4960de197789e2c6fc24463ffa3958c315744..b1bbac94ccff16d0d349f642c48793695c8ef4f8 100644 (file)
@@ -748,7 +748,6 @@ static bool torture_krb5_as_req_creds(struct torture_context *tctx,
        const char *expected_principal_string;
        krb5_get_init_creds_opt *krb_options = NULL;
        const char *realm;
-       const char *krb5_service = torture_setting_string(tctx, "krb5-service", "host");
        const char *krb5_hostname = torture_setting_string(tctx, "krb5-hostname", "");
 
 
@@ -909,6 +908,12 @@ static bool torture_krb5_as_req_creds(struct torture_context *tctx,
        {
                char *got_principal_string;
                char *assertion_message;
+
+               if (krb5_hostname[0] != '\0') {
+                       torture_assert_int_equal(tctx, k5ret, KRB5KRB_AP_ERR_BAD_INTEGRITY, "krb5_get_init_creds_password should have failed");
+                       return true;
+               }
+
                torture_assert_int_equal(tctx, k5ret, 0, "krb5_get_init_creds_password failed");
 
                torture_assert_int_equal(tctx,
@@ -933,24 +938,6 @@ static bool torture_krb5_as_req_creds(struct torture_context *tctx,
                                                            principal),
                               assertion_message);
 
-               if (krb5_hostname[0] == '\0') {
-                       break;
-               }
-
-               torture_assert_str_equal(tctx,
-                                        my_creds.server->name.name_string.val[0],
-                                        krb5_service,
-                                        "Mismatch in name[0] between AS_REP and expected response");
-               torture_assert_str_equal(tctx,
-                                        my_creds.server->name.name_string.val[1],
-                                        krb5_hostname,
-                                        "Mismatch in name[1] between AS_REP and expected response");
-
-               torture_assert_str_equal(tctx,
-                                        my_creds.server->realm,
-                                        realm,
-                                        "Mismatch in server realm in AS_REP, expected krbtgt/REALM@REALM");
-
                break;
        }
        }