def validate_yubikey_otp_short(self, params):
from_key = params["<STR_LIT>"][<NUM_LIT:0>]<EOL>if not re.match(ykotp_valid_input, from_key):<EOL><INDENT>self.log_error("<STR_LIT>" % (from_key))<EOL>return "<STR_LIT>"<EOL><DEDENT>try:<EOL><INDENT>res = pyhsm.yubikey.validate_otp(hsm, from_key)<EOL>return "<STR_LIT>" %(res.use_ctr, res.ts_low, res.ts_high, res.session_ctr)<EOL><DEDENT>except pyhsm.exception.YHSM_CommandFailed as e:<EOL><INDENT>return "<STR_LIT>" % (pyhsm.defines.status2str(e.status))<EOL><DEDENT>
Validate YubiKey OTP using YubiHSM internal database.