From 0d2b72ae979bebaf8167a9bafa597fa1a0a6bfb5 Mon Sep 17 00:00:00 2001 From: Marshall Hallenbeck Date: Mon, 18 Mar 2024 17:20:10 -0400 Subject: [PATCH] Fix: undo untested breaking changes from #1311 that change getErrorString (#1714) * fix(nterrors): undo untested breaking changes from #1311 that change getErrorString for nt_status errors * fix(nt_errors): had incorrect older reference, updated to nt_errors * Update impacket/krb5/kerberosv5.py Co-authored-by: Gabriel Gonzalez --------- Co-authored-by: Gabriel Gonzalez --- impacket/krb5/kerberosv5.py | 2 +- impacket/smbconnection.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/impacket/krb5/kerberosv5.py b/impacket/krb5/kerberosv5.py index d81af85904..1375091056 100644 --- a/impacket/krb5/kerberosv5.py +++ b/impacket/krb5/kerberosv5.py @@ -712,7 +712,7 @@ def getErrorPacket( self ): return self.packet def getErrorString( self ): - return str(self) + return constants.ERROR_MESSAGES[self.error] def __str__( self ): retString = 'Kerberos SessionError: %s(%s)' % (constants.ERROR_MESSAGES[self.error]) diff --git a/impacket/smbconnection.py b/impacket/smbconnection.py index 58c1e51b27..bcc8031f89 100644 --- a/impacket/smbconnection.py +++ b/impacket/smbconnection.py @@ -986,7 +986,7 @@ def getErrorPacket( self ): return self.packet def getErrorString( self ): - return str(self) + return nt_errors.ERROR_MESSAGES[self.error] def __str__( self ): key = self.error