Skip to content

Commit

Permalink
Change ORC166 to allow 4 and 8 byte seeds
Browse files Browse the repository at this point in the history
Resolves #32
  • Loading branch information
jglim committed Nov 13, 2023
1 parent df1f825 commit 7f9a598
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
8 changes: 7 additions & 1 deletion UnlockECU/UnlockECU/Security/ORC166.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ public override bool GenerateKey(byte[] inSeed, byte[] outKey, int accessLevel,
byte[] cryptoKeyBytes = GetParameterBytearray(parameters, "staticKey");
uint cryptoKey = BytesToInt(cryptoKeyBytes, Endian.Big);

if ((inSeed.Length != 8) || (outKey.Length != 4))
if (outKey.Length != 4)
{
return false;
}
// Seed can be either 4 or 8 bytes. Only first 4 bytes are used
// https://github.com/jglim/UnlockECU/issues/32
if (!((inSeed.Length == 4) || (inSeed.Length == 8)))
{
return false;
}
Expand Down
16 changes: 16 additions & 0 deletions UnlockECU/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -9782,6 +9782,22 @@
}
]
},
{
"EcuName": "ORC166",
"Aliases": [],
"AccessLevel": 1,
"SeedLength": 4,
"KeyLength": 4,
"Provider": "ORC166",
"Origin": "ORC166_19_34_01_20190420120_@Flo354",
"Parameters": [
{
"Key": "staticKey",
"Value": "AC05E2B8",
"DataType": "ByteArray"
}
]
},
{
"EcuName": "ORC_172",
"Aliases": [],
Expand Down

0 comments on commit 7f9a598

Please sign in to comment.