diff options
author | Oliver Smith <osmith@sysmocom.de> | 2018-10-23 14:17:45 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2018-10-25 10:15:33 +0200 |
commit | 75f038ddd309ddfb5dd928f39f3cc2b61d0bd306 (patch) | |
tree | a042c6f9abeedc1f60ffdce3365c5d91ff7325ae /src | |
parent | dadd4055c390ccc81f8d2859c4f6c2bd5328094b (diff) |
cipher mode reject: send proper cause codes
bssmap_handle_cipher_mode() had code paths doing "goto reject" without
setting a meaningful cause value.
Related: OS#3186
Change-Id: Ia608fa34a6a2d3035a66d05fbc38553ac5186804
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bsc/osmo_bsc_bssap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 48af06b6c..6b7a68252 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -444,6 +444,7 @@ static int bssmap_handle_cipher_mode(struct gsm_subscriber_connection *conn, if (conn->ciphering_handled) { LOGP(DMSC, LOGL_ERROR, "Already seen ciphering command. Protocol Error.\n"); + reject_cause = GSM0808_CAUSE_PROTOCOL_ERROR_BETWEEN_BSS_AND_MSC; goto reject; } @@ -452,6 +453,7 @@ static int bssmap_handle_cipher_mode(struct gsm_subscriber_connection *conn, tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); if (!TLVP_PRESENT(&tp, GSM0808_IE_ENCRYPTION_INFORMATION)) { LOGP(DMSC, LOGL_ERROR, "IE Encryption Information missing.\n"); + reject_cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; goto reject; } @@ -464,6 +466,7 @@ static int bssmap_handle_cipher_mode(struct gsm_subscriber_connection *conn, len = TLVP_LEN(&tp, GSM0808_IE_ENCRYPTION_INFORMATION); if (len < 1) { LOGP(DMSC, LOGL_ERROR, "IE Encryption Information is too short.\n"); + reject_cause = GSM0808_CAUSE_INCORRECT_VALUE; goto reject; } |