From c3bc04d85930ad42dd633594e32bdaf31d0a6f26 Mon Sep 17 00:00:00 2001 From: CravateRouge Date: Sun, 1 Dec 2024 19:31:31 +0800 Subject: [PATCH] Fix crealm tgt rep when decoding --- minikerberos/common/ccache.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/minikerberos/common/ccache.py b/minikerberos/common/ccache.py index 36b557d..834beb9 100644 --- a/minikerberos/common/ccache.py +++ b/minikerberos/common/ccache.py @@ -120,7 +120,7 @@ def to_tgt(self): tgt_rep = {} tgt_rep['pvno'] = krb5_pvno tgt_rep['msg-type'] = MESSAGE_TYPE.KRB_AS_REP.value - tgt_rep['crealm'] = self.server.realm.to_string() + tgt_rep['crealm'] = self.client.realm.to_string() tgt_rep['cname'] = self.client.to_asn1()[0] tgt_rep['ticket'] = Ticket.load(self.ticket.to_asn1()).native tgt_rep['enc-part'] = enc_part.native @@ -138,7 +138,7 @@ def to_tgs(self): tgt_rep = {} tgt_rep['pvno'] = krb5_pvno tgt_rep['msg-type'] = MESSAGE_TYPE.KRB_AS_REP.value - tgt_rep['crealm'] = self.server.realm.to_string() + tgt_rep['crealm'] = self.client.realm.to_string() tgt_rep['cname'] = self.client.to_asn1()[0] tgt_rep['ticket'] = Ticket.load(self.ticket.to_asn1()).native tgt_rep['enc-part'] = enc_part.native @@ -844,4 +844,4 @@ def to_b64(self): @staticmethod def from_b64(b64data): - return CCACHE.from_bytes(base64.b64decode(b64data)) \ No newline at end of file + return CCACHE.from_bytes(base64.b64decode(b64data))