Hello, this is the Blowing Nose.
We're approaching the final stretch of our journey into SecOC.
Today, I'll be delving into what I consider the most complex aspect of the receiving end: Fv Construction.
In our previous session, we learned that to construct Fv, we need Recv Fv, Latest Fv, and Previous Fv. Before diving into the main topic, let's have a quick review:
- Recv Fv : Received from the Secure Message, it's a Truncated Value, not the Full Fv.
- Latest Fv : Received from the Sync Message, it contains Trip Counter and Reset Counter information.
- Previous Fv : It's the value from the previous MAC generation and verification, containing the Full Fv.
The Autosar Spec provides the following table to guide us in constructing Fv.
Now, let's analyze the table step by step.
1. Reset Flag Identical Case
First, we compare the Reset Flags of Latest Fv and Recv Fv.
In other words, we check whether the information sent by the sender (Received) matches the information I received through the Sync Message (Latest).
Why do we perform this comparison?
You will understand why we do this when we explain how to handle cases where these two values are different, which we will cover later.
1.1. Trip/Reset Counter Identical Case
Secondly, we check if the Trip Counter and Reset Counter in Latest Fv match the values of the Previous Trip Counter and Reset Counter.
What does it mean if they match?
It means that we haven't received a new Sync Message yet.
*Note: When we receive a new Sync Message, at least the Reset Counter should be different.
Since we haven't received a new Sync Message, we reuse the Previous values for the Trip Counter and Reset Counter in Construct Fv.
1.1.1. Message Counter No Carry Case
Now we compare the Message Counter in Recv Fv with the lower bits of the Message Counter in Previous Fv.
For example, if the Truncated Message Counter is 4 bits,
we compare "Recv Fv's Message Counter" vs. "Previous Fv's Message Counter & 0x0F."
If the Recv value is greater, then the Construct Message Counter is updated based on the Recv value.
Here's a simple example:
Input:
- Recv Fv = 0x3
- Previous Fv = 0x2
Result:
- Construct Fv Message Counter Upper = 0x00 (remains the same as previous)
- Construct Fv Message Counter Lower = 0x3 (updated to the Recv value)
1.1.2. Message Counter With Carry Case
If the values are as follows, how would you determine the outcome?
Input:
- Recv Fv = 0x0
- Previous Fv = 0xF
In this case, it appears that Recv Fv has wrapped around after reaching the maximum value of a 4-bit counter and has started from 0 again.
Therefore, it should be handled as follows.
Result:
- Construct Fv Message Counter Upper = 0x01(updated to the previous + 1)
- Construct Fv Message Counter Lower = 0x0(updated to the Recv value )
1.2. Trip/Reset Counter Not same Case
What does it mean when the Latest Value differs from the Previous Value?
The fact that the Latest Value is different from the Previous Value means that a new Sync Message has been received. However, if the newly received Latest Value is smaller, it indicates that incorrect information has been received. Therefore, processing only occurs when the Latest Value is larger.
In this case, both the Trip Counter and Reset Counter are updated with the Latest Value, and the Message Counter is reset and updated with the Recv Value.
2. the Latest Reset Flag is 1 greater than the Received Reset Flag
Returning to the first condition, what does it mean when the Latest Reset Flag is 1 greater than the Received Reset Flag?
It means that the information in the Sync Message sent by the Secure Message sender is one step behind the Sync Message information I have.
In other words, the sender of the Secure Message calculated and sent the MAC based on the previous Sync Message, so when the receiving end constructs the Fv, it uses the previous information as a reference.
Therefore, all subsequent Latest Values will operate based on a value that is reduced by 1.
All other concepts remain the same as explained in the "1.Reset Flag Identical Case"
3. the Latest Reset Flag is 1 less than the Receive Reset Flag
In this case, it means that the Sync Message information sent by the Secure Message sender is one step ahead of the Sync Message information I have, indicating that I haven't received the latest Sync Message yet.
The rest of the procedures remain the same.
Returning to the Autosar table for Reset Flag Comparison, we can see that Autosar SecOC allows a synchronization tolerance of up to ±2. Differences greater than this are likely considered to be indicative of an issue other than synchronization problems.
Today, we have completed the process of constructing the Freshness Value from the perspective of the receiving end.
Most of the content related to SecOC is now finished, and in the next session, we will briefly explore some additional topics before concluding.
Thank you.
'CyberSecurity > SecureOnCAN[Eng]' 카테고리의 다른 글
6. Recv Secure Message (0) | 2023.12.17 |
---|---|
5. Send Secure Message (0) | 2023.12.15 |
4. Freshness Value - Secure Message Sender Side (0) | 2023.12.09 |
3. Sync Message (0) | 2023.12.09 |
2. SecOC - Key Characters (0) | 2023.12.09 |