コード例 #1
0
def configuration(cell, passkey=None, username=None):
    """
    Returns a dictionary of configuration options for cell

    Asks for a password if necessary
    """
    if passkey == None and cell.encrypted:
        passkey = getpass("Wifi Password: "******"' + cell.ssid + '"',
                'key_mgmt': 'WPA-EAP',
                'scan_ssid': '1',
                'proto': 'RSN',
                'pairwise': 'CCMP TKIP',
                'group': 'CCMP TKIP',
                'eap': 'PEAP',
                'phase1': '"peapver=0"',
                'phase2': '"MSCHAPV2"',
                'identity': '"' + username + '"',
                'password': '******' + passkey + '"',
            }
        else:
            raise NotImplementedError
コード例 #2
0
ファイル: scheme.py プロジェクト: spektom/wifi
def configuration(cell, passkey=None):
    """
    Returns a dictionary of configuration options for cell

    Asks for a password if necessary
    """
    if not cell.encrypted:
        return {
            'wireless-essid': cell.ssid,
            'wireless-channel': 'auto',
        }
    else:
        if cell.encryption_type == 'wpa2':
            if len(passkey) != 64:
                passkey = pbkdf2_hex(passkey, cell.ssid, 4096, 32)

            return {
                'wpa-ssid': cell.ssid,
                'wpa-psk': passkey,
                'wireless-channel': 'auto',
            }
        elif cell.encryption_type == 'wep':
            return {
                'wireless-essid': cell.ssid,
                'wireless-key': passkey,
            }
        else:
            raise NotImplementedError
コード例 #3
0
ファイル: scheme.py プロジェクト: ant0nisk/python-wifi
def configuration(cell, passkey=None, username=None):
    """
    Returns a dictionary of configuration options for cell

    Asks for a password if necessary
    """
    if passkey == None and cell.encrypted:
        passkey = getpass("Wifi Password: "******"'+cell.ssid+'"',
                'key_mgmt': 'WPA-EAP',
                'scan_ssid': '1',
                'proto': 'RSN',
                'pairwise': 'CCMP TKIP',
                'group': 'CCMP TKIP',
                'eap': 'PEAP',
                'phase1': '"peapver=0"',
                'phase2': '"MSCHAPV2"',
                'identity': '"'+username+'"',
                'password': '******'+passkey+'"',
            }
        else:
            raise NotImplementedError
コード例 #4
0
ファイル: scheme.py プロジェクト: ramnes/wifi
def configuration(cell, passkey=None):
    """
    Returns a dictionary of configuration options for cell

    Asks for a password if necessary
    """
    if not cell.encrypted:
        return {"wireless-essid": cell.ssid, "wireless-channel": "auto"}
    else:
        if cell.encryption_type == "wpa2":
            if len(passkey) != 64:
                passkey = pbkdf2_hex(passkey, cell.ssid, 4096, 32)

            return {"wpa-ssid": cell.ssid, "wpa-psk": passkey, "wireless-channel": "auto"}
        elif cell.encryption_type == "wep":
            return {"wireless-essid": cell.ssid, "wireless-key": passkey}
        else:
            raise NotImplementedError