mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
FS-11816: [Build-System] Update libsrtp to 2.2.0
This commit is contained in:
@@ -47,46 +47,51 @@
|
||||
#define SRTP_AUTH_H
|
||||
|
||||
#include "srtp.h"
|
||||
#include "crypto_types.h" /* for values of auth_type_id_t */
|
||||
#include "crypto_types.h" /* for values of auth_type_id_t */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef const struct srtp_auth_type_t *srtp_auth_type_pointer;
|
||||
typedef struct srtp_auth_t *srtp_auth_pointer_t;
|
||||
typedef struct srtp_auth_t *srtp_auth_pointer_t;
|
||||
|
||||
typedef srtp_err_status_t (*srtp_auth_alloc_func)
|
||||
(srtp_auth_pointer_t *ap, int key_len, int out_len);
|
||||
typedef srtp_err_status_t (*srtp_auth_alloc_func)(srtp_auth_pointer_t *ap,
|
||||
int key_len,
|
||||
int out_len);
|
||||
|
||||
typedef srtp_err_status_t (*srtp_auth_init_func)
|
||||
(void *state, const uint8_t *key, int key_len);
|
||||
typedef srtp_err_status_t (*srtp_auth_init_func)(void *state,
|
||||
const uint8_t *key,
|
||||
int key_len);
|
||||
|
||||
typedef srtp_err_status_t (*srtp_auth_dealloc_func)(srtp_auth_pointer_t ap);
|
||||
|
||||
typedef srtp_err_status_t (*srtp_auth_compute_func)
|
||||
(void *state, const uint8_t *buffer, int octets_to_auth,
|
||||
int tag_len, uint8_t *tag);
|
||||
typedef srtp_err_status_t (*srtp_auth_compute_func)(void *state,
|
||||
const uint8_t *buffer,
|
||||
int octets_to_auth,
|
||||
int tag_len,
|
||||
uint8_t *tag);
|
||||
|
||||
typedef srtp_err_status_t (*srtp_auth_update_func)
|
||||
(void *state, const uint8_t *buffer, int octets_to_auth);
|
||||
typedef srtp_err_status_t (*srtp_auth_update_func)(void *state,
|
||||
const uint8_t *buffer,
|
||||
int octets_to_auth);
|
||||
|
||||
typedef srtp_err_status_t (*srtp_auth_start_func)(void *state);
|
||||
|
||||
/* some syntactic sugar on these function types */
|
||||
#define srtp_auth_type_alloc(at, a, klen, outlen) \
|
||||
#define srtp_auth_type_alloc(at, a, klen, outlen) \
|
||||
((at)->alloc((a), (klen), (outlen)))
|
||||
|
||||
#define srtp_auth_init(a, key) \
|
||||
#define srtp_auth_init(a, key) \
|
||||
(((a)->type)->init((a)->state, (key), ((a)->key_len)))
|
||||
|
||||
#define srtp_auth_compute(a, buf, len, res) \
|
||||
#define srtp_auth_compute(a, buf, len, res) \
|
||||
(((a)->type)->compute((a)->state, (buf), (len), (a)->out_len, (res)))
|
||||
|
||||
#define srtp_auth_update(a, buf, len) \
|
||||
#define srtp_auth_update(a, buf, len) \
|
||||
(((a)->type)->update((a)->state, (buf), (len)))
|
||||
|
||||
#define srtp_auth_start(a)(((a)->type)->start((a)->state))
|
||||
#define srtp_auth_start(a) (((a)->type)->start((a)->state))
|
||||
|
||||
#define srtp_auth_dealloc(c) (((c)->type)->dealloc(c))
|
||||
|
||||
@@ -105,13 +110,14 @@ int srtp_auth_get_prefix_length(const struct srtp_auth_t *a);
|
||||
* function below)
|
||||
*/
|
||||
typedef struct srtp_auth_test_case_t {
|
||||
int key_length_octets; /* octets in key */
|
||||
const uint8_t *key; /* key */
|
||||
int data_length_octets; /* octets in data */
|
||||
const uint8_t *data; /* data */
|
||||
int tag_length_octets; /* octets in tag */
|
||||
const uint8_t *tag; /* tag */
|
||||
const struct srtp_auth_test_case_t *next_test_case; /* pointer to next testcase */
|
||||
int key_length_octets; /* octets in key */
|
||||
const uint8_t *key; /* key */
|
||||
int data_length_octets; /* octets in data */
|
||||
const uint8_t *data; /* data */
|
||||
int tag_length_octets; /* octets in tag */
|
||||
const uint8_t *tag; /* tag */
|
||||
const struct srtp_auth_test_case_t
|
||||
*next_test_case; /* pointer to next testcase */
|
||||
} srtp_auth_test_case_t;
|
||||
|
||||
/* srtp_auth_type_t */
|
||||
@@ -122,17 +128,17 @@ typedef struct srtp_auth_type_t {
|
||||
srtp_auth_compute_func compute;
|
||||
srtp_auth_update_func update;
|
||||
srtp_auth_start_func start;
|
||||
const char *description;
|
||||
const srtp_auth_test_case_t *test_data;
|
||||
const char *description;
|
||||
const srtp_auth_test_case_t *test_data;
|
||||
srtp_auth_type_id_t id;
|
||||
} srtp_auth_type_t;
|
||||
|
||||
typedef struct srtp_auth_t {
|
||||
const srtp_auth_type_t *type;
|
||||
void *state;
|
||||
int out_len; /* length of output tag in octets */
|
||||
int key_len; /* length of key in octets */
|
||||
int prefix_len; /* length of keystream prefix */
|
||||
void *state;
|
||||
int out_len; /* length of output tag in octets */
|
||||
int key_len; /* length of key in octets */
|
||||
int prefix_len; /* length of keystream prefix */
|
||||
} srtp_auth_t;
|
||||
|
||||
/*
|
||||
@@ -147,8 +153,8 @@ srtp_err_status_t srtp_auth_type_self_test(const srtp_auth_type_t *at);
|
||||
* provided in an array of values of key/message/tag that is known to
|
||||
* be good
|
||||
*/
|
||||
srtp_err_status_t srtp_auth_type_test(const srtp_auth_type_t *at,
|
||||
const srtp_auth_test_case_t *test_data);
|
||||
srtp_err_status_t srtp_auth_type_test(const srtp_auth_type_t *at,
|
||||
const srtp_auth_test_case_t *test_data);
|
||||
|
||||
/*
|
||||
* srtp_replace_auth_type(ct, id)
|
||||
@@ -157,7 +163,8 @@ srtp_err_status_t srtp_auth_type_test(const srtp_auth_type_t *at,
|
||||
* with a new one passed in externally. The new auth type must pass all the
|
||||
* existing auth_type's self tests as well as its own.
|
||||
*/
|
||||
srtp_err_status_t srtp_replace_auth_type(const srtp_auth_type_t *ct, srtp_auth_type_id_t id);
|
||||
srtp_err_status_t srtp_replace_auth_type(const srtp_auth_type_t *ct,
|
||||
srtp_auth_type_id_t id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user