diff --git a/pycrate_corenet/HdlrUEIu.py b/pycrate_corenet/HdlrUEIu.py index fa1f615..82f357e 100644 --- a/pycrate_corenet/HdlrUEIu.py +++ b/pycrate_corenet/HdlrUEIu.py @@ -351,7 +351,7 @@ class UEIuSigStack(SigStack): else: # ctx == 2, 2G sec ctx # convert 2G Kc to 3G Ck, Ik - CK, IK = conv_C4(vect[2]), conv_C5(vect[2]) + CK, IK = conv_102_C4(vect[2]), conv_102_C5(vect[2]) secctx = {'VEC': vect, 'CTX': ctx, 'Kc' : vect[2], diff --git a/pycrate_corenet/HdlrUES1.py b/pycrate_corenet/HdlrUES1.py index 9bb6a74..cb56af5 100644 --- a/pycrate_corenet/HdlrUES1.py +++ b/pycrate_corenet/HdlrUES1.py @@ -482,7 +482,7 @@ class UEEMMd(SigStack): snid = plmn_str_to_buf(self.AUTH_PLMN) else: snid = plmn_str_to_buf(self.UE.PLMN) - Kasme = conv_A2(vect[3], vect[4], snid, vect[2][:6]) + Kasme = conv_401_A2(vect[3], vect[4], snid, vect[2][:6]) secctx = {'VEC' : vect, 'CTX' : ctx, 'CK' : vect[3], @@ -490,12 +490,12 @@ class UEEMMd(SigStack): 'Kasme': Kasme} elif ctx == 2: # WNG: this is undefined / illegal and won't work (hopefully) - CK, IK = conv_C4(vect[2]), conv_C5(vect[2]) + CK, IK = conv_102_C4(vect[2]), conv_102_C5(vect[2]) if self.AUTH_PLMN: snid = plmn_str_to_buf(self.AUTH_PLMN) else: snid = plmn_str_to_buf(self.UE.PLMN) - Kasme = conv_A2(CK, IK, snid, b'\0\0\0\0\0\0') + Kasme = conv_401_A2(CK, IK, snid, b'\0\0\0\0\0\0') secctx = {'VEC' : vect, 'CTX' : ctx, 'Kc' : vect[2], @@ -531,8 +531,8 @@ class UEEMMd(SigStack): pass else: secctx['EEA'], secctx['EIA'] = self._get_sec_eea(), self._get_sec_eia() - secctx['Knasenc'] = conv_A7(secctx['Kasme'], 1, secctx['EEA'])[16:32] - secctx['Knasint'] = conv_A7(secctx['Kasme'], 2, secctx['EIA'])[16:32] + secctx['Knasenc'] = conv_401_A7(secctx['Kasme'], 1, secctx['EEA'])[16:32] + secctx['Knasint'] = conv_401_A7(secctx['Kasme'], 2, secctx['EIA'])[16:32] def set_sec_cap(self): # build UESecCap from UENetCap @@ -2163,10 +2163,10 @@ class UES1d(SigStack): if secctx and 'UESecCap' in self.UE.Cap: # create the KeNB self._log('DBG', 'NAS UL count for Kenb derivation, %i' % secctx['UL_enb']) - Kenb, UESecCap = conv_A3(secctx['Kasme'], secctx['UL_enb']), self.UE.Cap['UESecCap'][1] + Kenb, UESecCap = conv_401_A3(secctx['Kasme'], secctx['UL_enb']), self.UE.Cap['UESecCap'][1] secctx['Kenb'] = Kenb secctx['NCC'] = 0 - secctx['NH'] = conv_A4(secctx['Kasme'], Kenb) + secctx['NH'] = conv_401_A4(secctx['Kasme'], Kenb) else: self._log('WNG', 'no active NAS security context, using the null AS security context') Kenb, UESecCap = self.SECAS_NULL_CTX diff --git a/pycrate_corenet/ProcCNEMM.py b/pycrate_corenet/ProcCNEMM.py index e462e6f..44522a2 100644 --- a/pycrate_corenet/ProcCNEMM.py +++ b/pycrate_corenet/ProcCNEMM.py @@ -268,10 +268,10 @@ class EMMSigProc(NASSigProc): if secctx and 'UESecCap' in self.UE.Cap: # create the KeNB self._log('DBG', 'NAS UL count for Kenb derivation, %i' % secctx['UL_enb']) - Kenb, UESecCap = conv_A3(secctx['Kasme'], secctx['UL_enb']), self.UE.Cap['UESecCap'][1] + Kenb, UESecCap = conv_401_A3(secctx['Kasme'], secctx['UL_enb']), self.UE.Cap['UESecCap'][1] secctx['Kenb'] = Kenb secctx['NCC'] = 0 - secctx['NH'] = conv_A4(secctx['Kasme'], Kenb) + secctx['NH'] = conv_401_A4(secctx['Kasme'], Kenb) else: self._log('WNG', 'no active NAS security context, using the null AS security context') Kenb, UESecCap = self.S1.SECAS_NULL_CTX diff --git a/pycrate_corenet/ProcCNESM.py b/pycrate_corenet/ProcCNESM.py index dc0de40..e99176e 100644 --- a/pycrate_corenet/ProcCNESM.py +++ b/pycrate_corenet/ProcCNESM.py @@ -303,10 +303,10 @@ class ESMDefaultEPSBearerCtxtAct(ESMSigProc): if secctx and 'UESecCap' in self.UE.Cap: # create the KeNB self._log('DBG', 'NAS UL count for Kenb derivation, %i' % secctx['UL_enb']) - Kenb, UESecCap = conv_A3(secctx['Kasme'], secctx['UL_enb']), self.UE.Cap['UESecCap'][1] + Kenb, UESecCap = conv_401_A3(secctx['Kasme'], secctx['UL_enb']), self.UE.Cap['UESecCap'][1] secctx['Kenb'] = Kenb secctx['NCC'] = 0 - secctx['NH'] = conv_A4(secctx['Kasme'], Kenb) + secctx['NH'] = conv_401_A4(secctx['Kasme'], Kenb) else: self._log('WNG', 'no active NAS security context, using the null AS security context') Kenb, UESecCap = self.S1.SECAS_NULL_CTX diff --git a/pycrate_corenet/ServerAuC.py b/pycrate_corenet/ServerAuC.py index 41cadea..747267c 100644 --- a/pycrate_corenet/ServerAuC.py +++ b/pycrate_corenet/ServerAuC.py @@ -516,7 +516,7 @@ class AuC: XRESstar = conv_501_A4(CK, IK, SNName, RAND, XRES) # # return auth vector - self._log('DBG', '[make_4g_vector] IMSI %s, SQN %i, SNName %s: RAND %s, XRES* %s, AUTN %s, KASME %s'\ + self._log('DBG', '[make_5g_vector] IMSI %s, SQN %i, SNName %s: RAND %s, XRES* %s, AUTN %s, KAUSF %s'\ % (IMSI, SQN, hexlify(SNName).decode('ascii'), hexlify(RAND).decode('ascii'), hexlify(XRESstar).decode('ascii'), hexlify(AUTN).decode('ascii'), hexlify(KAUSF).decode('ascii')))