示例#1
0
def configStrings(iface):
	driver = iNetwork.detectWlanModule(iface)
	ret = ""
	if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
		ret += "\tpre-up iwconfig " + iface + " essid \"" + re_escape(config.plugins.wlan.essid.value) + "\" || true\n"
	ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(iface) + " -B -dd -D" + driver + " || true\n"
	ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
	return ret
示例#2
0
def configStrings(iface):
    try:
        device = open("/proc/stb/info/model", "r").readline().strip()
    except:
        device = ""
    if device != "dm7025":
        rootkey = [
            '\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', '#', '&', '\xce',
            '\xb3', '\xfe', '\xda', '\xc9', 'U', '`', '\xd8', '\x8c', 's', 'o',
            '\x90', '\x9b', '\\', 'b', '\xc0', '\x89', '\xd1', '\x8c', '\x9e',
            'J', 'T', '\xc5', 'X', '\xa1', '\xb8', '\x13', '5', 'E', '\x02',
            '\xc9', '\xb2', '\xe6', 't', '\x89', '\xde', '\xcd', '\x9d',
            '\x11', '\xdd', '\xc7', '\xf4', '\xe4', '\xe4', '\xbc', '\xdb',
            '\x9c', '\xea', '}', '\xad', '\xda', 't', 'r', '\x9b', '\xdc',
            '\xbc', '\x18', '3', '\xe7', '\xaf', '|', '\xae', '\x0c', '\xe3',
            '\xb5', '\x84', '\x8d', '\r', '\x8d', '\x9d', '2', '\xd0', '\xce',
            '\xd5', 'q', '\t', '\x84', 'c', '\xa8', ')', '\x99', '\xdc', '<',
            '"', 'x', '\xe8', '\x87', '\x8f', '\x02', ';', 'S', 'm', '\xd5',
            '\xf0', '\xa3', '_', '\xb7', 'T', '\t', '\xde', '\xa7', '\xf1',
            '\xc9', '\xae', '\x8a', '\xd7', '\xd2', '\xcf', '\xb2', '.',
            '\x13', '\xfb', '\xac', 'j', '\xdf', '\xb1', '\x1d', ':', '?'
        ]
        etpm = eTPM()
        l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
        if l2cert is None:
            return
        l2key = validate_certificate(l2cert, rootkey)
        if l2key is None:
            return
        l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
        if l3cert is None:
            return
        l3key = validate_certificate(l3cert, l2key)
        if l3key is None:
            return
        rnd = get_random()
        if rnd is None:
            return
        val = etpm.challenge(rnd)
        result = decrypt_block(val, l3key)
    if device == "dm7025" or result[80:88] == rnd:
        driver = iNetwork.detectWlanModule(iface)
    else:
        driver = 'dreambox'
    print 'Using "%s" as wpa-supplicant driver' % (driver)
    ret = ""
    if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
        ret += "\tpre-up iwconfig " + iface + " essid \"" + re_escape(
            config.plugins.wlan.essid.value) + "\" || true\n"
    ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(
        iface) + " -B -dd -D" + driver + " || true\n"
    ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
    return ret
示例#3
0
def configStrings(iface):
	driver = iNetwork.detectWlanModule(iface)
	ret = ""
	if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
		ret += "\tpre-up iwconfig " + iface + " essid \"" + re_escape(config.plugins.wlan.essid.value) + "\" || true\n"

	if driver == 'wl':
		ret += '\tpre-up wl-config.sh -m %s -k %s -s "%s" \n' % ( config.plugins.wlan.encryption.value.lower(), re_escape(config.plugins.wlan.psk.value), config.plugins.wlan.essid.value)
		ret += '\tpost-down wl-down.sh\n'
	else:
		ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(iface) + " -B -dd -D" + driver + " || true\n"
		ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
	return ret
示例#4
0
def configStrings(iface):
	driver = iNetwork.detectWlanModule(iface)
	ret = ""
	if existBcmWifi(iface):
		encryption = config.plugins.wlan.encryption.value
		psk = config.plugins.wlan.psk.value
		essid = config.plugins.wlan.essid.value
		ret += '\tpre-up wl-config.sh -m ' + encryption.lower() + ' -k ' + psk + ' -s "' + essid + '" \n'
		ret += '\tpost-down wl-down.sh\n'
	else:
		if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
			ret += "\tpre-up iwconfig " + iface + " essid \"" + re.escape(config.plugins.wlan.essid.value) + "\" || true\n"
		ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(iface) + " -B -dd -D" + driver + " || true\n"
		ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
	return ret
示例#5
0
文件: plugin.py 项目: OpenViX/enigma2
def configStrings(iface):
	driver = iNetwork.detectWlanModule(iface)
	ret = ""
	if existBcmWifi(iface):
		encryption = config.plugins.wlan.encryption.value
		psk = config.plugins.wlan.psk.value
		essid = config.plugins.wlan.essid.value
		ret += '\tpre-up wl-config.sh -m ' + encryption.lower() + ' -k ' + psk + ' -s "' + essid + '" \n'
		ret += '\tpost-down wl-down.sh\n'
	else:
		if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
			ret += "\tpre-up iwconfig " + iface + " essid \"" + re.escape(config.plugins.wlan.essid.value) + "\" || true\n"
		ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(iface) + " -B -dd -D" + driver + " || true\n"
		ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
	return ret
示例#6
0
def configStrings(iface):
    driver = iNetwork.detectWlanModule(iface)
    ret = ""
    if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
        ret += "\tpre-up iwconfig " + iface + " essid \"" + re_escape(
            config.plugins.wlan.essid.value) + "\" || true\n"
    if driver == 'wl':
        ret += '\tpre-up wl-config.sh -m %s -k %s -s "%s" \n' % (
            config.plugins.wlan.encryption.value.lower(),
            re_escape(config.plugins.wlan.psk.value),
            config.plugins.wlan.essid.value)
        ret += '\tpost-down wl-down.sh\n'
    else:
        ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(
            iface) + " -B -dd -D" + driver + " || true\n"
        ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
    return ret
示例#7
0
文件: plugin.py 项目: Open-Plus/opgui
def configStrings(iface):
	driver = iNetwork.detectWlanModule(iface)
	ret = ""
	if driver == "brcm-wl":
		encryption = config.plugins.wlan.encryption.value
		if encryption == "WPA/WPA2":
			encryption = "WPA2"
		encryption = encryption.lower()
		if encryption == "unencrypted":
			encryption = "None"
		ret += '\tpre-up wl-config.sh -m ' + encryption + ' -k ' + config.plugins.wlan.psk.value + ' -s \"' + config.plugins.wlan.essid.value + '\" || true\n'
		ret += '\tpost-down wl-down.sh || true\n'
		return ret
	if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
		ret += "\tpre-up iwconfig " + iface + " essid \"" + re.escape(config.plugins.wlan.essid.value) + "\" || true\n"
	ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(iface) + " -B -dd -D" + driver + " || true\n"
	if config.plugins.wlan.hiddenessid.value == True:
		ret += "\tpre-up iwconfig " + iface + " essid \"" + re_escape(config.plugins.wlan.essid.value) + "\" || true\n"
	ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
	return ret
示例#8
0
def configStrings(iface):
	driver = iNetwork.detectWlanModule(iface)
	ret = ""
	if driver == "brcm-wl":
		encryption = config.plugins.wlan.encryption.value
		if encryption == "WPA/WPA2":
			encryption = "WPA2"
		encryption = encryption.lower()
		if encryption == "unencrypted":
			encryption = "None"
		ret += '\tpre-up wl-config.sh -m ' + encryption + ' -k ' + config.plugins.wlan.psk.value + ' -s \"' + config.plugins.wlan.essid.value + '\" || true\n'
		ret += '\tpost-down wl-down.sh || true\n'
		return ret
	if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
		ret += "\tpre-up iwconfig " + iface + " essid \"" + re.escape(config.plugins.wlan.essid.value) + "\" || true\n"
	ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(iface) + " -B -dd -D" + driver + " || true\n"
	if config.plugins.wlan.hiddenessid.value == True:
		ret += "\tpre-up iwconfig " + iface + " essid \"" + re_escape(config.plugins.wlan.essid.value) + "\" || true\n"
	ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
	return ret
示例#9
0
def configStrings(iface):
#--->
#-	try:
#-		device = open("/proc/stb/info/model", "r").readline().strip()
#-	except:
#-		device = ""	
#-	if device != "dm7025":
#-		rootkey = ['\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', '#', '&', '\xce', '\xb3', '\xfe', '\xda', '\xc9', 'U', '`', '\xd8', '\x8c', 's', 'o', '\x90', '\x9b', '\\', 'b', '\xc0', '\x89', '\xd1', '\x8c', '\x9e', 'J', 'T', '\xc5', 'X', '\xa1', '\xb8', '\x13', '5', 'E', '\x02', '\xc9', '\xb2', '\xe6', 't', '\x89', '\xde', '\xcd', '\x9d', '\x11', '\xdd', '\xc7', '\xf4', '\xe4', '\xe4', '\xbc', '\xdb', '\x9c', '\xea', '}', '\xad', '\xda', 't', 'r', '\x9b', '\xdc', '\xbc', '\x18', '3', '\xe7', '\xaf', '|', '\xae', '\x0c', '\xe3', '\xb5', '\x84', '\x8d', '\r', '\x8d', '\x9d', '2', '\xd0', '\xce', '\xd5', 'q', '\t', '\x84', 'c', '\xa8', ')', '\x99', '\xdc', '<', '"', 'x', '\xe8', '\x87', '\x8f', '\x02', ';', 'S', 'm', '\xd5', '\xf0', '\xa3', '_', '\xb7', 'T', '\t', '\xde', '\xa7', '\xf1', '\xc9', '\xae', '\x8a', '\xd7', '\xd2', '\xcf', '\xb2', '.', '\x13', '\xfb', '\xac', 'j', '\xdf', '\xb1', '\x1d', ':', '?']
#-		etpm = eTPM()
#-		l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
#-		if l2cert is None:
#-			return
#-		l2key = validate_certificate(l2cert, rootkey)
#-		if l2key is None:
#-			return
#-		l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
#-		if l3cert is None:
#-			return
#-		l3key = validate_certificate(l3cert, l2key)
#-		if l3key is None:
#-			return
#-		rnd = get_random()
#-		if rnd is None:
#-			return
#-		val = etpm.challenge(rnd)
#-		result = decrypt_block(val, l3key)
#-	if device == "dm7025" or result[80:88] == rnd:
#---<
	if True:
		driver = iNetwork.detectWlanModule(iface)
	else:
		driver = 'dreambox'
	print 'Using "%s" as wpa-supplicant driver' % (driver)
	ret = ""
	if driver == 'madwifi' and config.plugins.wlan.hiddenessid.value:
		ret += "\tpre-up iwconfig " + iface + " essid \"" + re_escape(config.plugins.wlan.essid.value) + "\" || true\n"
	ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(iface) + " -B -dd -D" + driver + " || true\n"
	ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
	return ret
示例#10
0
def configStrings(iface):
    try:
        device = open("/usr/local/etc/stb/info/model", "r").readline().strip()
    except:
        device = ""
    if device != "e2pc":
        rootkey = [
            "\x9f",
            "|",
            "\xe4",
            "G",
            "\xc9",
            "\xb4",
            "\xf4",
            "#",
            "&",
            "\xce",
            "\xb3",
            "\xfe",
            "\xda",
            "\xc9",
            "U",
            "`",
            "\xd8",
            "\x8c",
            "s",
            "o",
            "\x90",
            "\x9b",
            "\\",
            "b",
            "\xc0",
            "\x89",
            "\xd1",
            "\x8c",
            "\x9e",
            "J",
            "T",
            "\xc5",
            "X",
            "\xa1",
            "\xb8",
            "\x13",
            "5",
            "E",
            "\x02",
            "\xc9",
            "\xb2",
            "\xe6",
            "t",
            "\x89",
            "\xde",
            "\xcd",
            "\x9d",
            "\x11",
            "\xdd",
            "\xc7",
            "\xf4",
            "\xe4",
            "\xe4",
            "\xbc",
            "\xdb",
            "\x9c",
            "\xea",
            "}",
            "\xad",
            "\xda",
            "t",
            "r",
            "\x9b",
            "\xdc",
            "\xbc",
            "\x18",
            "3",
            "\xe7",
            "\xaf",
            "|",
            "\xae",
            "\x0c",
            "\xe3",
            "\xb5",
            "\x84",
            "\x8d",
            "\r",
            "\x8d",
            "\x9d",
            "2",
            "\xd0",
            "\xce",
            "\xd5",
            "q",
            "\t",
            "\x84",
            "c",
            "\xa8",
            ")",
            "\x99",
            "\xdc",
            "<",
            '"',
            "x",
            "\xe8",
            "\x87",
            "\x8f",
            "\x02",
            ";",
            "S",
            "m",
            "\xd5",
            "\xf0",
            "\xa3",
            "_",
            "\xb7",
            "T",
            "\t",
            "\xde",
            "\xa7",
            "\xf1",
            "\xc9",
            "\xae",
            "\x8a",
            "\xd7",
            "\xd2",
            "\xcf",
            "\xb2",
            ".",
            "\x13",
            "\xfb",
            "\xac",
            "j",
            "\xdf",
            "\xb1",
            "\x1d",
            ":",
            "?",
        ]
        etpm = eTPM()
        l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
        if l2cert is None:
            return
        l2key = validate_certificate(l2cert, rootkey)
        if l2key is None:
            return
        l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
        if l3cert is None:
            return
        l3key = validate_certificate(l3cert, l2key)
        if l3key is None:
            return
        rnd = get_random()
        if rnd is None:
            return
        val = etpm.challenge(rnd)
        result = decrypt_block(val, l3key)
    if device == "e2pc" or result[80:88] == rnd:
        driver = iNetwork.detectWlanModule(iface)
    else:
        driver = "dreambox"
    print 'Using "%s" as wpa-supplicant driver' % (driver)
    ret = ""
    if driver != "dreambox" and config.plugins.wlan.hiddenessid.value:
        ret += "\tpre-up iwconfig " + iface + ' essid "' + re_escape(config.plugins.wlan.essid.value) + '" || true\n'
    ret += "\tpre-up wpa_supplicant -i" + iface + " -c" + getWlanConfigName(iface) + " -D" + driver + " -B\n"
    ret += "\tpost-down killall -q wpa_supplicant\n"

    return ret