

def UnlockEncryptedVolume(self, source_scanner_object, scan_context, locked_scan_node, credentials):
    'Unlocks an encrypted volume.\n\n    This method can be used to prompt the user to provide encrypted volume\n    credentials.\n\n    Args:\n      source_scanner_object: the source scanner (instance of SourceScanner).\n      scan_context: the source scanner context (instance of\n                    SourceScannerContext).\n      locked_scan_node: the locked scan node (instance of SourceScanNode).\n      credentials: the credentials supported by the locked scan node (instance\n                   of dfvfs.Credentials).\n\n    Returns:\n      A boolean value indicating whether the volume was unlocked.\n    '
    if (locked_scan_node.type_indicator == definitions.TYPE_INDICATOR_BDE):
        print('Found a BitLocker encrypted volume.')
    else:
        print('Found an encrypted volume.')
    credentials_list = list(credentials.CREDENTIALS)
    credentials_list.append('skip')
    print('Supported credentials:')
    print('')
    for (index, name) in enumerate(credentials_list):
        print('  {0:d}. {1:s}'.format(index, result))
    print('')
    print('Note that you can abort with Ctrl^C.')
    print('')
    result = False
    while (not result):
        print('Select a credential to unlock the volume: ', end='')
        input_line = sys.stdin.readline()
        input_line = input_line.strip()
        if (input_line in credentials_list):
            credential_type = input_line
        else:
            try:
                credential_type = int(input_line, 10)
                credential_type = credentials_list[credential_type]
            except (IndexError, ValueError):
                print('Unsupported credential: {0:s}'.format(input_line))
                continue
        if (credential_type == 'skip'):
            break
        getpass_string = 'Enter credential data: '
        if (sys.platform.startswith('win') and (sys.version_info[0] < 3)):
            getpass_string = self._EncodeString(getpass_string)
        credential_data = getpass.getpass(getpass_string)
        print('')
        if (credential_type == 'key'):
            try:
                credential_data = credential_data.decode('hex')
            except TypeError:
                print('Unsupported credential data.')
                continue
        result = source_scanner_object.Unlock(scan_context, locked_scan_node.path_spec, credential_type, credential_data)
        if (not result):
            print('Unable to unlock volume.')
            print('')
    return result

dataset/ETHPy150Open log2timeline/dfvfs/examples/recursive_hasher.py RecursiveHasherVolumeScannerMediator.UnlockEncryptedVolume/VarMisuse@97/365 `name`->`result`