Revert "selftest: allow any kdc error in mitm-s4u2self test"
authorIsaac Boukris <iboukris@gmail.com>
Thu, 7 May 2020 15:16:53 +0000 (17:16 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 15 May 2020 10:27:41 +0000 (10:27 +0000)
This reverts commit a53fa8ffe3e36f7921baf5d31a1052747f90aa7d.

This allows a clean revert (and so removal) of the test.

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/krb5/kdc-canon-heimdal.c

index 700e1c2b37e5d4e6b938b0d4ea0a6073e10a1d58..8dc3e24a8d53b15a400d1da2b18dc1e00e75d655 100644 (file)
@@ -737,12 +737,13 @@ static bool torture_krb5_post_recv_tgs_req_canon_test(struct torture_krb5_contex
                                         error.pvno, 5,
                                         "Got wrong error.pvno");
                expected_error = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN - KRB5KDC_ERR_NONE;
-               if (!test_context->test_data->mitm_s4u2self) {
-                       torture_assert_int_equal(test_context->tctx,
-                                                error.error_code,
-                                                expected_error,
-                                                "Got wrong error.error_code");
+               if (error.error_code != expected_error && test_context->test_data->mitm_s4u2self) {
+                       expected_error = KRB5KRB_AP_ERR_INAPP_CKSUM - KRB5KDC_ERR_NONE;
                }
+               torture_assert_int_equal(test_context->tctx,
+                                        error.error_code,
+                                        expected_error,
+                                        "Got wrong error.error_code");
        } else {
                torture_assert_int_equal(test_context->tctx,
                                         decode_TGS_REP(recv_buf->data, recv_buf->length,
@@ -2089,7 +2090,8 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
                        || test_data->upn == false)) {
 
                        if (test_data->mitm_s4u2self) {
-                               torture_assert_int_not_equal(tctx, k5ret, 0, assertion_message);
+                               torture_assert_int_equal(tctx, k5ret, KRB5KRB_AP_ERR_INAPP_CKSUM,
+                                                        assertion_message);
                                /* Done testing mitm-s4u2self */
                                return true;
                        }