Skip to content

Commit

Permalink
fix(ausf): fix member name of UeAuthenticationCtx.Links map
Browse files Browse the repository at this point in the history
  • Loading branch information
free5gc-org committed Sep 9, 2021
1 parent 8f3acc4 commit 55f0397
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions producer/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ func eapAkaPrimePrf(ikPrime string, ckPrime string, identity string) (string, st
// Create a new HMAC by defining the hash type and the key (as byte array)
h := hmac.New(sha256.New, key)

hexNum := string(i + 1)
ap := append(sBase, hexNum...)
hexNum := (byte)(i + 1)
ap := append(sBase, hexNum)
s := append(prev, ap...)

// Write Data to it
Expand Down
12 changes: 8 additions & 4 deletions producer/ue_authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,11 @@ func UeAuthPostRequestProcedure(updateAuthenticationInfo models.AuthenticationIn
av5gAka.Rand = authInfoResult.AuthenticationVector.Rand
av5gAka.Autn = authInfoResult.AuthenticationVector.Autn
av5gAka.HxresStar = hxresStar

responseBody.Var5gAuthData = av5gAka

linksValue := models.LinksValueSchema{Href: putLink}
responseBody.Links = make(map[string]models.LinksValueSchema)
responseBody.Links["5g-aka"] = linksValue
} else if authInfoResult.AuthType == models.AuthType_EAP_AKA_PRIME {
logger.UeAuthPostLog.Infoln("Use EAP-AKA' auth method")
putLink += "/eap-session"
Expand Down Expand Up @@ -271,11 +274,12 @@ func UeAuthPostRequestProcedure(updateAuthenticationInfo models.AuthenticationIn
eapPkt.Data = []byte(dataArrayAfterMAC)
encodedPktAfterMAC := eapPkt.Encode()
responseBody.Var5gAuthData = base64.StdEncoding.EncodeToString(encodedPktAfterMAC)

linksValue := models.LinksValueSchema{Href: putLink}
responseBody.Links = make(map[string]models.LinksValueSchema)
responseBody.Links["eap-session"] = linksValue
}

linksValue := models.LinksValueSchema{Href: putLink}
responseBody.Links = make(map[string]models.LinksValueSchema)
responseBody.Links["link"] = linksValue
responseBody.AuthType = authInfoResult.AuthType

return &responseBody, locationURI, nil
Expand Down

0 comments on commit 55f0397

Please sign in to comment.