RRC: Fix direction values

Values were swapped: uplink is 0, downlink is 1.

Change-Id: I30dbb6d89ea832741c3ce4a319be1cb261b1565b
Reviewed-on: https://code.wireshark.org/review/25143
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
Nick James 2018-01-06 11:44:42 +02:00 committed by Pascal Quantin
parent ae2e9d669b
commit 9295535220
3 changed files with 20 additions and 16 deletions

View File

@ -511,7 +511,7 @@ HandoverFromUTRANCommand-GSM-r6-IEs/gsm-message/single-GSM-Message single-GSM-Me
}
%(DEFAULT_BODY)s
if( ciphering_info != NULL ){
direction = 0; /* Security Mode Command is from the RNC, direction is always downlink */
direction = P2P_DIR_DL; /* Security Mode Command is from the RNC, direction is always downlink */
ciphering_info->setup_frame[direction] = actx->pinfo->num;
}
@ -533,7 +533,7 @@ HandoverFromUTRANCommand-GSM-r6-IEs/gsm-message/single-GSM-Message single-GSM-Me
%(DEFAULT_BODY)s
if( ciphering_info != NULL ){
direction = 1; /* Security Mode Complete is from the UE, direction is always uplink */
direction = P2P_DIR_UL; /* Security Mode Complete is from the UE, direction is always uplink */
ciphering_info->setup_frame[direction] = actx->pinfo->num;
}
@ -1357,6 +1357,7 @@ if(state_dec >= 0 && state_dec <= 3) {
rrc_ciphering_info *ciphering_info;
guint32 rbid;
guint32 rlc_ciphering_sqn;
guint32 direction;
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
@ -1375,8 +1376,9 @@ if(state_dec >= 0 && state_dec <= 3) {
rbid = private_data_get_rbid(actx);
rlc_ciphering_sqn = private_data_get_rlc_ciphering_sqn(actx);
direction = fpinf->is_uplink ? P2P_DIR_UL : P2P_DIR_DL;
/*Set the ciphering activation frame information*/
ciphering_info->seq_no[rbid][fpinf->is_uplink] = rlc_ciphering_sqn;
ciphering_info->seq_no[rbid][direction] = rlc_ciphering_sqn;
#.FN_BODY RB-Identity VAL_PTR = &rbid

View File

@ -18600,7 +18600,7 @@ dissect_rrc_ActivationTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
static int
dissect_rrc_RB_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1383 "./asn1/rrc/rrc.cnf"
#line 1385 "./asn1/rrc/rrc.cnf"
guint32 rbid;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
1U, 32U, &rbid, FALSE);
@ -18617,7 +18617,7 @@ private_data_set_rbid(actx, rbid);
static int
dissect_rrc_RLC_SequenceNumber(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1389 "./asn1/rrc/rrc.cnf"
#line 1391 "./asn1/rrc/rrc.cnf"
guint32 rlc_ciphering_sqn;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
0U, 4095U, &rlc_ciphering_sqn, FALSE);
@ -18644,6 +18644,7 @@ dissect_rrc_RB_ActivationTimeInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
rrc_ciphering_info *ciphering_info;
guint32 rbid;
guint32 rlc_ciphering_sqn;
guint32 direction;
fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
@ -18664,8 +18665,9 @@ dissect_rrc_RB_ActivationTimeInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
rbid = private_data_get_rbid(actx);
rlc_ciphering_sqn = private_data_get_rlc_ciphering_sqn(actx);
direction = fpinf->is_uplink ? P2P_DIR_UL : P2P_DIR_DL;
/*Set the ciphering activation frame information*/
ciphering_info->seq_no[rbid][fpinf->is_uplink] = rlc_ciphering_sqn;
ciphering_info->seq_no[rbid][direction] = rlc_ciphering_sqn;
@ -90375,7 +90377,7 @@ static const value_string rrc_ReleaseCause_vals[] = {
static int
dissect_rrc_ReleaseCause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1411 "./asn1/rrc/rrc.cnf"
#line 1413 "./asn1/rrc/rrc.cnf"
guint32 value;
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
8, &value, FALSE, 0, NULL);
@ -91486,7 +91488,7 @@ dissect_rrc_SecurityModeCommand(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
NULL);
if( ciphering_info != NULL ){
direction = 0; /* Security Mode Command is from the RNC, direction is always downlink */
direction = P2P_DIR_DL; /* Security Mode Command is from the RNC, direction is always downlink */
ciphering_info->setup_frame[direction] = actx->pinfo->num;
}
@ -99916,7 +99918,7 @@ static const per_choice_t DL_DCCH_MessageType_choice[] = {
static int
dissect_rrc_DL_DCCH_MessageType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1394 "./asn1/rrc/rrc.cnf"
#line 1396 "./asn1/rrc/rrc.cnf"
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_DL_DCCH_MessageType, DL_DCCH_MessageType_choice,
&msg_type);
@ -99936,7 +99938,7 @@ static const per_sequence_t DL_DCCH_Message_sequence[] = {
static int
dissect_rrc_DL_DCCH_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1397 "./asn1/rrc/rrc.cnf"
#line 1399 "./asn1/rrc/rrc.cnf"
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_DL_DCCH_Message, DL_DCCH_Message_sequence);
@ -111257,7 +111259,7 @@ dissect_rrc_SecurityModeComplete(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *
ett_rrc_SecurityModeComplete, SecurityModeComplete_sequence);
if( ciphering_info != NULL ){
direction = 1; /* Security Mode Complete is from the UE, direction is always uplink */
direction = P2P_DIR_UL; /* Security Mode Complete is from the UE, direction is always uplink */
ciphering_info->setup_frame[direction] = actx->pinfo->num;
}
@ -129751,7 +129753,7 @@ static const per_choice_t HandoverToUTRANCommand_choice[] = {
static int
dissect_rrc_HandoverToUTRANCommand(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1400 "./asn1/rrc/rrc.cnf"
#line 1402 "./asn1/rrc/rrc.cnf"
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_rrc_HandoverToUTRANCommand, HandoverToUTRANCommand_choice,
NULL);
@ -129892,7 +129894,7 @@ static const per_sequence_t UE_SecurityInformation_sequence[] = {
static int
dissect_rrc_UE_SecurityInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1403 "./asn1/rrc/rrc.cnf"
#line 1405 "./asn1/rrc/rrc.cnf"
private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CS);
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_UE_SecurityInformation, UE_SecurityInformation_sequence);
@ -130295,7 +130297,7 @@ static const per_sequence_t UE_SecurityInformation2_sequence[] = {
static int
dissect_rrc_UE_SecurityInformation2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1407 "./asn1/rrc/rrc.cnf"
#line 1409 "./asn1/rrc/rrc.cnf"
private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_PS);
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_rrc_UE_SecurityInformation2, UE_SecurityInformation2_sequence);

View File

@ -1468,7 +1468,7 @@ is_ciphered_according_to_rrc(packet_info *pinfo, fp_info *fpinf, rlc_info *rlcin
ciphering_info = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_info_tree, GINT_TO_POINTER((gint)ueid));
if(ciphering_info != NULL) {
rbid = rlcinf->rbid[cur_tb];
direction = fpinf->is_uplink ? 1 : 0;
direction = fpinf->is_uplink ? P2P_DIR_UL : P2P_DIR_DL;
security_mode_frame_num = ciphering_info->setup_frame[direction];
ciphering_begin_seq = ciphering_info->seq_no[rbid][direction];
/* Making sure the rrc security message's frame number makes sense */
@ -1530,7 +1530,7 @@ rlc_decipher(tvbuff_t *tvb, packet_info * pinfo, proto_tree * tree, fp_info * fp
guint8 ext;
int ciphered_data_hf;
indx = fpinf->is_uplink ? 1 : 0;
indx = fpinf->is_uplink ? P2P_DIR_UL : P2P_DIR_DL;
pos = fpinf->cur_tb;
if (mode ==RLC_UM) {
header_size = 1;