HAB SRK revoke

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HAB SRK revoke

2,496 Views
yosri_c
Contributor IV

Hello NXP Support,

I'm using an RT1176 board with HABv4 (CST 4.0.1). I currently have my image signed using SRK1, but I need to switch to using SRK2 instead. (we're trying to test the image with SRK2 before revoking SRK1)

In my current CSF file, I have:

text 
 

[Install SRK]
File = "..\..\crts\SRK_1_2_3_4_table.bin"
Source index = 0

[Install CSFK]
File = "CSF1_1_sha256_secp256r1_v3_usr_crt.pem"

[Authenticate CSF]

 

[Install Key]
Verification index = 0
Target index = 2
File = "IMG1_1_sha256_secp256r1_v3_usr_crt.pem"

[Authenticate Data]
Verification index = 2
Engine = CAAM
Engine Configuration = 0
Blocks = 0x80000000 0x0 0x8000 "BOOT.bin"

 

Could you please explain:

  1. What is the simplest way to change from SRK1 to SRK2?

  2. What changes do I need to make in my CSF file?

  3. Do I only need to change the Source index in [Install SRK] from 0 to 1?

Thank you for your help.

Tags (1)
0 Kudos
Reply
4 Replies

2,438 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Yes, the simplest way to change from using SRK1 to SRK2 is to modify the Source index parameter in the [Install SRK] section of your CSF file from 0 to 1.

In your current CSF file:
```
[Install SRK]
File = "..\..\crts\SRK_1_2_3_4_table.bin"
Source index = 0
```

You should change this to:
```
[Install SRK]
File = "..\..\crts\SRK_1_2_3_4_table.bin"
Source index = 1
```

The Source index parameter determines which key in the SRK table will be used. Index 0 corresponds to SRK1, index 1 to SRK2, and so on.

You will also need to reference the appropriate certificate files for CSF2 and IMG2 instead of CSF1 and IMG1 in your CSF file, replacing:
- "CSF1_1_sha256_secp256r1_v3_usr_crt.pem" with "CSF2_1_sha256_secp256r1_v3_usr_crt.pem"
- "IMG1_1_sha256_secp256r1_v3_usr_crt.pem" with "IMG2_1_sha256_secp256r1_v3_usr_crt.pem"

This approach allows you to test using SRK2 before permanently revoking SRK1.

Regards

2,277 Views
yosri_c
Contributor IV

@Bio Thank you for your previous clarifications.

I have a critical follow-up regarding the security logic and the SRK migration process during a firmware update.

Our Current Scenario: Normal Boot: The device boots using SRK1 (Index 0). The chain of trust is fully established: ROM -> Bootloader (SRK1) -> Application (SRK1).

Firmware Update: While the system is running under the trust of SRK1, we download a new full image (BS + App) into SDRAM, signed with SRK2 (Index 1).

Verification: The currently running Bootloader calls hab_rvt.authenticate_image() to verify the new image in SDRAM.

My questions are:

1. Regarding runtime SRK switching: Can you confirm that the HAB library allows the execution of a new [Install SRK] command with Source index = 1 (SRK2) within the same power cycle, even if SRK1 was used for the initial boot?

2. Regarding revocation in the same cycle: Would it be possible, during this update process, to revoke SRK1 (by burning the SRK_REVOKE eFuse), then install SRK2 and perform the verification of the new RAM image, all within the same power cycle? Thank you

Tags (1)
0 Kudos
Reply

2,049 Views
yosri_c
Contributor IV

@Bio_TICFSL 

can you assist  please , anything would be helpful 

Thank you 

0 Kudos
Reply

2,472 Views
yosri_c
Contributor IV

i tried changing 

[Install SRK]
File = "SRK_1_2_3_4_table.bin"
Source index = 1

[Install CSFK]
File = "CSF2_1_sha256_secp256r1_v3_usr_crt.pem"

[Install Key]
Verification index = 0
Target index = 2
File = "IMG2_1_sha256_secp256r1_v3_usr_crt.pem"  

 

to eventually use SRK 2 but i get these events 

 

yosri_c_1-1765463880990.png

 

Tags (1)
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2260148%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHAB%20SRK%20revoke%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2260148%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%20class%3D%22%22%3E%3CSPAN%3EHello%20NXP%20Support%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3E%3CSPAN%3EI'm%20using%20an%20RT1176%20board%20with%20HABv4%20(CST%204.0.1).%20I%20currently%20have%20my%20image%20signed%20using%20SRK1%2C%20but%20I%20need%20to%20switch%20to%20using%20SRK2%20instead.%20(we're%20trying%20to%20test%20the%20image%20with%20SRK2%20before%20revoking%20SRK1)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3E%3CSPAN%3EIn%20my%20current%20CSF%20file%2C%20I%20have%3A%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3Etext%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%5BInstall%20SRK%5D%3CBR%20%2F%3EFile%20%3D%20%22..%5C..%5Ccrts%5CSRK_1_2_3_4_table.bin%22%3CBR%20%2F%3ESource%20index%20%3D%200%3C%2FP%3E%3CP%3E%5BInstall%20CSFK%5D%3CBR%20%2F%3EFile%20%3D%20%22CSF1_1_sha256_secp256r1_v3_usr_crt.pem%22%3C%2FP%3E%3CP%3E%5BAuthenticate%20CSF%5D%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%5BInstall%20Key%5D%3CBR%20%2F%3EVerification%20index%20%3D%200%3CBR%20%2F%3ETarget%20index%20%3D%202%3CBR%20%2F%3EFile%20%3D%20%22IMG1_1_sha256_secp256r1_v3_usr_crt.pem%22%3C%2FP%3E%3CP%3E%5BAuthenticate%20Data%5D%3CBR%20%2F%3EVerification%20index%20%3D%202%3CBR%20%2F%3EEngine%20%3D%20CAAM%3CBR%20%2F%3EEngine%20Configuration%20%3D%200%3CBR%20%2F%3EBlocks%20%3D%200x80000000%200x0%200x8000%20%22BOOT.bin%22%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22%22%3E%3CSPAN%3ECould%20you%20please%20explain%3A%3C%2FSPAN%3E%3C%2FP%3E%3COL%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSPAN%3EWhat%20is%20the%20simplest%20way%20to%20change%20from%20SRK1%20to%20SRK2%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSPAN%3EWhat%20changes%20do%20I%20need%20to%20make%20in%20my%20CSF%20file%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%3CSPAN%3EDo%20I%20only%20need%20to%20change%20the%20%3C%2FSPAN%3ESource%20index%3CSPAN%3E%20in%20%3C%2FSPAN%3E%5BInstall%20SRK%5D%3CSPAN%3E%20from%20%3C%2FSPAN%3E0%3CSPAN%3E%20to%20%3C%2FSPAN%3E1%3CSPAN%3E%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%20class%3D%22%22%3E%3CSPAN%3EThank%20you%20for%20your%20help.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2260320%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HAB%20SRK%20revoke%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2260320%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ei%20tried%20changing%26nbsp%3B%3C%2FP%3E%3CP%3E%5BInstall%20SRK%5D%3CBR%20%2F%3EFile%20%3D%20%22SRK_1_2_3_4_table.bin%22%3CBR%20%2F%3ESource%20index%20%3D%201%3C%2FP%3E%3CP%3E%5BInstall%20CSFK%5D%3CBR%20%2F%3EFile%20%3D%20%22CSF2_1_sha256_secp256r1_v3_usr_crt.pem%22%3C%2FP%3E%3CP%3E%5BInstall%20Key%5D%3CBR%20%2F%3EVerification%20index%20%3D%200%3CBR%20%2F%3ETarget%20index%20%3D%202%3CBR%20%2F%3EFile%20%3D%20%22IMG2_1_sha256_secp256r1_v3_usr_crt.pem%22%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3Eto%20eventually%20use%20SRK%202%20but%20i%20get%20these%20events%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22yosri_c_1-1765463880990.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yosri_c_1-1765463880990.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yosri_c_1-1765463880990.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yosri_c_1-1765463880990.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yosri_c_1-1765463880990.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369551i0898F08D74731ED9%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22yosri_c_1-1765463880990.png%22%20alt%3D%22yosri_c_1-1765463880990.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2261295%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HAB%20SRK%20revoke%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2261295%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYes%2C%20the%20simplest%20way%20to%20change%20from%20using%20SRK1%20to%20SRK2%20is%20to%20modify%20the%20Source%20index%20parameter%20in%20the%20%5BInstall%20SRK%5D%20section%20of%20your%20CSF%20file%20from%200%20to%201.%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20your%20current%20CSF%20file%3A%3CBR%20%2F%3E%60%60%60%3CBR%20%2F%3E%5BInstall%20SRK%5D%3CBR%20%2F%3EFile%20%3D%20%22..%5C..%5Ccrts%5CSRK_1_2_3_4_table.bin%22%3CBR%20%2F%3ESource%20index%20%3D%200%3CBR%20%2F%3E%60%60%60%3CBR%20%2F%3E%3CBR%20%2F%3EYou%20should%20change%20this%20to%3A%3CBR%20%2F%3E%60%60%60%3CBR%20%2F%3E%5BInstall%20SRK%5D%3CBR%20%2F%3EFile%20%3D%20%22..%5C..%5Ccrts%5CSRK_1_2_3_4_table.bin%22%3CBR%20%2F%3ESource%20index%20%3D%201%3CBR%20%2F%3E%60%60%60%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20Source%20index%20parameter%20determines%20which%20key%20in%20the%20SRK%20table%20will%20be%20used.%20Index%200%20corresponds%20to%20SRK1%2C%20index%201%20to%20SRK2%2C%20and%20so%20on.%3CBR%20%2F%3E%3CBR%20%2F%3EYou%20will%20also%20need%20to%20reference%20the%20appropriate%20certificate%20files%20for%20CSF2%20and%20IMG2%20instead%20of%20CSF1%20and%20IMG1%20in%20your%20CSF%20file%2C%20replacing%3A%3CBR%20%2F%3E-%20%22CSF1_1_sha256_secp256r1_v3_usr_crt.pem%22%20with%20%22CSF2_1_sha256_secp256r1_v3_usr_crt.pem%22%3CBR%20%2F%3E-%20%22IMG1_1_sha256_secp256r1_v3_usr_crt.pem%22%20with%20%22IMG2_1_sha256_secp256r1_v3_usr_crt.pem%22%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20approach%20allows%20you%20to%20test%20using%20SRK2%20before%20permanently%20revoking%20SRK1.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ERegards%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2266795%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HAB%20SRK%20revoke%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2266795%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%40Bio%20Thank%20you%20for%20your%20previous%20clarifications.%3C%2FP%3E%3CP%3EI%20have%20a%20critical%20follow-up%20regarding%20the%20security%20logic%20and%20the%20SRK%20migration%20process%20during%20a%20firmware%20update.%3C%2FP%3E%3CP%3EOur%20Current%20Scenario%3A%20Normal%20Boot%3A%20The%20device%20boots%20using%20SRK1%20(Index%200).%20The%20chain%20of%20trust%20is%20fully%20established%3A%20ROM%20-%26gt%3B%20Bootloader%20(SRK1)%20-%26gt%3B%20Application%20(SRK1).%3C%2FP%3E%3CP%3EFirmware%20Update%3A%20While%20the%20system%20is%20running%20under%20the%20trust%20of%20SRK1%2C%20we%20download%20a%20new%20full%20image%20(BS%20%2B%20App)%20into%20SDRAM%2C%20signed%20with%20SRK2%20(Index%201).%3C%2FP%3E%3CP%3EVerification%3A%20The%20currently%20running%20Bootloader%20calls%20hab_rvt.authenticate_image()%20to%20verify%20the%20new%20image%20in%20SDRAM.%3C%2FP%3E%3CP%3EMy%20questions%20are%3A%3C%2FP%3E%3CP%3E1.%20Regarding%20runtime%20SRK%20switching%3A%20Can%20you%20confirm%20that%20the%20HAB%20library%20allows%20the%20execution%20of%20a%20new%20%5BInstall%20SRK%5D%20command%20with%20Source%20index%20%3D%201%20(SRK2)%20within%20the%20same%20power%20cycle%2C%20even%20if%20SRK1%20was%20used%20for%20the%20initial%20boot%3F%3C%2FP%3E%3CP%3E2.%20Regarding%20revocation%20in%20the%20same%20cycle%3A%20Would%20it%20be%20possible%2C%20during%20this%20update%20process%2C%20to%20revoke%20SRK1%20(by%20burning%20the%20SRK_REVOKE%20eFuse)%2C%20then%20install%20SRK2%20and%20perform%20the%20verification%20of%20the%20new%20RAM%20image%2C%20all%20within%20the%20same%20power%20cycle%3F%20Thank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2268177%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HAB%20SRK%20revoke%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2268177%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F34846%22%20target%3D%22_blank%22%3E%40Bio_TICFSL%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecan%20you%20assist%26nbsp%3B%20please%20%2C%20anything%20would%20be%20helpful%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E