Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/free5gc/ausf

go 1.25.5
go 1.26.2

require (
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/bronze1man/radius v0.0.0-20190516032554-afd8baec892d
github.com/free5gc/openapi v1.2.3
github.com/free5gc/util v1.3.1
github.com/free5gc/openapi v1.2.4
github.com/free5gc/util v1.3.2
github.com/gin-gonic/gin v1.10.0
github.com/google/gopacket v1.1.19
github.com/google/uuid v1.6.0
Expand All @@ -27,9 +27,9 @@ require (
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/free5gc/aper v1.1.0 // indirect
github.com/free5gc/nas v1.2.2 // indirect
github.com/free5gc/ngap v1.1.2 // indirect
github.com/free5gc/aper v1.1.1 // indirect
github.com/free5gc/nas v1.2.3 // indirect
github.com/free5gc/ngap v1.1.3 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/free5gc/aper v1.1.0 h1:X36hts0PYQuN3d+VXpYsUZaibrokP8nbBVIQBVY2bNI=
github.com/free5gc/aper v1.1.0/go.mod h1:v7xVwA5XaD9lBnZDOzvDF0Nw6GOcn32IrL7tM6zHPyM=
github.com/free5gc/nas v1.2.2 h1:r2+9CHY1TRfTM/X2Pc+vBizeqweUJRuLo1DGub1vk5s=
github.com/free5gc/nas v1.2.2/go.mod h1:y3f4YCGsvQOqQx8h+4MH22k0C8XaopK2ZP/F7qAW98k=
github.com/free5gc/ngap v1.1.2 h1:AA+s9+eaE8fSTnmBbh1xiD3VPaszonCd7AQJGKX5PHM=
github.com/free5gc/ngap v1.1.2/go.mod h1:4HYtB+msoTBc3cEPlSr4ZUUHn3BFZhdPuVASERMzVeI=
github.com/free5gc/openapi v1.2.3 h1:w4TmYBR8TUE4ZgKo7eiMZbyZPURSBFlMWiFeX+OsiA8=
github.com/free5gc/openapi v1.2.3/go.mod h1:fLvaBtUZrvrzkKrmn5Aza+JNbpWnp3kxKixu6kLSD3k=
github.com/free5gc/util v1.3.1 h1:5j5Exvp42Ow3zNP2aaAp68MSne6BcaCF4/cekXYUS6w=
github.com/free5gc/util v1.3.1/go.mod h1:qsv/ez8YhI+pO8bjNiZWXc2xmRE3XuEIa0EDTCPkSy0=
github.com/free5gc/aper v1.1.1 h1:O1WHg8J/Ab+TtpYuDjdUkoVv1dpR/K7L1/edP9+OujI=
github.com/free5gc/aper v1.1.1/go.mod h1:erN7J8emgUvCFydYcPhHtknRfeHocPRJuGldpvXLE5I=
github.com/free5gc/nas v1.2.3 h1:vMA9NGORw0zr26vQWWSTy8X9HrA+wGxFvwc2g9KqUTw=
github.com/free5gc/nas v1.2.3/go.mod h1:A8ODi6MW0fRJiLEH4GcUPbg3dd9xm3zi+fkBWqTjQ40=
github.com/free5gc/ngap v1.1.3 h1:uT+IE5PkWOYjPdxCyOAwLDOXUiADcOQCs05CudyC36s=
github.com/free5gc/ngap v1.1.3/go.mod h1:yGMO2GYV5DbbmudwD7Oo6dXQgz2ON29GhqtXDeXdyvA=
github.com/free5gc/openapi v1.2.4 h1:uhyaTggUhd9xgMFcs5y2rCqFOfXuv6Zsr+cLUU/x6gs=
github.com/free5gc/openapi v1.2.4/go.mod h1:V9CKQUqWp6kXL3SDtaIs4ZWeLipk5TSRXCnt+ntNceg=
github.com/free5gc/util v1.3.2 h1:3BjZq050WbaLJY0w1Bn51YZlCirs2ARoCUxD3LDSdbo=
github.com/free5gc/util v1.3.2/go.mod h1:wXObe2iF465VRdkE1Z5YkiSuHXlCT8HJ+yc7p9t5hMs=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
Expand Down
35 changes: 24 additions & 11 deletions internal/sbi/processor/ue_authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
Nudm_UEAuthentication "github.com/free5gc/openapi/udm/UEAuthentication"
"github.com/free5gc/util/metrics/sbi"
"github.com/free5gc/util/ueauth"
"github.com/free5gc/util/validator"
)

func (p *Processor) HandleEapAuthComfirmRequest(c *gin.Context, eapSession models.EapSession, eapSessionId string) {
Expand Down Expand Up @@ -309,6 +310,28 @@ func (p *Processor) UeAuthPostRequestProcedure(c *gin.Context, updateAuthenticat
authInfoResult := *result

ueid := authInfoResult.Supi
var eapAkaPrimeIdentity string
if authInfoResult.AuthType == models.UdmUeauAuthType_EAP_AKA_PRIME {
if !validator.IsValidSupi(ueid) {
err := fmt.Errorf("malformed SUPI %q", ueid)
logger.UeAuthLog.Warnf("invalid SUPI in UDM EAP-AKA' response: %+v", err)
problemDetails := models.ProblemDetails{
Title: "Malformed UDM SUPI",
Cause: "MALFORMED_UDM_SUPI",
Detail: err.Error(),
Status: http.StatusBadGateway,
}
c.Set(sbi.IN_PB_DETAILS_CTX_STR, problemDetails.Cause)
c.JSON(http.StatusBadGateway, problemDetails)
return
}
eapAkaPrimeIdentity = ueid
if !self.EapAkaSupiImsiPrefix {
// TS 33.501 v15.9.0 or later uses the IMSI digits without the "imsi-" prefix.
eapAkaPrimeIdentity = strings.TrimPrefix(ueid, "imsi-")
}
}

ausfUeContext := ausf_context.NewAusfUeContext(ueid)
ausfUeContext.ServingNetworkName = snName
ausfUeContext.AuthStatus = models.AusfUeAuthenticationAuthResult_ONGOING
Expand Down Expand Up @@ -395,17 +418,7 @@ func (p *Processor) UeAuthPostRequestProcedure(c *gin.Context, updateAuthenticat
logger.UeAuthLog.Infoln("Use EAP-AKA' auth method")
putLink += "/eap-session"

var identity string
// TODO support more SUPI type
if ueid[:4] == "imsi" {
if !self.EapAkaSupiImsiPrefix {
// 33.501 v15.9.0 or later
identity = ueid[5:]
} else {
// 33.501 v15.8.0 or earlier
identity = ueid
}
}
identity := eapAkaPrimeIdentity
ikPrime := authInfoResult.AuthenticationVector.IkPrime
ckPrime := authInfoResult.AuthenticationVector.CkPrime
RAND := authInfoResult.AuthenticationVector.Rand
Expand Down
Loading