summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2021-07-27 13:59:36 +1200
committerAndrew Bartlett <abartlet@samba.org>2021-08-18 22:28:34 +0000
commit025737deb5325d25b2ae4c57583c24ae1d0eca33 (patch)
tree5c5922e2fa8be146059827d955bbd52b684e1520 /python
parentb6f96dd6395a30e15fa906959cbe665757aaba8d (diff)
downloadsamba-025737deb5325d25b2ae4c57583c24ae1d0eca33.tar.gz
tests/krb5: Generate AP-REQ for TGS request in _generic_kdc_exchange()
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/krb5/raw_testcase.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/python/samba/tests/krb5/raw_testcase.py b/python/samba/tests/krb5/raw_testcase.py
index e15fc44a962..4f399467cfe 100644
--- a/python/samba/tests/krb5/raw_testcase.py
+++ b/python/samba/tests/krb5/raw_testcase.py
@@ -1484,13 +1484,34 @@ class RawKerberosTest(TestCaseInTempDir):
EncAuthorizationData=EncAuthorizationData,
EncAuthorizationData_key=EncAuthorizationData_key,
EncAuthorizationData_usage=EncAuthorizationData_usage)
+
+ if req_msg_type == KRB_AS_REQ:
+ tgs_req = None
+ tgs_req_padata = None
+ else:
+ self.assertEqual(KRB_TGS_REQ, req_msg_type)
+
+ tgs_req = self.generate_ap_req(kdc_exchange_dict,
+ callback_dict,
+ req_body)
+ tgs_req_padata = self.PA_DATA_create(PADATA_KDC_REQ, tgs_req)
+
if generate_padata_fn is not None:
# This can alter req_body...
padata, req_body = generate_padata_fn(kdc_exchange_dict,
callback_dict,
req_body)
self.assertIsNotNone(padata)
+ self.assertNotIn(PADATA_KDC_REQ,
+ [pa['padata-type'] for pa in padata],
+ 'Don\'t create TGS-REQ manually')
else:
+ padata = []
+
+ if tgs_req_padata is not None:
+ padata.insert(0, tgs_req_padata)
+
+ if not padata:
padata = None
kdc_exchange_dict['req_padata'] = padata