403b09
From cc92fe8badfe32f4c55abfa8b249dc1f94936d7c Mon Sep 17 00:00:00 2001
403b09
From: David Kupka <dkupka@redhat.com>
403b09
Date: Wed, 3 Aug 2016 10:35:40 +0200
403b09
Subject: [PATCH] vault: Catch correct exception in decrypt
403b09
403b09
ValueError is raised when decryption fails.
403b09
403b09
https://fedorahosted.org/freeipa/ticket/6160
403b09
403b09
Reviewed-By: David Kupka <dkupka@redhat.com>
403b09
---
403b09
 ipaclient/plugins/vault.py | 2 +-
403b09
 1 file changed, 1 insertion(+), 1 deletion(-)
403b09
403b09
diff --git a/ipaclient/plugins/vault.py b/ipaclient/plugins/vault.py
403b09
index e3a1ae3a0ad767bcee843b7fa3743a934e02d18b..73ad09b38316d55b466b7973dbeffefc1b7bb528 100644
403b09
--- a/ipaclient/plugins/vault.py
403b09
+++ b/ipaclient/plugins/vault.py
403b09
@@ -164,7 +164,7 @@ def decrypt(data, symmetric_key=None, private_key=None):
403b09
                     label=None
403b09
                 )
403b09
             )
403b09
-        except AssertionError:
403b09
+        except ValueError:
403b09
             raise errors.AuthenticationError(
403b09
                 message=_('Invalid credentials'))
403b09
 
403b09
-- 
403b09
2.7.4
403b09