NAS MAC verification failed

Hi, Free5gc Team,

The free5gc in testing is of version 3.0.4, which is a upgrade from version 3.0.2. We run two machines, one for a free5gc with n3iwf (configuration file: runfree5gc.tar (10 KB) ) and the other for an UE (configuration file:runue.tar (10 KB) ).

We first ran the free5gc and then the UE. A NAC MAC verification failure occurred. Mainly, the following messages show.

2020-11-06T09:43:28+08:00 [WARN][AMF][NAS] NAS MAC verification failed(received: 0x6582a425, expected: 0x992991ad)
2020-11-06T09:43:28+08:00 [INFO][AMF][Gmm] [AMF] Handle Security Mode Complete
2020-11-06T09:43:28+08:00 [ERRO][AMF][Gmm] NAS message integrity check failed

The detailed logs are in the following.

We also notice that the nas security part in version 3.0.2 is set to false by default in the nas security.go file. It may have something to do with amfcfg.conf.

Therefore, we tried to set different values of security parameters such as cipheringOrder and integrityOrder. Yet, it did not work.

Since UE runs Non3GPP test to enable the UE function, we also doubted the amfcfg.conf at UE side matters. That is, we also varied the values of cipheringOrder and integrityOrder.

Did you have any experience on addressing such an issue?

I also see the same issue. Do we have any workaround for this?

Hello,

Did you manage to solve this? Iḿ having the same issue here. If you have any recommendation I would really appreciate it.

Hi, @kueilihuang,
I saw your UE is named TestITRIF5GC01Non3GPPUE. Please provide more detailed information of the UE and pcap files from tcpdump.

If the UE is implemented by yourself. Does this UE conform to the latest 3GPP R15.3? This condition is similar to the NAS connection ID problem mentioned in github issue 210. If your N3UE is implemented according to the latest R15.3, the integrity checking will fail. Because there is a clerical error in the earlier R15.3 spec to which free5GC refers. Please follow the latest free5GC. we will fix this problem recently.

We have fixed the problems about N3IWF mentioned in GitHub issue 210.
Please update free5GC to v3.0.6.