diff --git a/producer/functions.go b/producer/functions.go index b1a5b44..a47e156 100644 --- a/producer/functions.go +++ b/producer/functions.go @@ -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 diff --git a/producer/ue_authentication.go b/producer/ue_authentication.go index 5116be9..83a2fbc 100644 --- a/producer/ue_authentication.go +++ b/producer/ue_authentication.go @@ -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" @@ -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