Install user SecOCKey to params (#34401)

* Install user SecOCKey to params

* Move it to launch_chffrplus.sh/launch

* Move it to card.py

* Basic error check

* Catch Exception to suppress the linter

* Make it local to secOC section
pull/34414/head
Calvin Park 3 months ago committed by GitHub
parent 7a1bf26aa5
commit 5509850986
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      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())

Loading…
Cancel
Save