diff --git a/helper/helper/base.py b/helper/helper/base.py index ca2a940f..78b9b653 100644 --- a/helper/helper/base.py +++ b/helper/helper/base.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from yubikit.core import InvalidPinError from functools import partial import logging @@ -123,6 +124,8 @@ class RpcNode: except ChildResetException as e: self._close_child() raise StateResetException(e.message, traversed) + except InvalidPinError: + raise # Prevent catching this as a ValueError below except ValueError as e: raise InvalidParametersException(e) raise NoSuchActionException(action) diff --git a/helper/helper/piv.py b/helper/helper/piv.py index a6ae5511..9a9b72f6 100644 --- a/helper/helper/piv.py +++ b/helper/helper/piv.py @@ -21,13 +21,12 @@ from .base import ( TimeoutException, AuthRequiredException, ) -from yubikit.core import NotSupportedError, BadResponseError +from yubikit.core import NotSupportedError, BadResponseError, InvalidPinError from yubikit.core.smartcard import ApduError, SW from yubikit.piv import ( PivSession, OBJECT_ID, MANAGEMENT_KEY_TYPE, - InvalidPinError, SLOT, require_version, KEY_TYPE,