Janus
Home
Demos
Documentation
Cite us!
Support
Community
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
rtpsrtp.h
Go to the documentation of this file.
1
13
#ifndef _JANUS_RTPSRTP_H
14
#define _JANUS_RTPSRTP_H
15
16
#ifdef HAVE_SRTP_2
17
#include <srtp2/srtp.h>
18
#include <openssl/rand.h>
19
#include <openssl/err.h>
20
#include <openssl/srtp.h>
21
int
srtp_crypto_get_random
(uint8_t *key,
int
len);
22
#else
23
#include <srtp/srtp.h>
24
#include <srtp/crypto_kernel.h>
25
#define srtp_err_status_t err_status_t
26
#define srtp_err_status_ok err_status_ok
27
#define srtp_err_status_replay_fail err_status_replay_fail
28
#define srtp_err_status_replay_old err_status_replay_old
29
#define srtp_crypto_policy_set_rtp_default crypto_policy_set_rtp_default
30
#define srtp_crypto_policy_set_rtcp_default crypto_policy_set_rtcp_default
31
#define srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32 crypto_policy_set_aes_cm_128_hmac_sha1_32
32
#define srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80 crypto_policy_set_aes_cm_128_hmac_sha1_80
33
#define srtp_crypto_policy_set_aes_gcm_256_16_auth crypto_policy_set_aes_gcm_256_16_auth
34
#define srtp_crypto_policy_set_aes_gcm_128_16_auth crypto_policy_set_aes_gcm_128_16_auth
35
#define srtp_crypto_get_random crypto_get_random
36
#endif
37
38
/* SRTP stuff (http://tools.ietf.org/html/rfc3711) */
39
#define SRTP_MASTER_KEY_LENGTH 16
40
#define SRTP_MASTER_SALT_LENGTH 14
41
#define SRTP_MASTER_LENGTH (SRTP_MASTER_KEY_LENGTH + SRTP_MASTER_SALT_LENGTH)
42
/* AES-GCM stuff (http://tools.ietf.org/html/rfc7714) */
43
#define SRTP_AESGCM128_MASTER_KEY_LENGTH 16
44
#define SRTP_AESGCM128_MASTER_SALT_LENGTH 12
45
#define SRTP_AESGCM128_MASTER_LENGTH (SRTP_AESGCM128_MASTER_KEY_LENGTH + SRTP_AESGCM128_MASTER_SALT_LENGTH)
46
#define SRTP_AESGCM256_MASTER_KEY_LENGTH 32
47
#define SRTP_AESGCM256_MASTER_SALT_LENGTH 12
48
#define SRTP_AESGCM256_MASTER_LENGTH (SRTP_AESGCM256_MASTER_KEY_LENGTH + SRTP_AESGCM256_MASTER_SALT_LENGTH)
49
50
/* SRTP profiles */
51
typedef
enum
janus_srtp_profile
{
52
JANUS_SRTP_AES128_CM_SHA1_32
= 1,
53
JANUS_SRTP_AES128_CM_SHA1_80
,
54
JANUS_SRTP_AEAD_AES_128_GCM
,
55
JANUS_SRTP_AEAD_AES_256_GCM
56
}
janus_srtp_profile
;
57
58
#ifndef SRTP_AEAD_AES_256_GCM
59
#undef HAVE_SRTP_AESGCM
60
#endif
61
65
const
char
*
janus_srtp_error_str
(
int
error);
66
67
#endif
janus_srtp_error_str
const char * janus_srtp_error_str(int error)
Helper method to get a string representation of a libsrtp error code.
Definition:
rtp.c:599
JANUS_SRTP_AEAD_AES_256_GCM
Definition:
rtpsrtp.h:55
srtp_crypto_get_random
#define srtp_crypto_get_random
Definition:
rtpsrtp.h:35
JANUS_SRTP_AES128_CM_SHA1_32
Definition:
rtpsrtp.h:52
janus_srtp_profile
janus_srtp_profile
Definition:
rtpsrtp.h:51
JANUS_SRTP_AEAD_AES_128_GCM
Definition:
rtpsrtp.h:54
JANUS_SRTP_AES128_CM_SHA1_80
Definition:
rtpsrtp.h:53