async def request_passphrase(ctx):
    if storage.get_passphrase_source() == PassphraseSourceType.ASK:
        on_device = await request_passphrase_entry(ctx) == DEVICE
    else:
        on_device = storage.get_passphrase_source() == PassphraseSourceType.DEVICE
    passphrase = await request_passphrase_ack(ctx, on_device)
    return passphrase
Exemple #2
0
async def request_passphrase(ctx):
    if storage.get_passphrase_source() == PassphraseSourceType.ASK:
        on_device = await request_passphrase_entry(ctx) == DEVICE
    else:
        on_device = storage.get_passphrase_source(
        ) == PassphraseSourceType.DEVICE
    passphrase = await request_passphrase_ack(ctx, on_device)
    if len(passphrase) > _MAX_PASSPHRASE_LEN:
        raise wire.DataError("Maximum passphrase length is %d" %
                             _MAX_PASSPHRASE_LEN)
    return passphrase
async def request_passphrase(ctx) -> str:
    source = storage.get_passphrase_source()
    if source == PassphraseSourceType.ASK:
        source = await request_passphrase_source(ctx)
    passphrase = await request_passphrase_ack(
        ctx, source == PassphraseSourceType.DEVICE)
    if len(passphrase) > _MAX_PASSPHRASE_LEN:
        raise wire.DataError("Maximum passphrase length is %d" %
                             _MAX_PASSPHRASE_LEN)
    return passphrase