Preserve saved Toyota security keys during migration

This commit is contained in:
firestar5683
2026-11-15 22:39:13 -06:00
parent 6486b6b51d
commit 72aaecddcb
3 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ OPERATIONAL_KEYS = frozenset({
'DongleId', 'HardwareSerial', 'GithubSshKeys', 'GithubUsername', 'SshEnabled',
'AlphaLongitudinalEnabled', 'HasAcceptedTerms', 'CompletedTrainingVersion',
'CellularDisabled', 'GsmApn', 'GsmMetered', 'GsmRoaming', 'NetworkMetered', 'BluetoothEnabled',
'ConnectProvider', 'PairingProvider', 'PairingEmail', 'PrimeType', 'AssistNowToken', 'SecOCKey',
'ConnectProvider', 'PairingProvider', 'PairingEmail', 'PrimeType', 'AssistNowToken', 'SecOCKey', 'SecOCKeys',
})
@@ -76,6 +76,17 @@ class TestFirstStartMigration(unittest.TestCase):
self.assertNotIn('HasAcceptedTerms', self.values())
self.assertNotIn('CompletedTrainingVersion', self.values())
def test_security_key_library_survives_preference_reset_and_restart(self):
self.types['SecOCKeys'] = 'STRING'
library = b'[{"name":"family car","value":"abababababababababababababababab"}]'
original = {'SecOCKey': b'ab' * 16, 'SecOCKeys': library, 'SteerFriction': b'0.2'}
self.write(original)
self.start()
self.assertEqual(self.values(), {'SecOCKey': original['SecOCKey'], 'SecOCKeys': library})
self.assertEqual(migration.load_snapshot(next((self.storage / 'snapshots').iterdir())), original)
self.start()
self.assertEqual(self.values()['SecOCKeys'], library)
def test_alpha_longitudinal_preserves_both_values_and_later_changes(self):
for value in (b'0', b'1'):
with self.subTest(value=value), tempfile.TemporaryDirectory() as directory:
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "83237d06437bc81e92392b5a1195097519dab1837ab89231e5ffa09d7b60826f", "schema_version": 1}
{"protected_inventory_sha256": "4b56ae14d6ef04e25ad2d14af2db8eb05076511204b09a66cc4d74d1b970b848", "schema_version": 1}