Skip to content

Commit

Permalink
Modify old amf integrity check parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
iamelisahi committed Sep 5, 2023
1 parent 7119aee commit f4ec325
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/nas/nas_security/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ func Decode(ue *context.AmfUe, accessType models.AccessType, payload []byte,
ulCountNew := ue.ULCount

msg = new(nas.Message)
msg.ProtocolDiscriminator = payload[0]
msg.SecurityHeaderType = nas.GetSecurityHeaderType(payload) & 0x0f
msg.ProtocolDiscriminator = payload[0] & 0x0f
ue.NASLog.Traceln("securityHeaderType is ", msg.SecurityHeaderType)
if msg.SecurityHeaderType != nas.SecurityHeaderTypePlainNas { // Security protected NAS message
// Extended protocol discriminator V 1
Expand All @@ -141,7 +141,7 @@ func Decode(ue *context.AmfUe, accessType models.AccessType, payload []byte,
ue.NASLog.Traceln("securityHeader is ", securityHeader)
sequenceNumber := payload[6]
ue.NASLog.Traceln("sequenceNumber", sequenceNumber)
msg.SequenceNumber = sequenceNumber & 0x0f
msg.SequenceNumber = sequenceNumber
receivedMac32 := securityHeader[2:]
msg.MessageAuthenticationCode = binary.BigEndian.Uint32(receivedMac32)
// remove security Header except for sequece Number
Expand Down

0 comments on commit f4ec325

Please sign in to comment.