def get_password(hsm, args):
expected_len = <NUM_LIT:32><EOL>name = '<STR_LIT>'<EOL>if hsm.version.have_key_store_decrypt():<EOL><INDENT>expected_len = <NUM_LIT:64><EOL>name = '<STR_LIT>'<EOL><DEDENT>if args.stdin:<EOL><INDENT>password = sys.stdin.readline()<EOL>while password and password[-<NUM_LIT:1>] == '<STR_LIT:\n>':<EOL><INDENT>password = password[:-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if args.debug:<EOL><INDENT>password = input('<STR_LIT>' % (name))<EOL><DEDENT>else:<EOL><INDENT>password = getpass.getpass('<STR_LIT>' % (name))<EOL><DEDENT><DEDENT>if len(password) <= expected_len:<EOL><INDENT>password = password.decode('<STR_LIT>')<EOL>if not password:<EOL><INDENT>return None<EOL><DEDENT>return password<EOL><DEDENT>else:<EOL><INDENT>sys.stderr.write("<STR_LIT>" %(expected_len, len(password)))<EOL>return <NUM_LIT:1><EOL><DEDENT>
Get password of correct length for this YubiHSM version.