Commit Graph

65 Commits

Author SHA1 Message Date
Sukchan Lee 7063d853e7 [SBI] Preamble parsing issues in MIME (#3058)
When building the MIME Multipart Media Encapsulation format
within an SBI message in the NF of a third-party product,
Open5GS does not parse properly if it contains a Preamble CRLF.

For example,

```
    TCP/HTTP2
    Stream: Data, Stream ID: 1, Length 841
    MIME Multipart Media Encapsulation, Type: multipart/related, Boundary: "gc0pJq08jU534c"
--->Preamble: 0d0a
    First boundary: --gc0pJq08jU534c\r\n
    Encapsulated multipart part: (application/json)
    Boundary: \r\n--gc0pJq08jU534c\r\n
    Encapsulated multipart part: (application/vnd.3gpp.5gnas)
    Boundary: \r\n--gc0pJq08jU534c\r\n
    Encapsulated multipart part: (application/vnd.3gpp.ngap)
    Last Boundary: \r\n--gc0pJq08jU534c--\r\n
```
2024-03-17 10:36:29 +09:00
Sukchan Lee 2ceca49161 [MME/AMF] Fixed crash following Handover Request (#3014)
1. HandoverRequired
2. HandoverRequest
3. HandoverFailure
4. UEContextReleaseCommand
5. HandoverPreparationFailure

If UEContextReleaseComplete is not received,
the Source-UE will have the Target-UE.

6. HandoverRequired

There may be cases where the Source UE has a Target UE
from a previous HandoverRequired process. In this case,
it is recommended to force the deletion of the Target UE information
when receiving a new HandoverRequired.

7. HandoverRequest
8. HandoverFailure
9. UEContextReleaseCommand
10. UEContextReleaseComplete
11. HandoverPreparationFailure

... Crashed ...
2024-02-29 23:02:38 +09:00
Sukchan Lee 843c4950ac [ASN1C] Fixed asn1c library on 32bit (#2934)
APER encoding fails when using the asn_uint642INTEGER function on a 32-bit machine as shown below.

```C
   asn_uint642INTEGER(AMF_UE_NGAP_ID, 0xffffffff);
   ...
   aper_encode_to_buffer(...)
```

INTEGER APER encode/decode functions seem to be operating internally with long variables instead of intmax_t.
That is probably the reason of the failure.

@v0-e fixed this issues in the mouse07410/asn1c pull request.
https://github.com/mouse07410/asn1c/pull/176
https://github.com/mouse07410/asn1c/pull/177
2024-02-12 14:00:06 +09:00
Sukchan Lee 9479f29f3d
[ASN.1] Fix buffer overflow (mouse07410/asn1c#134) (#2742) 2023-11-20 21:16:35 +09:00
Sukchan Lee e92293e0af
[SEPP] Initial Update for 5G Roaming (#2739)
[SEPP] Initial Update for 5G Roaming
2023-11-19 19:34:51 +09:00
Sukchan Lee d406fbeb92 Fixed incorrect SMF selection in Multi-SMF (#2557) 2023-10-23 22:40:35 +09:00
Sukchan Lee bd74c259ec [AMF/MME] Fix crash during snow-3g encrypt (#2581)
There was a memory problem in the encryption using snow_3g_f8,
so AMF/MME crashed.

To solve this problem, we used the snow-3g encryption library
created as below.

https://github.com/rcatolino/libressl-snow3g

However, it seems that this library cannot be used to create
integrity hash like snow_3g_f8.

So, we decided to keep both snow-3g libraries for the time being.

1. lib/crypt/snow3g* : for INTEGRITY (NIA1, EIA1)
2. lib/crypt/openssl/snow3g* : for ENCRYPTION (NEA1, EEA1)
2023-09-13 23:22:46 +09:00
Sukchan Lee 2f8ae91b0b Fixed dynamic-stack-buffer-overflow (#2578, #2577) 2023-09-05 21:58:05 +09:00
Sukchan Lee af67b2486b [SBI] UDR stores PEI instead of PCF 2023-08-13 11:49:01 +09:00
Sukchan Lee 64a35611d8 [MME] Temporarily disable sgsn settings (#2441) 2023-07-19 21:54:14 +09:00
Sukchan Lee 31f95ce2e0 [SBI] Fixed Invalid S-NSSAI format (#2337) 2023-05-28 21:53:52 +09:00
Sukchan Lee 424f382265 [AMF/MME] Support TAI Range 2023-03-19 18:31:45 +09:00
Sukchan Lee 3715b9ece3 [CORE] OGS_MAX_SDU_LEN->OGS_HUGE_LEN Stack (#2008)
Changed all OGS_MAX_SDU_LEN in the stack to OGS_HUGE_LEN.
2023-01-25 22:24:51 +09:00
Sukchan Lee 79d46be086 Introduced Subscription identifier de-concealing
o Generate the private key as below.
   $ openssl genpkey -algorithm X25519 -out /etc/open5gs/hnet/curve25519-1.key
   $ openssl ecparam -name prime256v1 -genkey -conv_form compressed -out /etc/open5gs/hnet/secp256r1-2.key

 o The private and public keys can be viewed with the command.
   The public key is used when creating the SIM.
   $ openssl pkey -in /etc/open5gs/hnet/curve25519-1.key -text
   $ openssl ec -in /etc/open5gs/hnet/secp256r1-2.key -conv_form compressed -text

In ausf/udm.yaml

 hnet:
    o Home network public key identifier(PKI) value : 1
      Protection scheme identifier : ECIES scheme profile A
    - id: 1
      scheme: 1
      key: /etc/open5gs/hnet/curve25519-1.key

    o Home network public key identifier(PKI) value : 2
      Protection scheme identifier : ECIES scheme profile B
    - id: 2
      scheme: 2
      key: /etc/open5gs/hnet/secp256r1-2.key

    o Home network public key identifier(PKI) value : 3
      Protection scheme identifier : ECIES scheme profile A
    - id: 3
      scheme: 1
      key: /etc/open5gs/hnet/curve25519-1.key

    o Home network public key identifier(PKI) value : 4
      Protection scheme identifier : ECIES scheme profile B
    - id: 4
      scheme: 2
      key: /etc/open5gs/hnet/secp256r1-2.key

Related to #1779
2022-12-24 20:22:45 +09:00
Sukchan Lee 944adaabbf [AMF/MME] Added Timer Configuration (#1905) 2022-11-29 23:22:16 +09:00
Sukchan Lee 007033330a Fixed test code for MacOSX Ventura 2022-11-22 17:16:31 +09:00
Sukchan Lee 1d17e68c56 [ALL] Removing trailing whitespace and tab 2022-09-02 23:38:39 +09:00
Sukchan Lee f020732ce9 [SBI] Support service-names in discovery option 2022-08-27 00:12:22 +09:00
Sukchan Lee 668cc59f94 [AMF] Fixed 5GMM cause in Reject message (#1660)
When a UE that requests slices tries to connect and there are no slices configured, the reject message is:

5GMM cause = 0x7 (5GS Services not allowed)

however it should be:

5GMM cause = 0x3e (No network slices available)

All 5GMM cause value in reject message is reviewed in this commit
2022-07-19 12:42:02 +09:00
Sukchan Lee b58ebda556 Change Default MCC/MNC 901/70 -> 999/70 (#1331) 2022-06-23 21:37:47 +09:00
Sukchan Lee 4d2f7726b9 X2 handover with SGW change (#1367, #1459) 2022-05-12 22:52:36 +09:00
Pau Espin e3da7c9934
Rename GTPv2C specifics to gtp2 prefix (#1485)
In the past only GTPv2C was supported, and had the "gtp" generic prefix.
Later on, GTPv1C support was added, and "gtp1" prefix was used.
Let's move GTPv2C specific bits to have "gtp2" prefix too, and leave
"gtp" prefix for generic stuff among different GTP versions.
2022-04-13 07:07:39 +09:00
Sukchan Lee e3fa731c4a [SBI] fix the timezone string converter (#1376) 2022-02-20 20:18:32 +09:00
Sukchan Lee b6de06ee01 fix the test program bug 2022-01-04 17:27:28 +09:00
Sukchan Lee b988e7edce Use talloc for all memory pool (#1263) 2022-01-04 08:29:18 +09:00
Sukchan Lee 74bbc6ecbf [MME] Add S1AP debug (#1263) 2021-12-11 17:28:05 +09:00
Sukchan Lee 039b9d0aaa SBI updated
- openapi-generator version 5.2.0
- add priority/capacity/load in NFProfile/NFService
- add AllowedNfTypes in NFProfile/NFService
2021-07-16 17:02:33 +09:00
Sukchan Lee 118d62d42d Add more memory log 2021-06-06 22:35:46 +09:00
Sukchan Lee f861919507 [AMF] asn1c decode error for APC_EXTENSIBLE (#994) 2021-05-14 16:46:08 +09:00
Sukchan Lee 5901582281 [GTPv2] fix incorrect formatting PLMN-ID (#969) 2021-05-05 22:51:50 +09:00
Sukchan Lee e5a0dfb444 [SBI] fix the compile warning in MacOSX 2021-05-05 22:04:17 +09:00
Sukchan Lee d40348c00c [SBI] Unknown timezone offset (#914)
add a debug message for unknown timezone offset
2021-04-05 21:16:52 +09:00
Sukchan Lee 9af4268bab arch: DB schema Changes (#796)
- New function : NSSF
- New feature : SMF selection
2021-03-08 21:25:09 +09:00
Sukchan Lee 852756f902 test: Porting FreeBSD 2021-02-08 14:25:40 -05:00
Sukchan Lee e7cb25ac9b asn1c: MME crash is resolved (#783) 2021-02-02 14:27:03 -05:00
Sukchan Lee f47f65a51c fix: asn1c decode problem for NGReset (#773) 2021-02-02 13:33:09 -05:00
Sukchan Lee ada01fca8f spec: S1AP/NGAP update to v16.4.0(2021-01-04) 2021-01-24 23:43:42 -05:00
Sukchan Lee e531ccab5a fix: The SBI time string converting error in 32bit 2021-01-08 10:42:51 -05:00
Sukchan Lee 31cc259ee4 fix: release error 2021-01-08 00:24:00 -05:00
Sukchan Lee 79b0552bb0 test: for checking issues #736 2020-12-31 21:55:11 -05:00
Sukchan Lee efd1780745 fix: update NRF issues (#727,#728,#729,#730) 2020-12-24 15:41:31 -05:00
Sukchan Lee 4d023d0de0 fix overflow bug in the packet memory pool 2020-09-06 23:53:38 -04:00
Sukchan Lee 18c483950c Change Number of UEs usage [#533]
- Set the number of UEs in units of AMF/MME instead of gNB/eNB.
- See default value as shown below
    Number of UEs per AMF/MME : 4,096
    Number of gNB/eNB per AMF/MME : 32
2020-08-25 23:05:01 -04:00
Sukchan Lee b412e51b83 Remove SGW and PGW 2020-08-22 13:21:37 -04:00
Sukchan Lee 8e048be082 Release v2.0.0 2020-08-21 23:33:45 -04:00
Sukchan Lee 997b716cda Change asn1c from velichkov to mounse07410 [#492] 2020-07-09 16:43:56 -04:00
Sukchan Lee a71d2ee3db refine SGW/UPF selection code 2020-07-09 01:38:09 -04:00
Sukchan Lee 3b0db8c384 Fix the bug for Release-16 2020-07-03 01:03:13 -04:00
Sukchan Lee 6ef5a746e5 NGSetup is added 2020-05-25 12:15:22 -04:00
Sukchan Lee 6f6800b52e NGAP is added 2020-05-22 22:24:48 -04:00