Skip to content

Commit

Permalink
Merge branch 'next' into agpl_next
Browse files Browse the repository at this point in the history
# Conflicts:
#	cmake/modules/FindPolarssl.cmake
  • Loading branch information
srs-codebot committed Nov 6, 2022
2 parents e1d5f40 + ba34570 commit 254cc71
Show file tree
Hide file tree
Showing 42 changed files with 270 additions and 255 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-18.04]
os: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04]
compiler: [gcc, clang]
steps:
- uses: actions/checkout@v3
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '38 10 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get install \
build-essential \
cmake \
libfftw3-dev \
libmbedtls-dev \
libpcsclite-dev \
libboost-program-options-dev \
libconfig++-dev \
libsctp-dev \
libuhd-dev \
libzmq3-dev
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
23 changes: 0 additions & 23 deletions .lgtm.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Change Log for Releases
=======================

## 22.10
* Fix DL NAS integrity checks in srsUE
* Remove Travis and LGTM as CI platforms
* Remove polarssl as optional dependency (only mbedTLS used and required for security)
* Allow to specify multiple PLMNs in SIB1
* Allow non-blocking S1AP connect and expose various other SCTP options
* Add support to broadcast MAC backoff indicator
* Seperate T300/T301 timer in srsENB
* Fix in eMBMS payload buffer handling
* Fix memleak in NR scheduler

## 22.04.1
* Various bug fixes in RLC AM and PDCP for NR
* Fix crash when UE attempted to reestablish in SA
Expand Down
28 changes: 8 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,29 +180,17 @@ else(USE_MKL)
endif(USE_MKL)

# Crypto
find_package(Polarssl)
if (POLARSSL_FOUND)
set(SEC_INCLUDE_DIRS "${POLARSSL_INCLUDE_DIRS}")
find_package(MbedTLS REQUIRED)
if (MBEDTLS_FOUND)
set(SEC_INCLUDE_DIRS "${MBEDTLS_INCLUDE_DIRS}")
if(BUILD_STATIC)
set(SEC_LIBRARIES "${POLARSSL_STATIC_LIBRARIES}")
set(SEC_LIBRARIES "${MBEDTLS_STATIC_LIBRARIES}")
else(BUILD_STATIC)
set(SEC_LIBRARIES "${POLARSSL_LIBRARIES}")
set(SEC_LIBRARIES "${MBEDTLS_LIBRARIES}")
endif(BUILD_STATIC)
add_definitions(-DHAVE_POLARSSL)
else(POLARSSL_FOUND)
find_package(MbedTLS REQUIRED)
if (MBEDTLS_FOUND)
set(SEC_INCLUDE_DIRS "${MBEDTLS_INCLUDE_DIRS}")
if(BUILD_STATIC)
set(SEC_LIBRARIES "${MBEDTLS_STATIC_LIBRARIES}")
else(BUILD_STATIC)
set(SEC_LIBRARIES "${MBEDTLS_LIBRARIES}")
endif(BUILD_STATIC)
add_definitions(-DHAVE_MBEDTLS)
else(MBEDTLS_FOUND)
message(FATAL_ERROR "Either PolarSSL or mbedTLS are required to build srsRAN")
endif (MBEDTLS_FOUND)
endif(POLARSSL_FOUND)
else(MBEDTLS_FOUND)
message(FATAL_ERROR "mbedTLS is required to build srsRAN")
endif (MBEDTLS_FOUND)

# Hard-SIM support
if(ENABLE_HARDSIM)
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
srsRAN
======

[![Build Status](https://github.com/srsran/srsRAN/actions/workflows/ccpp.yml/badge.svg?branch=master)](https://github.com/srsran/srsRAN/actions)
[![Build Status](https://app.travis-ci.com/srsran/srsRAN.svg?branch=master)](https://app.travis-ci.com/github/srsran/srsRAN)
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/srsran/srsRAN.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/srsran/srsRAN/context:cpp)
[![Build Status](https://github.com/srsran/srsRAN/actions/workflows/ccpp.yml/badge.svg?branch=master)](https://github.com/srsran/srsRAN/actions/workflows/ccpp.yml)
[![CodeQL](https://github.com/srsran/srsRAN/actions/workflows/codeql.yml/badge.svg?branch=master)](https://github.com/srsran/srsRAN/actions/workflows/codeql.yml)
[![Coverity](https://scan.coverity.com/projects/23045/badge.svg)](https://scan.coverity.com/projects/srsran)

srsRAN is a 4G/5G software radio suite developed by [SRS](http://www.srs.io).
Expand Down
73 changes: 0 additions & 73 deletions cmake/modules/FindPolarssl.cmake

This file was deleted.

4 changes: 2 additions & 2 deletions cmake/modules/SRSRANVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#

SET(SRSRAN_VERSION_MAJOR 22)
SET(SRSRAN_VERSION_MINOR 04)
SET(SRSRAN_VERSION_PATCH 1)
SET(SRSRAN_VERSION_MINOR 10)
SET(SRSRAN_VERSION_PATCH 0)
SET(SRSRAN_VERSION_STRING "${SRSRAN_VERSION_MAJOR}.${SRSRAN_VERSION_MINOR}.${SRSRAN_VERSION_PATCH}")
SET(SRSRAN_SOVERSION 0)
21 changes: 0 additions & 21 deletions lib/include/srsran/common/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,6 @@
#ifndef SRSRAN_SSL_H
#define SRSRAN_SSL_H

#ifdef HAVE_POLARSSL

#include "polarssl/aes.h"
#include "polarssl/sha256.h"

inline void sha256(const unsigned char* key,
size_t keylen,
const unsigned char* input,
size_t ilen,
unsigned char output[32],
int is224)
{
sha256_hmac(key, keylen, input, ilen, output, is224);
}

#endif // HAVE_POLARSSL

#ifdef HAVE_MBEDTLS

#include "mbedtls/aes.h"
#include "mbedtls/md.h"

Expand Down Expand Up @@ -80,6 +61,4 @@ inline void sha256(const unsigned char* key,
mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), key, keylen, input, ilen, output);
}

#endif // HAVE_MBEDTLS

#endif // SRSRAN_SSL_H
2 changes: 1 addition & 1 deletion lib/include/srsran/interfaces/enb_rlc_interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class rlc_interface_rrc
virtual void clear_buffer(uint16_t rnti) = 0;
virtual void add_user(uint16_t rnti) = 0;
virtual void rem_user(uint16_t rnti) = 0;
virtual void add_bearer(uint16_t rnti, uint32_t lcid, srsran::rlc_config_t cnfg) = 0;
virtual void add_bearer(uint16_t rnti, uint32_t lcid, const srsran::rlc_config_t& cnfg) = 0;
virtual void add_bearer_mrb(uint16_t rnti, uint32_t lcid) = 0;
virtual void del_bearer(uint16_t rnti, uint32_t lcid) = 0;
virtual void write_sdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t sdu) = 0;
Expand Down
1 change: 1 addition & 0 deletions lib/include/srsran/interfaces/enb_s1ap_interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ struct s1ap_args_t {
uint32_t ts1_reloc_prep_timeout;
uint32_t ts1_reloc_overall_timeout;
int32_t max_s1_setup_retries;
uint32_t s1_connect_timer;
bool sctp_reuse_addr;
int32_t sctp_rto_max;
int32_t sctp_init_max_attempts;
Expand Down
6 changes: 5 additions & 1 deletion lib/src/asn1/liblte_mme.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3019,9 +3019,13 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_emergency_number_list_ie(uint8**
emerg_num_list->N_emerg_nums = 0;
while (length < sent_length) {
idx = emerg_num_list->N_emerg_nums;
//add length check on emergency number list
if (idx >= LIBLTE_MME_EMERGENCY_NUMBER_LIST_MAX_SIZE) {
return (err);
}
emerg_num_list->emerg_num[idx].N_emerg_num_digits = ((*ie_ptr)[length++] - 1) * 2;
if (emerg_num_list->emerg_num[idx].N_emerg_num_digits > LIBLTE_MME_EMERGENCY_NUMBER_MAX_NUM_DIGITS) {
return err;
return (err);
}

emerg_num_list->emerg_num[idx].emerg_service_cat =
Expand Down
13 changes: 1 addition & 12 deletions lib/src/common/security.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,13 @@
*/

#include "srsran/common/security.h"
#include "mbedtls/md5.h"
#include "srsran/common/liblte_security.h"
#include "srsran/common/s3g.h"
#include "srsran/common/ssl.h"
#include "srsran/config.h"
#include <arpa/inet.h>

#ifdef HAVE_MBEDTLS
#include "mbedtls/md5.h"
#endif
#ifdef HAVE_POLARSSL
#include "polarssl/md5.h"
#endif

#define FC_EPS_K_ASME_DERIVATION 0x10
#define FC_EPS_K_ENB_DERIVATION 0x11
#define FC_EPS_NH_DERIVATION 0x12
Expand Down Expand Up @@ -850,12 +844,7 @@ uint8_t security_128_eia3(const uint8_t* key,
uint8_t security_md5(const uint8_t* input, size_t len, uint8_t* output)
{
memset(output, 0x00, 16);
#ifdef HAVE_MBEDTLS
mbedtls_md5(input, len, output);
#endif // HAVE_MBEDTLS
#ifdef HAVE_POLARSSL
md5(input, len, output);
#endif
return SRSRAN_SUCCESS;
}

Expand Down
Loading

0 comments on commit 254cc71

Please sign in to comment.