Skip to content

Commit

Permalink
Merge branch 'master' into dead-code
Browse files Browse the repository at this point in the history
  • Loading branch information
bifurcation committed Apr 25, 2021
2 parents af5f5f8 + 3136ffa commit a34c9b5
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 603 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ matrix:
- sudo docker exec --tty mipsX apt-get update
- sudo docker exec --tty mipsX apt-get install build-essential -y
- sudo docker exec --tty mipsX apt-get install qemu-user-static qemu-system-mips gcc-mips-linux-gnu python3-pip -y
- sudo docker exec --tty mipsX pip3 install meson ninja
- sudo docker exec --tty mipsX pip3 install meson==0.56.2 ninja
script:
- sudo docker exec --tty mipsX bash -c 'EXTRA_CFLAGS=-static CC=mips-linux-gnu-gcc ./configure --host=mips-linux-gnu'
- sudo docker exec --tty mipsX make
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ if(BUILD_WITH_SANITIZERS AND NOT WIN32)
endif()

set(SOURCES_C
srtp/ekt.c
srtp/srtp.c
)

Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ cryptobj = $(ciphers) $(hashes) $(math) $(kernel) $(replay)

# libsrtp2.a (implements srtp processing)

srtpobj = srtp/srtp.o srtp/ekt.o
srtpobj = srtp/srtp.o

libsrtp2.a: $(srtpobj) $(cryptobj) $(gdoi)
$(AR) cr libsrtp2.a $^
Expand Down
41 changes: 0 additions & 41 deletions fuzzer/fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <limits.h>
#include "srtp.h"
#include "srtp_priv.h"
#include "ekt.h"
#include "fuzzer.h"
#include "mt19937.h"
#include "testmem.h"
Expand Down Expand Up @@ -411,33 +410,6 @@ static srtp_master_key_t **extract_master_keys(const uint8_t **data,
return ret;
}

static srtp_ekt_policy_t extract_ekt_policy(const uint8_t **data, size_t *size)
{
srtp_ekt_policy_t ret = NULL;
struct {
srtp_ekt_spi_t spi;
uint8_t key[16];

} params;

EXTRACT_IF(&params, *data, *size, sizeof(params));

ret = fuzz_alloc_succeed(sizeof(struct srtp_ekt_policy_ctx_t), false);

ret->spi = params.spi;

/* The only supported cipher type */
ret->ekt_cipher_type = SRTP_EKT_CIPHER_AES_128_ECB;

ret->ekt_key = fuzz_alloc_succeed(sizeof(params.key), false);
memcpy(ret->ekt_key, params.key, sizeof(params.key));

ret->next_ekt_policy = NULL;

end:
return ret;
}

static srtp_policy_t *extract_policy(const uint8_t **data, size_t *size)
{
srtp_policy_t *policy = NULL;
Expand All @@ -448,8 +420,6 @@ static srtp_policy_t *extract_policy(const uint8_t **data, size_t *size)
uint8_t ssrc_type;
uint32_t ssrc_value;
uint8_t num_xtn_hdr;
uint8_t with_ekt;
srtp_ekt_spi_t ekt_spi;
uint8_t do_extract_key;
uint8_t do_extract_master_keys;
} params;
Expand All @@ -461,7 +431,6 @@ static srtp_policy_t *extract_policy(const uint8_t **data, size_t *size)
params.allow_repeat_tx %= 2;
params.ssrc_type %=
sizeof(fuzz_ssrc_type_map) / sizeof(fuzz_ssrc_type_map[0]);
params.with_ekt %= 2;

policy = fuzz_alloc_succeed(sizeof(*policy), true);

Expand Down Expand Up @@ -510,10 +479,6 @@ static srtp_policy_t *extract_policy(const uint8_t **data, size_t *size)
}
}

if (params.with_ekt) {
policy->ekt = extract_ekt_policy(data, size);
}

policy->window_size = params.window_size;
policy->allow_repeat_tx = params.allow_repeat_tx;
policy->next = NULL;
Expand Down Expand Up @@ -630,12 +595,6 @@ static void free_policies(srtp_policy_t *curpolicy)

fuzz_free(curpolicy->keys);
fuzz_free(curpolicy->enc_xtn_hdr);

if (curpolicy->ekt) {
fuzz_free(curpolicy->ekt->ekt_key);
fuzz_free(curpolicy->ekt);
}

fuzz_free(curpolicy);

curpolicy = next;
Expand Down
181 changes: 0 additions & 181 deletions include/ekt.h

This file was deleted.

14 changes: 2 additions & 12 deletions include/srtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,6 @@ typedef struct {
/**< wildcard */
} srtp_ssrc_t;

/**
* @brief points to an EKT policy
*/
typedef struct srtp_ekt_policy_ctx_t *srtp_ekt_policy_t;

/**
* @brief points to EKT stream data
*/
typedef struct srtp_ekt_stream_ctx_t *srtp_ekt_stream_t;

/**
* @brief srtp_master_key_t represents a master key. There will
* be a Master Key Index and the Master Key associated with the
Expand Down Expand Up @@ -329,8 +319,8 @@ typedef struct srtp_policy_t {
/**< this stream. */
srtp_master_key_t **keys; /** Array of Master Key structures */
unsigned long num_master_keys; /** Number of master keys */
srtp_ekt_policy_t ekt; /**< Pointer to the EKT policy structure */
/**< for this stream (if any) */
void *deprecated_ekt; /**< DEPRECATED: pointer to the EKT */
/**< policy structure for this stream */
unsigned long window_size; /**< The window size to use for replay */
/**< protection. */
int allow_repeat_tx; /**< Whether retransmissions of */
Expand Down
1 change: 0 additions & 1 deletion include/srtp_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ typedef struct srtp_stream_ctx_t_ {
srtp_sec_serv_t rtcp_services;
direction_t direction;
int allow_repeat_tx;
srtp_ekt_stream_t ekt;
int *enc_xtn_hdr;
int enc_xtn_hdr_count;
uint32_t pending_roc;
Expand Down
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ if get_option('optimization') not in ['0', 'g', 's']
endif

sources = files(
'srtp/ekt.c',
'srtp/srtp.c',
)

Expand Down
Loading

0 comments on commit a34c9b5

Please sign in to comment.