Skip to content
Permalink
Browse files

Add more debug information for PIN length

In certain debug scenarios it is important to know the length of
the OTP valu and the OTP Pin.

Closes #1501
  • Loading branch information...
cornelinux committed Mar 14, 2019
1 parent c89c545 commit 10dd6ec0eab35e0ebd2c0cfc47d372d3fec5a8b2
Showing with 5 additions and 0 deletions.
  1. +5 −0 privacyidea/lib/tokenclass.py
@@ -1208,12 +1208,17 @@ def split_pin_pass(self, passw, user=None, options=None):
"""
# The database field is always an integer
otplen = self.token.otplen
log.debug("Splitting the an OTP value of length {0!s} from the password.".format(otplen))
if get_prepend_pin():
pin = passw[0:-otplen]
otpval = passw[-otplen:]
log.debug("PIN prepended. PIN length is {0!s}, OTP length is {0!s}.".format(len(pin),
len(otpval)))
else:
pin = passw[otplen:]
otpval = passw[0:otplen]
log.debug("PIN appended. PIN length is {0!s}, OTP length is {0!s}.".format(len(pin),
len(otpval)))

return True, pin, otpval

0 comments on commit 10dd6ec

Please sign in to comment.
You can’t perform that action at this time.