Fix RRCReestablishment key derivation to use horizontal derivation
Per TS 33.501 6.9.2.3.4 and Fig 6.9.2.1.1-1, when sending RRCReestablishment with nextHopChainingCount, the gNB is staying at the same NCC level (not advancing). Therefore, horizontal derivation from the currently active KgNB must be used, not vertical derivation from NH. Vertical derivation (from NH) is only used when advancing to a new NCC level, which happens during handover or masterKeyUpdate procedures. The previous implementation incorrectly used vertical derivation from NH whenever nh_ncc > 0, which caused key mismatch between gNB and UE during reestablishment after handover, leading to integrity check failures. This fix ensures both gNB and UE use horizontal derivation when nextHopChainingCount matches the current NCC level, aligning with the specification's "virtual NH at NCC=0" model where: - Horizontal derivation = derive KNG-RAN* from currently active KgNB - Vertical derivation = derive KNG-RAN* from NH (only when advancing NCC)
Showing
Please register or sign in to comment