def autostart(reason, **kwargs): print "[CrashlogAutoSubmit] - autostart" 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.getData(eTPM.DT_LEVEL2_CERT) if l2cert is None: return l2key = validate_cert(l2cert, rootkey) if l2key is None: return l3cert = etpm.getData(eTPM.DT_LEVEL3_CERT) if l3cert is None: return l3key = validate_cert(l3cert, l2key) if l3key is None: return rnd = read_random() if rnd is None: return val = etpm.computeSignature(rnd) result = decrypt_block(val, l3key) if device == "dm7025" or result[80:88] == rnd: if "session" in kwargs: try: startMailer(kwargs["session"]) except ImportError, e: print "[CrashlogAutoSubmit] Twisted-mail not available, not starting CrashlogAutoSubmitter", e
def autostart(reason, **kwargs): print "[CrashlogAutoSubmit] - autostart" 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_cert(l2cert, rootkey) if l2key is None: return l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT) if l3cert is None: return l3key = validate_cert(l3cert, l2key) if l3key is None: return rnd = read_random() if rnd is None: return val = etpm.challenge(rnd) result = decrypt_block(val, l3key) if device == "dm7025" or result[80:88] == rnd: if "session" in kwargs: try: startMailer(kwargs["session"]) except ImportError, e: print "[CrashlogAutoSubmit] Twisted-mail not available, not starting CrashlogAutoSubmitter", e
def main(session, **kwargs): 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.getData(eTPM.DT_LEVEL2_CERT) if l2cert is None: print "l2cert not found" return l2key = validate_cert(l2cert, rootkey) if l2key is None: print "l2cert invalid" return l3cert = etpm.getData(eTPM.DT_LEVEL3_CERT) if l3cert is None: print "l3cert not found (can be fixed by running the genuine dreambox plugin and running the offered update)" return l3key = validate_cert(l3cert, l2key) if l3key is None: print "l3cert invalid" return rnd = read_random() if rnd is None: print "random error" return val = etpm.computeSignature(rnd) result = decrypt_block(val, l3key) if result[80:88] == rnd: print "successfully finished the tpm test"
def configStrings(iface): hardware_info = HardwareInfo() if hardware_info.device_name != "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_cert(l2cert, rootkey) if l2key is None: return l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT) if l3cert is None: print "better run the genuine dreambox plugin" return l3key = validate_cert(l3cert, l2key) if l3key is None: return rnd = read_random() if rnd is None: return val = etpm.challenge(rnd) result = decrypt_block(val, l3key) if hardware_info.device_name == "dm7025" or result[80:88] == rnd: driver = iNetwork.detectWlanModule(iface) else: driver = 'dreambox' if driver in ('ralink', 'zydas'): return " pre-up /usr/sbin/wpa_supplicant -i"+iface+" -c/etc/wpa_supplicant.conf -B -D"+driver+"\n post-down wpa_cli terminate" else: if config.plugins.wlan.essid.value == "hidden...": return ' pre-up iwconfig '+iface+' essid "'+config.plugins.wlan.hiddenessid.value+'"\n pre-up /usr/sbin/wpa_supplicant -i'+iface+' -c/etc/wpa_supplicant.conf -B -dd -D'+driver+'\n post-down wpa_cli terminate' else: return ' pre-up iwconfig '+iface+' essid "'+config.plugins.wlan.essid.value+'"\n pre-up /usr/sbin/wpa_supplicant -i'+iface+' -c/etc/wpa_supplicant.conf -B -dd -D'+driver+'\n post-down wpa_cli terminate'
def send_mail(): 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.getData(eTPM.DT_LEVEL2_CERT) if l2cert is None: return l2key = validate_cert(l2cert, rootkey) if l2key is None: return l3cert = etpm.getData(eTPM.DT_LEVEL3_CERT) if l3cert is None: return l3key = validate_cert(l3cert, l2key) if l3key is None: return rnd = read_random() if rnd is None: return val = etpm.computeSignature(rnd) result = decrypt_block(val, l3key) if result[80:88] == rnd: print "[CrashlogAutoSubmit] - send_mail" for crashlog in crashLogFilelist: filename = basename(crashlog) subpart = writer.nextpart() subpart.addheader("Content-Transfer-Encoding", 'base64') subpart.addheader("Content-Disposition",'attachment; filename="%s"' % filename) subpart.addheader('Content-Description', 'Enigma2 crashlog') body = subpart.startbody("%s; name=%s" % ('application/octet-stream', filename)) mimetools.encode(open(crashlog, 'rb'), body, 'base64') writer.lastpart() sending = smtp.sendmail(str(mxServer), mailFrom, mailTo, message.getvalue()) sending.addCallback(handleSuccess).addErrback(handleError)
def tpm_check(): try: tpm = eTPM() 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', ':', '?' ] random = None result = None # l2r = False l2k = None l3k = None l2c = tpm.getData(eTPM.DT_LEVEL2_CERT) if l2c is None: return 0 l2k = validate_certificate(l2c, rootkey) if l2k is None: return 0 l3c = tpm.getData(eTPM.DT_LEVEL3_CERT) if l3c is None: return 0 l3k = validate_certificate(l3c, l2k) if l3k is None: return 0 random = get_random() if random is None: return 0 value = tpm.computeSignature(random) result = decrypt_block(value, l3k) if result is None: return 0 if result[80:88] != random: return 0 return 1 except: # noqa: E722 return 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
def main(session, **kwargs): 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: print "l2cert not found" return l2key = validate_cert(l2cert, rootkey) if l2key is None: print "l2cert invalid" return l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT) if l3cert is None: print "l3cert not found (can be fixed by running the genuine receiver plugin and running the offered update)" return l3key = validate_cert(l3cert, l2key) if l3key is None: print "l3cert invalid" return rnd = read_random() if rnd is None: print "random error" return val = etpm.challenge(rnd) result = decrypt_block(val, l3key) if device == "dm7025" or result[80:88] == rnd: print "successfully finished the tpm test"
def configStrings(iface): hardware_info = HardwareInfo() if hardware_info.device_name != "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_cert(l2cert, rootkey) if l2key is None: return l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT) if l3cert is None: print "better run the genuine dreambox plugin" return l3key = validate_cert(l3cert, l2key) if l3key is None: return rnd = read_random() if rnd is None: return val = etpm.challenge(rnd) result = decrypt_block(val, l3key) if hardware_info.device_name == "dm7025" or result[80:88] == rnd: driver = iNetwork.detectWlanModule(iface) else: driver = 'dreambox' if driver in ('ralink', 'zydas'): return " pre-up /usr/sbin/wpa_supplicant -i" + iface + " -c/etc/wpa_supplicant.conf -B -D" + driver + "\n post-down wpa_cli terminate" else: if config.plugins.wlan.essid.value == "hidden...": return ' pre-up iwconfig ' + iface + ' essid "' + config.plugins.wlan.hiddenessid.value + '"\n pre-up /usr/sbin/wpa_supplicant -i' + iface + ' -c/etc/wpa_supplicant.conf -B -dd -D' + driver + '\n post-down wpa_cli terminate' else: return ' pre-up iwconfig ' + iface + ' essid "' + config.plugins.wlan.essid.value + '"\n pre-up /usr/sbin/wpa_supplicant -i' + iface + ' -c/etc/wpa_supplicant.conf -B -dd -D' + driver + '\n post-down wpa_cli terminate'
def main(session, **kwargs): 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.getData(eTPM.DT_LEVEL2_CERT) if l2cert is None: print "l2cert not found" return l2key = validate_cert(l2cert, rootkey) if l2key is None: print "l2cert invalid" return l3cert = etpm.getData(eTPM.DT_LEVEL3_CERT) if l3cert is None: print "l3cert not found (can be fixed by running the genuine dreambox plugin and running the offered update)" return l3key = validate_cert(l3cert, l2key) if l3key is None: print "l3cert invalid" return rnd = read_random() if rnd is None: print "random error" return val = etpm.computeSignature(rnd) result = decrypt_block(val, l3key) if result[80:88] == rnd: print "successfully finished the tpm test"
def tpm_check(): try: tpm = eTPM() 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', ':', '?'] random = None result = None l2r = False l2k = None l3k = None l2c = tpm.getData(eTPM.DT_LEVEL2_CERT) if l2c is None: return 0 l2k = validate_certificate(l2c, rootkey) if l2k is None: return 0 l3c = tpm.getData(eTPM.DT_LEVEL3_CERT) if l3c is None: return 0 l3k = validate_certificate(l3c, l2k) if l3k is None: return 0 random = get_random() if random is None: return 0 value = tpm.computeSignature(random) result = decrypt_block(value, l3k) if result is None: return 0 if result [80:88] != random: return 0 return 1 except: return 0
def configStrings(iface): try: device = open("/proc/stb/info/model", "r").readline().strip() except: device = "" device = "dm7025" 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
def main(session, **kwargs): 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: print "l2cert not found" return l2key = validate_cert(l2cert, rootkey) if l2key is None: print "l2cert invalid" return l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT) if l3cert is None: print "l3cert not found (can be fixed by running the genuine receiver plugin and running the offered update)" return l3key = validate_cert(l3cert, l2key) if l3key is None: print "l3cert invalid" return rnd = read_random() if rnd is None: print "random error" return val = etpm.challenge(rnd) result = decrypt_block(val, l3key) if device == "dm7025" or result[80:88] == rnd: print "successfully finished the tpm test"
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
def tpm_check(): try: tpm = eTPM() 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", ":", "?", ] random = None result = None l2r = False l2k = None l3k = None l2c = tpm.getData(eTPM.DT_LEVEL2_CERT) if l2c is None: return 0 l2k = validate_certificate(l2c, rootkey) if l2k is None: return 0 l3c = tpm.getData(eTPM.DT_LEVEL3_CERT) if l3c is None: return 0 l3k = validate_certificate(l3c, l2k) if l3k is None: return 0 random = get_random() if random is None: return 0 value = tpm.computeSignature(random) result = decrypt_block(value, l3k) if result is None: return 0 if result[80:88] != random: return 0 return 1 except: return 0
# for localized messages from . import _ config.plugins.yttrailer = ConfigSubsection() config.plugins.yttrailer.best_resolution = ConfigSelection(default="2", choices = [("0", _("1080p")),("1", _("720p")), ("2", _("No HD streaming"))]) config.plugins.yttrailer.ext_descr = ConfigText(default="german", fixed_size = False) config.plugins.yttrailer.max_results = ConfigInteger(5,limits = (1, 10)) config.plugins.yttrailer.close_player_with_exit = ConfigBoolean(False) from Screens.EventView import EventViewBase baseEventViewBase__init__ = None from Screens.EpgSelection import EPGSelection baseEPGSelection__init__ = None etpm = eTPM() def autostart(reason, **kwargs): global l2key l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT) if l2cert: l2key = validate_cert(l2cert, rootkey) if l2key: global baseEventViewBase__init__, baseEPGSelection__init__ if baseEventViewBase__init__ is None: baseEventViewBase__init__ = EventViewBase.__init__ EventViewBase.__init__ = EventViewBase__init__ EventViewBase.showTrailer = showTrailer EventViewBase.showTrailerList = showTrailerList EventViewBase.showConfig = showConfig
def getUpdates(self, callback=None): if self.lastDownloadDate is None: etpm = eTPM() l2cert = etpm.getData(eTPM.DT_LEVEL2_CERT) if l2cert is None: return l2key = validate_cert(l2cert, rootkey) if l2key is None: return l3cert = etpm.getData(eTPM.DT_LEVEL3_CERT) if l3cert is None: return l3key = validate_cert(l3cert, l2key) if l3key is None: return rnd = read_random() if rnd is None: return val = etpm.computeSignature(rnd) result = decrypt_block(val, l3key) if result[80:88] == rnd: if self.NetworkConnectionAvailable == True: self.lastDownloadDate = time() if self.list_updating is False and callback is None: self.list_updating = True self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) elif self.list_updating is False and callback is not None: self.list_updating = True self.NotifierCallback = callback self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) elif self.list_updating is True and callback is not None: self.NotifierCallback = callback else: self.list_updating = False if callback is not None: callback(False) elif self.NotifierCallback is not None: self.NotifierCallback(False) else: self.NetworkConnectionAvailable = False self.list_updating = False if callback is not None: callback(False) elif self.NotifierCallback is not None: self.NotifierCallback(False) else: if self.NetworkConnectionAvailable == True: self.lastDownloadDate = time() if self.list_updating is False and callback is None: self.list_updating = True self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) elif self.list_updating is False and callback is not None: self.list_updating = True self.NotifierCallback = callback self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) elif self.list_updating is True and callback is not None: self.NotifierCallback = callback else: if self.list_updating and callback is not None: etpm = eTPM() l2cert = etpm.getData(eTPM.DT_LEVEL2_CERT) if l2cert is None: return l2key = validate_cert(l2cert, rootkey) if l2key is None: return l3cert = etpm.getData(eTPM.DT_LEVEL3_CERT) if l3cert is None: return l3key = validate_cert(l3cert, l2key) if l3key is None: return rnd = read_random() if rnd is None: return val = etpm.computeSignature(rnd) result = decrypt_block(val, l3key) if result[80:88] == rnd: self.NotifierCallback = callback self.startIpkgListAvailable() else: self.list_updating = False if callback is not None: callback(False) elif self.NotifierCallback is not None: self.NotifierCallback(False)
from twisted.internet import reactor, ssl from twisted.internet.error import CannotListenError from twisted.web import server, http, util, static, resource from zope.interface import Interface, implements from socket import gethostname as socket_gethostname from OpenSSL import SSL, crypto from time import gmtime from os.path import isfile as os_isfile, exists as os_exists from __init__ import _, __version__, decrypt_block from webif import get_random, validate_certificate import random, uuid, time, hashlib tpm = eTPM() 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', ':', '?'] hw = HardwareInfo() #CONFIG INIT #init the config config.plugins.Webinterface = ConfigSubsection() config.plugins.Webinterface.enabled = ConfigYesNo(default=True) config.plugins.Webinterface.show_in_extensionsmenu = ConfigYesNo(default = False) config.plugins.Webinterface.allowzapping = ConfigYesNo(default=True) config.plugins.Webinterface.includemedia = ConfigYesNo(default=False) config.plugins.Webinterface.autowritetimer = ConfigYesNo(default=False) config.plugins.Webinterface.loadmovielength = ConfigYesNo(default=True) config.plugins.Webinterface.version = ConfigText(__version__) # used to make the versioninfo accessible enigma2-wide, not confgurable in GUI. config.plugins.Webinterface.http = ConfigSubsection()
def getUpdates(self, callback = None): if self.lastDownloadDate is None: etpm = eTPM() l2cert = etpm.getData(eTPM.DT_LEVEL2_CERT) if l2cert is None: return l2key = validate_cert(l2cert, rootkey) if l2key is None: return l3cert = etpm.getData(eTPM.DT_LEVEL3_CERT) if l3cert is None: return l3key = validate_cert(l3cert, l2key) if l3key is None: return rnd = read_random() if rnd is None: return val = etpm.computeSignature(rnd) result = decrypt_block(val, l3key) if result[80:88] == rnd: if self.NetworkConnectionAvailable == True: self.lastDownloadDate = time() if self.list_updating is False and callback is None: self.list_updating = True self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) elif self.list_updating is False and callback is not None: self.list_updating = True self.NotifierCallback = callback self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) elif self.list_updating is True and callback is not None: self.NotifierCallback = callback else: self.list_updating = False if callback is not None: callback(False) elif self.NotifierCallback is not None: self.NotifierCallback(False) else: self.NetworkConnectionAvailable = False self.list_updating = False if callback is not None: callback(False) elif self.NotifierCallback is not None: self.NotifierCallback(False) else: if self.NetworkConnectionAvailable == True: self.lastDownloadDate = time() if self.list_updating is False and callback is None: self.list_updating = True self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) elif self.list_updating is False and callback is not None: self.list_updating = True self.NotifierCallback = callback self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) elif self.list_updating is True and callback is not None: self.NotifierCallback = callback else: if self.list_updating and callback is not None: etpm = eTPM() l2cert = etpm.getData(eTPM.DT_LEVEL2_CERT) if l2cert is None: return l2key = validate_cert(l2cert, rootkey) if l2key is None: return l3cert = etpm.getData(eTPM.DT_LEVEL3_CERT) if l3cert is None: return l3key = validate_cert(l3cert, l2key) if l3key is None: return rnd = read_random() if rnd is None: return val = etpm.computeSignature(rnd) result = decrypt_block(val, l3key) if result[80:88] == rnd: self.NotifierCallback = callback self.startIpkgListAvailable() else: self.list_updating = False if callback is not None: callback(False) elif self.NotifierCallback is not None: self.NotifierCallback(False)