]> git.ipfire.org Git - thirdparty/python-fints.git/commitdiff
Fix detection of PIN errors
authorRaphael Michel <mail@raphaelmichel.de>
Sun, 22 Dec 2019 17:43:42 +0000 (18:43 +0100)
committerRaphael Michel <mail@raphaelmichel.de>
Sun, 22 Dec 2019 17:43:42 +0000 (18:43 +0100)
fints/client.py

index bd513afeafc127449bd13a59443e37d03d80b51e..a12968c7b99437ef9b93f7e9a579700e2835ed33 100644 (file)
@@ -1139,6 +1139,7 @@ class FinTS3PinTanClient(FinTS3Client):
             response = dialog.init(
                 HKSYN3(SynchronizationMode.NEW_SYSTEM_ID),
             )
+            self.process_response_message(dialog, response, internal_send=True)
             seg = response.find_segment_first(HISYN4)
             if not seg:
                 raise ValueError('Could not find system_id')
@@ -1281,7 +1282,7 @@ class FinTS3PinTanClient(FinTS3Client):
             raise FinTSClientError("Error during dialog initialization, could not fetch BPD. Please check that you "
                                    "passed the correct bank identifier to the HBCI URL of the correct bank.")
 
-        if ((not dialog.open and response.code.startswith('9')) or response.code in ('9340', '9910', '9930', '9931', '9942')) and not self._bootstrap_mode:
+        if ((not dialog.open and response.code.startswith('9')) and not self._bootstrap_mode)  or response.code in ('9340', '9910', '9930', '9931', '9942'):
             # Assume all 9xxx errors in a not-yet-open dialog refer to the PIN or authentication
             # During a dialog also listen for the following codes which may explicitly indicate an
             # incorrect pin: 9340, 9910, 9930, 9931, 9942