| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Previously the same length value was used for both ussd_request
and interrogate_ss payloads, despite they are different.
Change-Id: I90ae7c51b75dcdb9d8ee042af23d127e6db8771d
|
|
|
|
|
|
| |
Both len and rc values were swapped in the test output.
Change-Id: Iebd82531c6ced5d16b15dad4ff4ce654c82db309
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
This test is showing that the internal ASN1 code is not checking
the size properly.
|
|
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.
|