mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
tests/krb5: Add get_enc_timestamp_pa_data_from_key()
This makes it easier to create encrypted timestamp padata when the key has already been obtained. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14817 (cherry picked from commit f5a906f74f9665a894db3c13722022f732180620)
This commit is contained in:
parent
16d7c193bb
commit
885f56f4c9
@ -416,8 +416,12 @@ class KDCBaseTest(RawKerberosTest):
|
||||
def get_enc_timestamp_pa_data(self, creds, rep, skew=0):
|
||||
'''generate the pa_data data element for an AS-REQ
|
||||
'''
|
||||
|
||||
key = self.get_as_rep_key(creds, rep)
|
||||
|
||||
return self.get_enc_timestamp_pa_data_from_key(key, skew=skew)
|
||||
|
||||
def get_enc_timestamp_pa_data_from_key(self, key, skew=0):
|
||||
(patime, pausec) = self.get_KerberosTimeWithUsec(offset=skew)
|
||||
padata = self.PA_ENC_TS_ENC_create(patime, pausec)
|
||||
padata = self.der_encode(padata, asn1Spec=krb5_asn1.PA_ENC_TS_ENC())
|
||||
|
Loading…
x
Reference in New Issue
Block a user