diff --git a/go.mod b/go.mod index 9de207a..216c13b 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/antonfisher/nested-logrus-formatter v1.3.1 github.com/gin-gonic/gin v1.9.1 github.com/google/uuid v1.6.0 - github.com/omec-project/UeauCommon v1.1.0 github.com/omec-project/config5g v1.2.0 github.com/omec-project/http2_util v1.1.0 github.com/omec-project/http_wrapper v1.1.0 diff --git a/go.sum b/go.sum index cd88c9a..e3af203 100644 --- a/go.sum +++ b/go.sum @@ -188,8 +188,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= -github.com/omec-project/UeauCommon v1.1.0 h1:ynW22r/Xx/z6saviuzUeNjYlqdJfiMNtNwlv6Ot76Wk= -github.com/omec-project/UeauCommon v1.1.0/go.mod h1:brKbJNGvDPgHcubWt6G45hVuxZ2Crdp/1tKXWw6zTCY= github.com/omec-project/config5g v1.2.0 h1:fyIg+1LZ9jn8DTkVUbD4jyxA4FgMICdIBwZVnzCyMd4= github.com/omec-project/config5g v1.2.0/go.mod h1:AWFzCbbgCBx/iJwt+zWbpDGLHRpFzg24OYHqIkdcMVA= github.com/omec-project/http2_util v1.1.0 h1:8H2NME/V8iONth8TlyK/3w4pguAzaeUnEv9pmeAocwQ= diff --git a/producer/generate_auth_data.go b/producer/generate_auth_data.go index 217fe5d..7e09d98 100644 --- a/producer/generate_auth_data.go +++ b/producer/generate_auth_data.go @@ -16,7 +16,6 @@ import ( "strings" "github.com/antihax/optional" - "github.com/omec-project/UeauCommon" "github.com/omec-project/http_wrapper" "github.com/omec-project/milenage" "github.com/omec-project/openapi" @@ -25,6 +24,7 @@ import ( udm_context "github.com/omec-project/udm/context" "github.com/omec-project/udm/logger" "github.com/omec-project/udm/util" + "github.com/omec-project/util/ueauth" "github.com/omec-project/util_3gpp/suci" ) @@ -506,21 +506,27 @@ func GenerateAuthDataProcedure(authInfoRequest models.AuthenticationInfoRequest, // derive XRES* key := append(CK, IK...) - FC := UeauCommon.FC_FOR_RES_STAR_XRES_STAR_DERIVATION + FC := ueauth.FC_FOR_RES_STAR_XRES_STAR_DERIVATION P0 := []byte(authInfoRequest.ServingNetworkName) P1 := RAND P2 := RES - kdfValForXresStar := UeauCommon.GetKDFValue( - key, FC, P0, UeauCommon.KDFLen(P0), P1, UeauCommon.KDFLen(P1), P2, UeauCommon.KDFLen(P2)) + kdfValForXresStar, err := ueauth.GetKDFValue( + key, FC, P0, ueauth.KDFLen(P0), P1, ueauth.KDFLen(P1), P2, ueauth.KDFLen(P2)) + if err != nil { + logger.UeauLog.Error(err) + } xresStar := kdfValForXresStar[len(kdfValForXresStar)/2:] // fmt.Printf("xresStar = %x\n", xresStar) // derive Kausf - FC = UeauCommon.FC_FOR_KAUSF_DERIVATION + FC = ueauth.FC_FOR_KAUSF_DERIVATION P0 = []byte(authInfoRequest.ServingNetworkName) P1 = SQNxorAK - kdfValForKausf := UeauCommon.GetKDFValue(key, FC, P0, UeauCommon.KDFLen(P0), P1, UeauCommon.KDFLen(P1)) + kdfValForKausf, err := ueauth.GetKDFValue(key, FC, P0, ueauth.KDFLen(P0), P1, ueauth.KDFLen(P1)) + if err != nil { + logger.UeauLog.Error(err) + } // fmt.Printf("Kausf = %x\n", kdfValForKausf) // Fill in rand, xresStar, autn, kausf @@ -533,10 +539,13 @@ func GenerateAuthDataProcedure(authInfoRequest models.AuthenticationInfoRequest, // derive CK' and IK' key := append(CK, IK...) - FC := UeauCommon.FC_FOR_CK_PRIME_IK_PRIME_DERIVATION + FC := ueauth.FC_FOR_CK_PRIME_IK_PRIME_DERIVATION P0 := []byte(authInfoRequest.ServingNetworkName) P1 := SQNxorAK - kdfVal := UeauCommon.GetKDFValue(key, FC, P0, UeauCommon.KDFLen(P0), P1, UeauCommon.KDFLen(P1)) + kdfVal, err := ueauth.GetKDFValue(key, FC, P0, ueauth.KDFLen(P0), P1, ueauth.KDFLen(P1)) + if err != nil { + logger.UeauLog.Error(err) + } // fmt.Printf("kdfVal = %x (len = %d)\n", kdfVal, len(kdfVal)) // For TS 35.208 test set 19 & RFC 5448 test vector 1