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