aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/sgsn
AgeCommit message (Collapse)AuthorFilesLines
2014-11-14sgsn: Add 'acl-only' authentication policyJacob Erlbeck1-1/+1
Currently the VTY 'auth-policy' command results in setting or clearing the acl_enabled flag. This also enables the matching of the MCC/MNC prefix of the IMSI. This patch adds an additional policy 'acl-only' which disables the MCC/MNC matching and relies on the ACL only. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Move IMSI authorization to gsm48_gmm_authorizeJacob Erlbeck1-3/+4
Currently the IMSI is only checked immediately when an Attach Request is received that contains an IMSI IE. If it contains a P-TMSI instead, access is always granted. This commit moves the IMSI check to gsm48_gmm_authorize where it is applied when IMSI and IMEI have been acquired. This fixes the authorization when the Attach Accept doesn't contain an IMSI. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Cleanup GMM state transitionsJacob Erlbeck1-5/+1
Currently the GMM state is set to GMM-REGISTERED when an Attach Accept or a RA Update Accept message is sent, even if a new P-TMSI is included. In this case 04.08 requires (see 4.7.3.1.3 and 4.7.5.1.3), that the state is set to GMM-COMMON-PROCEDURE-INITIATED when the Accept is sent. When the Complete is received, the SGSN shall set the state to GMM-REGISTERED. This patch modifies the state updates accordingly. Sponsored-by: On-Waves ehf
2014-11-11sgsn/test: Add test_gmm_attachJacob Erlbeck2-1/+123
This test checks the attach procedure until the Attach Complete is received. Note that authorization and GMM state updates are not working properly yet. Sponsored-by: On-Waves ehf
2014-11-11sgsn/test: Move message sending to send_0408_messageJacob Erlbeck1-29/+24
This replaces serveral occurences of duplicated code for message creation and sending (passing to gsm0408_gprs_rcvmsg) into a single function. In addition, the sgsn_tx_counter is always reset within send_0408_message to simplify the code that checks for the number of messages sent. Sponsored-by: On-Waves ehf
2014-11-05sgsn: Unassign the LLME after GMM Status without mmctxJacob Erlbeck2-0/+40
Currently the LLME is not deleted when a GMM Status message is received for which a mmctx cannot be found. This can fill the LLME list with unneeded entries. This patch adds code to unassign the LLME in that case. Ticket: OW#1324 Sponsored-by: On-Waves ehf
2014-10-27sgsn: Handle Detach Requests even when there is no mmctxJacob Erlbeck2-0/+37
Currently, when a Detach Request is received with an unknown TLLI, it is answered by another Detach Request (!), even when a power_off Type is used. This patch uses gsm48_rx_gmm_det_req to handle the message instead. So this function is changed to cope with a NULL mmctx. In that case it doesn't unassign the llme, so this must be done manually afterwards. Sponsored-by: On-Waves ehf
2014-10-27sgsn: Only send Detach Accept (MO) if power_off isn't setJacob Erlbeck1-1/+1
Currently, every time the SGSN received a Detach Request from the MS via an established logical link, it is answered by a Detach Accept. This violates the specification (GSM 04.08, 4.7.4.1.2 and .3), which states, that it should only be sent, if "the detach type IE value indicates that the detach request has not been sent due to switching off". This patch adds a conditional to limit the sending of Detach Accept accordingly. Sponsored-by: On-Waves ehf
2014-10-27sgsn/test: Add test case for Detach Request (MO, power-off = 1)Jacob Erlbeck2-0/+64
Currently only a Detach Request (MO) message with power_off = 0 is checked. This commit adds a new test case with power_off set to 1. It also adds checks for the number of messages generated by the SGSN to verify that these messages are handled differently. Note that the handling of power_off isn't implemented yet. Therefore the corresponding assertion is being disabled yet. Sponsored-by: On-Waves ehf
2014-10-27sgsn/test: Move MM context allocation into separate functionJacob Erlbeck1-10/+25
This refactores serveral code lines needed for the allocation of MM contexts into the new function alloc_mm_ctx. Sponsored-by: On-Waves ehf
2014-10-27sgsn: Moved IMSI ACL management to sgsn_auth.cJacob Erlbeck1-0/+1
Currently the ACL code is located in sgsn_vty.c. This commit moves this to a new file sgsn_auth.c as a first step to make authorization more flexible in order to implement remote acquisition on subsciber data. Sponsored-by: On-Waves ehf
2014-10-09sgsn: Free MM context after receiving a Detach RequestJacob Erlbeck1-3/+1
On a Detach/Re-attach cycle the Address Sanitizer detected a use-after-free kind of problem. That is because we tried to destroy the LLME twice. The first time it is destroyed as part of the Detach handling ans the second time it is destroyed as part of destroying the old MM context. In case the GPRS GMM detach message is lost the SGSN needs to reply besides not having a MM entry. The alternative would have been to add NULL checks for all usages of ctx->llme which would not have helped with the readability. Sponsored-by: On-Waves ehf
2014-10-09sgsn: Add test that exposes a dangling pointer to the LLMEHolger Hans Peter Freyther2-0/+61
On detach the LLME get's unassigned (and hence destroyed) but the GMM context will still point to that dead structure.
2014-10-09sgsn: Create testcase that verifies that llmes get deletedHolger Hans Peter Freyther3-1/+150
On an "unassignment" this code verifies that the LLME will vanish from the list of LLMEs. We assume that this doesn't create a memory leak.
2014-10-09sgsn: Add boilerplate code for a SGSN testHolger Hans Peter Freyther3-0/+37