You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there is a mistake in v4.5.0 relay_tx_check_decode_ack() where the WOR channel frequency and datarate is used to calculate the ACK MIC, instead of the frequency and datarate extracted from the WOR frame that is being acknowledged.
constrelay_tx_channel_config_t*conf=
( infos->last_ch_idx==0 ) ? &infos->default_ch_config : &( infos->relay_tx_config.second_ch );
wor_ack_mic_info_tack_mic_info= {
.dev_addr=lorawan_api_devaddr_get( relay_stack_id ),
.wfcnt=infos->fcnt,
.frequency_hz=conf->freq_hz,
.datarate=conf->dr,
};
// SMTC_MODEM_HAL_TRACE_PRINTF( "frequency_hz = %d, infos->last_ch_idx = %d , .dev_addr = %x, datarate = %d\n",// conf->ack_freq_hz,infos->last_ch_idx,lorawan_api_devaddr_get( relay_stack_id ),conf->dr);// Key is set to NULL because it is already save in the crypto element (soft or hard)constuint32_tmic_calc=wor_compute_mic_ack( &ack_mic_info, infos->buffer, NULL );
The values are set in ack_mic_info which is then passed to wor_compute_mic_ack().
Thank you very much for you feedback.
After confirmation with LoRa Alliance members, the expected behavior is the one you implemented.
Similarly to the layer2 spec evolution, the intend is to add physical layer elements to the MIC. This reduces the risk of replay attack of the same frame on a different frequency and data rate.
I think there is a mistake in v4.5.0
relay_tx_check_decode_ack()
where the WOR channel frequency and datarate is used to calculate the ACK MIC, instead of the frequency and datarate extracted from the WOR frame that is being acknowledged.The values are set in
ack_mic_info
which is then passed towor_compute_mic_ack()
.Line 793 of TS011-1.0.0 defines the MIC as:
CMAC = aes128_cmac(WorSIntKey, B0 | AckUplinkEnc | WOR | pad16)
Table 20 shows how to make WOR.
Line 797 immediately before table 20 says:
WOR contains the data received in the WOR Relay Class A Uplink and is defined as:
The text was updated successfully, but these errors were encountered: