Tiqr / tiqr-server-libphp

A PHP library for using the tiqr authentication mechanism
6 stars 7 forks source link

UserSecretStorage is missing PDO::ERRMODE_EXCEPTION #46

Closed pmeulen closed 1 year ago

pmeulen commented 1 year ago

UserSecretStorage is missing the option array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION) in https://github.com/Tiqr/tiqr-server-libphp/blob/develop/library/tiqr/Tiqr/UserSecretStorage.php#L77 Because the error handling does expect exceptions from the PDO calls, errors reading or writing the user secret are not detected at this point, leading to errors later in the authentication process.

tvdijen commented 1 year ago

Is this the reason behind issue https://github.com/OpenConext/Stepup-tiqr/issues/164 ?

pmeulen commented 1 year ago

Yes, this is why the failed write of the secret is not detected in Stepup-tiqr.