Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions internal/nas/nas_security/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@

msg = new(nas.Message)
msg.ProtocolDiscriminator = payload[0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the unnecessary newline.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolve

if len(payload) < 2 {
Comment thread
Alonza0314 marked this conversation as resolved.
Outdated
return nil, false, fmt.Errorf("malformed NAS PDU")

Check failure on line 139 in internal/nas/nas_security/security.go

View workflow job for this annotation

GitHub Actions / lint (1.24)

File is not properly formatted (gci)
}

msg.SecurityHeaderType = nas.GetSecurityHeaderType(payload) & 0x0f
ue.NASLog.Traceln("securityHeaderType is ", msg.SecurityHeaderType)
if msg.SecurityHeaderType != nas.SecurityHeaderTypePlainNas { // Security protected NAS message
Expand Down Expand Up @@ -362,6 +367,11 @@
}

msg := new(nas.Message)

if len(payload) < 2 {
Comment thread
Alonza0314 marked this conversation as resolved.
return nil, fmt.Errorf("malformed NAS PDU")
}

msg.SecurityHeaderType = nas.GetSecurityHeaderType(payload) & SecurityHeaderTypeMask
if msg.SecurityHeaderType == nas.SecurityHeaderTypeIntegrityProtectedAndCiphered ||
msg.SecurityHeaderType == nas.SecurityHeaderTypeIntegrityProtectedAndCipheredWithNew5gNasSecurityContext {
Expand Down
Loading