Exemplo n.º 1
0
def test_get_signature(p):
    fn = DEFAULT_H7_FW_FN if p.get_mcu_type() == MCU_TYPE_H7 else DEFAULT_FW_FN

    firmware_sig = Panda.get_signature_from_firmware(fn)
    panda_sig = p.get_signature()

    assert_equal(panda_sig, firmware_sig)
Exemplo n.º 2
0
def test_get_signature(p):
    fn = os.path.join(BASEDIR, "board/obj/panda.bin.signed")

    firmware_sig = Panda.get_signature_from_firmware(fn)
    panda_sig = p.get_signature()

    assert_equal(panda_sig, firmware_sig)
Exemplo n.º 3
0
def get_expected_signature(fw_fn=None):
    if fw_fn is None:
        fw_fn = get_firmware_fn()
    try:
        return Panda.get_signature_from_firmware(fw_fn)
    except OSError:
        return b'None'
Exemplo n.º 4
0
def get_expected_signature(panda : Panda) -> bytes:
  fn = DEFAULT_H7_FW_FN if (panda.get_mcu_type() == MCU_TYPE_H7) else DEFAULT_FW_FN

  try:
    return Panda.get_signature_from_firmware(fn)
  except Exception:
    cloudlog.exception("Error computing expected signature")
    return b""
Exemplo n.º 5
0
def get_expected_signature(fw_fn=None):
  if fw_fn is None:
    fw_fn = get_firmware_fn()

  try:
    return Panda.get_signature_from_firmware(fw_fn)
  except Exception:
    cloudlog.exception("Error computing expected signature")
    return b""
Exemplo n.º 6
0
def get_expected_signature(fw_fn=None):
    if fw_fn is None:
        fw_fn = get_firmware_fn()

    return Panda.get_signature_from_firmware(fw_fn)
Exemplo n.º 7
0
def get_expected_signature() -> bytes:
    try:
        return Panda.get_signature_from_firmware(PANDA_FW_FN)
    except Exception:
        cloudlog.exception("Error computing expected signature")
        return b""