aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm
AgeCommit message (Collapse)AuthorFilesLines
2016-05-06import gprs_gsup_message.[ch] from openbsc as gsup.[ch]0.9.4Harald Welte3-1/+477
Move those routines from OpenBSC to libosmogsm, so they can be re-used from other programs. I think it was a mistake to add them only inside the openbsc repository in the first place. We need to pay more attention to this in the future.
2016-05-05tlv: Import osmo_shift_* and osmo_match_shift_* from openbscHarald Welte2-0/+177
These routines have nothing to do with specifically the BSC, so import them to the TLV parser we keep in libosmogsm.
2016-05-05import gsm_04_08_gprs.[ch] from openbsc.gitHarald Welte3-1/+148
The definitions in this header file (and associated strings in the c file) are generic about the GPRS Layer3 signalling protocols, and thus should be part of the library.
2016-05-05auth_core: Add osmo_auth_3g_from_2g() to compute CK+IK from KcHarald Welte2-0/+42
This function performs the C5+C4 conversion to derive UMTS key material from a 2G-only subscriber.
2016-04-29conv_gen: Use python2 to execute the scriptHolger Hans Peter Freyther1-1/+1
The script does not work with python3: $ python3 utils/conv_gen.py File "utils/conv_gen.py", line 124 def _print_term(self, fi, num_states, pack = False): Second there is no 'python' on FreeBSD and one needs to select the major version to use. GEN conv_cs3_gen.c GEN conv_xcch_gen.c GEN conv_cs2_gen.c python: not found python: not found python: not found By using python2 we solve both issues. On Debian python2 is located inside the python-minimal package.
2016-04-29Add code generator for convolutional codesMax Suraev msuraev@sysmocom.de2-0/+20
Add python utility to generate .c code with convolutional encoder/decoder based on polynomial description of the code. If argument given it'll be interpreted as intended output directory, otherwise current working directory is used. Codes for *CCH, CS2/3 and TCH/AFS are generated. Corresponding manual implementations are removed from tests. This introduce build-time dependency on python. The main work for this patch was generously contributed by Sylvain Munaut. Fixes: OS#1629
2016-04-24milenage/aes: Address undefined behavior on bitshiftHolger Hans Peter Freyther1-1/+1
Extend the u8 to u32 before going to shift it. Fixes: milenage/aes-internal.c:799:4: runtime error: left shift of 128 by 24 places cannot be represented in type 'int' #0 0x7f84e9fe86a2 in rijndaelKeySetupEnc (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xfa6a2) #1 0x7f84e9febad8 in aes_encrypt_init (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xfdad8) #2 0x7f84e9fe7d14 in aes_128_encrypt_block (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xf9d14) #3 0x7f84e9febe7d in milenage_f1 (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xfde7d) #4 0x7f84e9fee2ce in milenage_generate (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0x1002ce) #5 0x7f84e9fe76d7 in milenage_gen_vec (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xf96d7) #6 0x7f84e9fe6c08 in osmo_auth_gen_vec (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xf8c08) #7 0x401441 in main (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/tests/auth/.libs/lt-milenage_test+0x401441) #8 0x7f84e8e33a3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f) #9 0x400e58 in _start (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/tests/auth/.libs/lt-milenage_test+0x400e58)
2016-04-23Add function for appending range1024 to bitvecMax2-1/+37
Add convenience function to append range1024 encoded data (see 3GPP TS 44.018 Annex J) to a given bitvec.
2016-04-22Deprecate comp128Max2-2/+7
Mark function as deprecated to discourage its usage: people should use generic API in osmocom/crypt/auth.h
2016-04-22Deprecate osmo_a5_1 and osmo_a5_2Max1-50/+58
Mark the functions as deprecated to discourage their use: people should use unified osmo_a5 which supports all the A5/1-4 ciphers.
2016-04-22Improve code reuseMax1-32/+3
Use generic functions covered by testsuit for SQN calculations.
2016-04-22Update internal GPRS cipher APIMax2-2/+22
Update internal API (for GPRS cipher implementors): make it compliant with ETSI TS 155.22. External API left untouched.
2016-04-16Add function to get osmo_earfcn bit sizeMax2-0/+25
This function returns the number of bits necessary to pack osmo_earfcn into Repeated E-UTRAN Neighbour Cells IE (3GPP TS 44.018 Table 10.5.2.33b.1).
2016-03-30Export names for gsm_chan_t and gsm48_chan_modeMax2-1/+27
This can be used with get_value_string() to improve debugging output.
2016-03-17Rename struct to better match libosmocore conventionsMax1-3/+3
2016-03-17Revert "gsm48: move to hex TMSI representation"Harald Welte1-1/+1
This reverts commit f451ce66eb8206bad1078849723edcb209632834.
2016-03-17gsm48: move to hex TMSI representationVadim Yanitskiy1-1/+1
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2016-03-17Add basic EARFCN supportMax2-0/+54
Add structure representing group of EARFCNs with common priority, threshold etc. Add functions to populate this structure.
2016-03-15gsm48: factor out MCC+MNC BCD parsing for re-use in UMTSNeels Hofmeyr2-21/+36
For 3G, I need a BCD composer/parser similar to gsm48_generate_lai()/ gsm48_decode_lai(). Those functions also handle a trivial extra member (lac) which I don't need in this way for 3G. So create new functions to take on the MCC+MNC BCD handling and call those from gsm48_generate_lai() and gsm48_decode_lai(). In this way, the 3G code in openbsc can use only the BCD functionality without code duplication.
2016-03-1504.08: add inline funcs for pdisc + msg type bitmasksNeels Hofmeyr1-2/+2
Add inline functions for both release <= 98 and release >= 99 as well as a default define. Use the release 98 by default since the current code base uses the r98 bitmasks. These inline functions relieve callers of the decision on masking bits of the protocol discriminator and message type octets. Also add a define for the protocol discriminator extension to one octet length (GSM48_PDISC_EXTEND). Apply new pdisc function in gsm0480.c. [hfreyther: Make the hdr param const]
2016-02-29comment typoNeels Hofmeyr1-1/+1
2015-11-09ipa: recv is declared in different headers on BSDHolger Hans Peter Freyther1-0/+2
Include the headers mentioned by the manpage ipa.c:346:9: warning: implicit declaration of function 'recv' is invalid in C99 [-Wimplicit-function-declaration] ret = recv(fd, msg->tail, needed, 0);
2016-01-22Fix sporadic out-of-bounds errorMax1-13/+21
This code dealing with bit shifting sometimes gets 1 byte beyond array boundary while calculating index. This is now explicitly checked and prevented. Ticket: OW#1198 Sponsored-by: On-Waves ehf
2016-01-15gsm: Add APN conversion functionsJacob Erlbeck2-0/+77
These functions are currently part of openbsc but also needed by other projects. The function have been renamed as follows: gprs_apn_to_str -> osmo_apn_to_str gprs_str_to_apn -> osmo_apn_from_str Sponsored-by: On-Waves ehf
2015-12-21some comments / fixed typosNeels Hofmeyr1-1/+1
2015-12-19LaPDm: Refuse SUSPEND/RESUME/RECONNECT in BTS modeHarald Welte1-0/+17
The primitives for SUSPEND, RESUME and RECONNECT are only permitted on the MS side of the LAPDm link, not on the BTS side. So we should check for this and reject, accordingly.
2015-12-13RSL: Add enum + TLV definitions for ip.access style embedded IEsHarald Welte2-0/+27
2015-12-05remove our internal copy of talloc, use system libtallocHarald Welte1-2/+2
Shipping our own private copy of talloc was a good idea in 2008, when it was not readily available on most target platforms. Today, the situation is quite different, as it is a standard library on major Linux distributions.
2015-11-02fix some typosNeels Hofmeyr1-2/+2
Sponsored-by: On-Waves ehi
2015-09-16build: have a disable-static build succeedJan Engelhardt1-2/+6
When using configure --disable-static, no libosmogsm.a will be created, and the tests fail to link because symbols like _a5_3 and _a5_4 are not exported through the only remaining libosmogsm.so. A method to overcome this is an intermediate private non-distributed library, examples of which are present in e.g. libabc, kmod and systemd. With this, disable-static can now be the default and practical compile time be halved.
2015-08-18Introduce gsm48_mi_type_name() functionHarald Welte2-0/+15
2015-08-18Add G-RNTI derived TLLI types defined in 23.003Harald Welte1-1/+5
2015-06-04ipa: Add libosmogsm.map entry for ipa_ccm_idtag_parse_offJacob Erlbeck1-0/+1
Addresses: CCLD utils/utils_test utils_test.o: In function `test_idtag_parsing': git/libosmocore/tests/utils/utils_test.c:64: undefined reference to `ipa_ccm_idtag_parse_off' Sponsored-by: On-Waves ehf
2015-06-02ipa: Properly parse LV stream of a ID_GET requestHolger Hans Peter Freyther1-3/+13
For some reason the structure is closer to be a LV (length and value). The value is actually a tag but it is counted inside the length. Introduce an overload of the parse function to provide an offset for the length. This will be taken from the returned length.
2015-05-25Add APN utility function to libosmogsmHarald Welte3-1/+42
The current functions are used to 'qualify' an APN from the user-supplied APN name (name identifier) towards the fully-qualified APN name which is used in the .grps DNS zone.
2015-04-10msgb: Check the return value of msgb_alloc (Coverity)Jacob Erlbeck1-0/+3
In some places, the return value of msgb_alloc/msgb_alloc_headroom is not checked before it is dereferenced. This commit adds NULL checks to return with -ENOMEM from the calling functions if the alloc function has failed. Fixes: Coverity CID 1249692, 1293376 Sponsored-by: On-Waves ehf
2015-03-28gsm: Add A5/3-4 cipher supportMax1-3/+68
Signed-off-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-03-18gsm0808: Remove duplicate initializationHolger Hans Peter Freyther1-1/+0
These types were compatible so simply remove one. Fixes: gsm0808.c:323:37: warning: initializer overrides prior initialization CC gsm0480.lo of this subobject CC abis_nm.lo [-Winitializer-overrides] [GSM0808_IE_LSA_INFORMATION] = { TLV_TYPE_TLV }, ^~~~~~~~~~~~ gsm0808.c:316:36: note: previous initialization is here [GSM0808_IE_LSA_INFORMATION] = { TLV_TYPE_TLV }, ^~~~~~~~~~~~
2015-01-01Supplementary Services (de)activation, interrogation addedTobias Engel2-25/+102
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.
2014-12-30fixupHarald Welte1-0/+4
2014-12-29add gsm0341_test to generate SMSCB hex stringsHarald Welte3-1/+59
Those hex strings can then be copy+pasted into the OSmoNITB VTY
2014-12-28libosmo-gsm: Add PCHAN/LCHAN types for CBCHHarald Welte1-0/+2
2014-12-22ipa: Return -errno instead of -1 in ipa_sendJacob Erlbeck1-1/+1
Currently, the ipa_send function returns -1 in one execution branch to indicate an error and -EIO in another. This is not consistent and can lead to a misinterpretation of the error code, since -1 is -EPERM and in general, EPERM is not returned by write(2). This patch changes the return code to -errno instead of -1 for the case that write(2) fails for same reason. So -rc is always a sensible error value if there is a failure. Sponsored-by: On-Waves ehf
2014-12-04fix libosmocore build for NuttX targetHarald Welte1-0/+5
this fixes some compilation issues with libosmocore under NuttX, particularly as some #defines are missing or some header files are slightly different.
2014-10-26Change copyright notice of ipa.c to GPLv2+Harald Welte1-4/+4
... which it should have been all along.
2014-10-26Change license of gsm0411_smc/smr to GPLv2+Harald Welte3-12/+12
libosmocore.{so,a} should always have been GPLv2+. However, when migrating some code from OpenBSC or OsmocomBB, we sometimes introduced it with a wrong license header.
2014-10-03build: remove unused all_includes and use AM_CPPFLAGSJan Engelhardt1-1/+2
Preprocessor flags are best placed in AM_CPPFLAGS. Remove use of the unused all_includes variable, which is never set.
2014-09-25misc: Look into the build directory for generated filesHolger Hans Peter Freyther1-1/+1
the bits/crc files are not inside the sourcedirectory but will end in the build directory. Go and look there as well. This somehow doesn't fail with make distcheck but when building for Yocto Dizzy.
2014-09-11Fix copyright header in gan.cHarald Welte1-4/+4
When I wrote the gan.c, I used the wrong copyright/license header (AGPLv3+ intead of GPLv2+). This was a mistake and is fixed hereby.
2014-09-11add missing copyright statements to source code filesHarald Welte1-0/+19
Some source code files didn't have the usual copyright and licence statement at their top. I'm adding them baesed on information in the commitlog.