def check_signature(params):
if '<STR_LIT:id>' in params:<EOL><INDENT>try:<EOL><INDENT>id_int = int(params['<STR_LIT:id>'][<NUM_LIT:0>])<EOL><DEDENT>except:<EOL><INDENT>my_log_message(args, syslog.LOG_INFO, "<STR_LIT>" % (params['<STR_LIT:id>'][<NUM_LIT:0>]))<EOL>return False, None<EOL><DEDENT>key = client_ids.get(id_int)<EOL>if key:<EOL><INDENT>if '<STR_LIT:h>' in params:<EOL><INDENT>sig = params['<STR_LIT:h>'][<NUM_LIT:0>]<EOL>good_sig = make_signature(params, key)<EOL>if sig == good_sig:<EOL><INDENT>return True, key<EOL><DEDENT>else:<EOL><INDENT>my_log_message(args, syslog.LOG_INFO, "<STR_LIT>"% (id_int, sig, good_sig))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>my_log_message(args, syslog.LOG_INFO, "<STR_LIT>" % (id_int))<EOL>return False, key<EOL><DEDENT><DEDENT>else:<EOL><INDENT>my_log_message(args, syslog.LOG_INFO, "<STR_LIT>" % (id_int))<EOL>return False, None<EOL><DEDENT><DEDENT>return True, None<EOL>
Verify the signature of the parameters in an OTP v2.0 verify request.

Returns ValResultBool, Key