diff --git a/selfdrive/car/card.py b/selfdrive/car/card.py index 3ed835a1f5..db89da262f 100755 --- a/selfdrive/car/card.py +++ b/selfdrive/car/card.py @@ -125,6 +125,15 @@ class Car: self.CP.safetyConfigs = [safety_config] if self.CP.secOcRequired and not self.params.get_bool("IsReleaseBranch"): + # Copy user key if available + try: + with open("/cache/params/SecOCKey") as f: + user_key = f.readline().strip() + if len(user_key) == 32: + self.params.put("SecOCKey", user_key) + except Exception: + pass + secoc_key = self.params.get("SecOCKey", encoding='utf8') if secoc_key is not None: saved_secoc_key = bytes.fromhex(secoc_key.strip())