1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-21 20:23:50 +03:00

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>
This commit is contained in:
Joseph Sutton
2021-07-27 13:59:36 +12:00
committed by Andrew Bartlett
parent b6f96dd639
commit 025737deb5

View File

@@ -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