summaryrefslogtreecommitdiffstats
path: root/tests/ussd
Commit message (Collapse)AuthorAgeFilesLines
* tests/ussd: prevent uninitialized memory accessVadim Yanitskiy2018-01-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously an incorrect length value was passed to both gsm_7bit_decode_n_ussd() and gsm_7bit_encode_n_ussd() functions during test_7bit_ussd() execution, due to: octets_written = strlen(decoded); The problem is that a 7-bit encoded string takes less memory than its 8-bit equivalent. So, here strlen() returns one-byte bigger value, that octets_written is. This then causes the uninitialized memory access. Found using Valgrind: Conditional jump or move depends on uninitialised value(s) at 0x506DCCC: gsm_7bit_decode_n_ussd (gsm_utils.c:248) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Conditional jump or move depends on uninitialised value(s) at 0x506DBB7: gsm_7bit_decode_n_hdr (gsm_utils.c:220) by 0x506DC9E: gsm_7bit_decode_n_ussd (gsm_utils.c:246) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Conditional jump or move depends on uninitialised value(s) at 0x506DBCB: gsm_septet_lookup (gsm_utils.c:153) by 0x506DBCB: gsm_7bit_decode_n_hdr (gsm_utils.c:224) by 0x506DC9E: gsm_7bit_decode_n_ussd (gsm_utils.c:246) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c
* tests/ussd: fix wrong GSM 04.80 payload lengthVadim Yanitskiy2018-01-171-3/+7
| | | | | | | Previously the same length value was used for both ussd_request and interrogate_ss payloads, despite they are different. Change-Id: I90ae7c51b75dcdb9d8ee042af23d127e6db8771d
* ussd_test.c: fix rc / len debug output confusionVadim Yanitskiy2018-01-132-52/+52
| | | | | | Both len and rc values were swapped in the test output. Change-Id: Iebd82531c6ced5d16b15dad4ff4ce654c82db309
* ussd: Decode interrogateSS that doesn't have testHolger Hans Peter Freyther2016-07-122-0/+13
| | | | | | | | | | | | Keith of Rhizomatica has an issue of a unrejected interrogateSS. Start with just decoding the message and printing the empty test and the code. What is kind of missing is the classification between invoke, returnResult and returnResultLast that we need to add in the long run. Change-Id: Iadfa156707a96f2a34f3948c7cc9a74435f17114
* Supplementary Services (de)activation, interrogation addedTobias Engel2015-01-011-7/+7
| | | | | | | | | | | | | These patches enhance the Supplementary Service (SS) processing from only being able to handle USSD to other SS, specifically activation, deactivation and interrogation of those SS. Registration is not yet implemented. include/osmocom/gsm/protocol/gsm_09_02.h has been added with needed values for SS. Modified by Harald Welte to keep the old ussd-only functiosn for API/ABI stability.
* sms: Added result buffer size parameter to 7bit conv funsJacob Erlbeck2013-08-122-7/+54
| | | | | | | | | | | | | The 7bit<->8bit encoding/decoding functions didn't check whether there is still enough space in the destination buffer. Therefore a buffer size parameter has been added to each of the functions which is used to truncate the output if the buffer is too small. In addition, the return value of the decoding functions has been changed to number of characters written (excluding \0), so this value is always equal to strlen(decoded). The old functions are still available as wrapper functions.
* ussd: Changed 7bit test to check spec conformance directlyJacob Erlbeck2013-08-081-6/+13
| | | | | | | | | | | Renamed gsm_7bit_ussd() to test_7bit_ussd() and extended the function to take the expected binary encoding and eventually added trailing bytes in the re-decoded text as arguments. These are used to check assertions of the right behaviour instead of solely relying on regression data, because the value are determined by the spec and fixed and it is more obvious this way. Especially concerning the case with the duplicated \r which can easily be overlooked when it's only present in the ok file.
* Add special 7-bit encoding and decoding functions for USSD codingAndreas Eversberg2013-08-082-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | Handling 7-bit coding is a little different for USSD, as TS 03.38 states: To avoid the situation where the receiving entity confuses 7 binary zero pad bits as the @ character, the carriage return or <CR> character shall be used for padding in this situation [...]. If <CR> is intended to be the last character and the message (including the wanted <CR>) ends on an octet boundary, then another <CR> must be added together with a padding bit 0. The receiving entity will perform the carriage return function twice, but this will not result in misoperation as the definition of <CR> [...] is identical to the definition of <CR><CR>. The receiving entity shall remove the final <CR> character where the message ends on an octet boundary with <CR> as the last character. Jacob has verified the fix with fakeBTS and the wireshark dissector. Fixes: OW#947 Reviewed-by: Jacob Erlbeck <jerlbeck@sysmocom.de>
* build: simplify test handling and speed up build.Diego Elio Pettenò2012-06-301-6/+0
| | | | | | | | | | | | Instead of using a ./configure parameter to decide whehter to build tests or not, use the check_PROGRAMS variable so that the tests are only built when running `make check`. To avoid slowing down the test phase itself, collapse the declaration of the test targets in the tests/Makefile.am file, this way they can be built and linked in parallel before the testsuite is executed. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
* tests: Fix the make distcheck of libosmocore with the testsHolger Hans Peter Freyther2011-11-141-0/+1
|
* tests: Initialize log system to fix crash, update test resultHolger Hans Peter Freyther2011-11-142-1/+59
| | | | | | | | Use osmo_init_logging to initialize the log system to fix crashes when we attempt to parse broken ASN1 messages. Ignore stderr with parse errors, update the test result. make check is now passing.
* tests: Use GNU autotest to execute our tests and compare textual outputHolger Hans Peter Freyther2011-11-141-0/+1
| | | | | | | | | | | | | The output of make check is looking like this now: Regression tests. 1: bits ok 2: msgfile ok 3: sms ok 4: smscb ok 5: timer FAILED (testsuite.at:38) 6: ussd FAILED (testsuite.at:44)
* include: reorganize headers file to include/osmocom/[gsm|core]Pablo Neira Ayuso2011-03-231-1/+1
| | | | | | | | | | | | This patch moves all GSM-specific definitions to include/osmocom/gsm. Moreover, the headers in include/osmocore/ have been moved to include/osmocom/core. This has been proposed by Harald Welte and Sylvain Munaunt. Tested with `make distcheck'. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
* This patch moves the GSM-specific functions to the new libraryPablo Neira Ayuso2011-03-231-1/+1
| | | | | | | | | | libosmogsm which is provided by libosmocore. I have also moved generate_backtrace() to backtrace.c instead of gsm_utils.c, otherwise the timer and msgfile tests depend on libosmogsm. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
* ussd: Verify that parsing is stil working and print the decoded text.Holger Hans Peter Freyther2010-10-111-0/+5
|
* ussd: Add next test that show that we access the data out of boundsHolger Hans Peter Freyther2010-10-111-0/+23
| | | | | This test is showing that the internal ASN1 code is not checking the size properly.
* ussd: Add a test case, switch parsing to use a gsm48_hdr and lenHolger Hans Peter Freyther2010-10-112-0/+68
The current USSD code is not doing any size checks, add a test case to find out how easily we access the data out of bounds. Begin to use the length in some places.