Skip to content

Commit

Permalink
Update ue_authentication.go
Browse files Browse the repository at this point in the history
kausf correction.
RES/XRES compare correction.
  • Loading branch information
fasferraz authored Jul 4, 2021
1 parent 048e447 commit 923de46
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions producer/ue_authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ func UeAuthPostRequestProcedure(updateAuthenticationInfo models.AuthenticationIn
Kausf := EMSK[0:32]
ausfUeContext.Kausf = Kausf
var KausfDecode []byte
if ausfDecode, err := hex.DecodeString(Kausf); err != nil {
// if ausfDecode, err := hex.DecodeString(Kausf); err != nil {
if ausfDecode, err := hex.DecodeString(fmt.Sprintf("%02x",Kausf)); err != nil {
logger.Auth5gAkaComfirmLog.Warnf("AUSF decode failed: %+v", err)
} else {
KausfDecode = ausfDecode
Expand Down Expand Up @@ -395,7 +396,8 @@ func EapAuthComfirmRequestProcedure(updateEapSession models.EapSession, eapSessi
"eap packet decode error", ausfCurrentContext.UdmUeauUrl)
failEapAkaNoti := ConstructFailEapAkaNotification(eapContent.Id)
responseBody.EapPayload = failEapAkaNoti
} else if XRES == string(RES) { // decodeOK && XRES == res, auth success
// } else if XRES == string(RES) { // decodeOK && XRES == res, auth success
} else if XRES == fmt.Sprintf("%02x",RES) { // decodeOK && XRES == res, auth success
logger.EapAuthComfirmLog.Infoln("Correct RES value, EAP-AKA' auth succeed")
responseBody.AuthResult = models.AuthResult_SUCCESS
eapSuccPkt := ConstructEapNoTypePkt(radius.EapCodeSuccess, eapContent.Id)
Expand Down

0 comments on commit 923de46

Please sign in to comment.