rpcserver: fix exception handling for FAST armor failure

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Alexander Bokovoy 2020-10-30 19:01:53 +02:00
parent 9a41966a25
commit 563d0a0729
2 changed files with 2 additions and 3 deletions

View File

@ -249,7 +249,7 @@ class KrbPrincipalWrongFAST(PrivateError):
"""
Raised when it is not possible to use our FAST armor for kinit
"""
format = '%(principal) cannot use Anonymous PKINIT as a FAST armor'
format = '%(principal)s cannot use Anonymous PKINIT as a FAST armor'
##############################################################################
# Public errors:

View File

@ -1103,8 +1103,7 @@ class login_password(Backend, KerberosSession):
message=unicode(e))
elif ('kinit: Error constructing AP-REQ armor: '
'Matching credential not found') in str(e):
raise KrbPrincipalWrongFAST(principal=principal,
message=unicode(e))
raise KrbPrincipalWrongFAST(principal=principal)
raise InvalidSessionPassword(principal=principal,
message=unicode(e))