Fork me on GitHub
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/ssl.h>
21 #include <openssl/srtp.h>
22 int srtp_crypto_get_random(uint8_t *key, int len);
23 #else
24 #include <srtp/srtp.h>
25 #include <srtp/crypto_kernel.h>
26 #define srtp_err_status_t err_status_t
27 #define srtp_err_status_ok err_status_ok
28 #define srtp_err_status_replay_fail err_status_replay_fail
29 #define srtp_err_status_replay_old err_status_replay_old
30 #define srtp_crypto_policy_set_rtp_default crypto_policy_set_rtp_default
31 #define srtp_crypto_policy_set_rtcp_default crypto_policy_set_rtcp_default
32 #define srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32 crypto_policy_set_aes_cm_128_hmac_sha1_32
33 #define srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80 crypto_policy_set_aes_cm_128_hmac_sha1_80
34 #define srtp_crypto_policy_set_aes_gcm_256_16_auth crypto_policy_set_aes_gcm_256_16_auth
35 #define srtp_crypto_policy_set_aes_gcm_128_16_auth crypto_policy_set_aes_gcm_128_16_auth
36 #define srtp_crypto_get_random crypto_get_random
37 #endif
38 
39 /* SRTP stuff (http://tools.ietf.org/html/rfc3711) */
40 #define SRTP_MASTER_KEY_LENGTH 16
41 #define SRTP_MASTER_SALT_LENGTH 14
42 #define SRTP_MASTER_LENGTH (SRTP_MASTER_KEY_LENGTH + SRTP_MASTER_SALT_LENGTH)
43 /* AES-GCM stuff (http://tools.ietf.org/html/rfc7714) */
44 #define SRTP_AESGCM128_MASTER_KEY_LENGTH 16
45 #define SRTP_AESGCM128_MASTER_SALT_LENGTH 12
46 #define SRTP_AESGCM128_MASTER_LENGTH (SRTP_AESGCM128_MASTER_KEY_LENGTH + SRTP_AESGCM128_MASTER_SALT_LENGTH)
47 #define SRTP_AESGCM256_MASTER_KEY_LENGTH 32
48 #define SRTP_AESGCM256_MASTER_SALT_LENGTH 12
49 #define SRTP_AESGCM256_MASTER_LENGTH (SRTP_AESGCM256_MASTER_KEY_LENGTH + SRTP_AESGCM256_MASTER_SALT_LENGTH)
50 
51 /* SRTP profiles */
52 typedef enum janus_srtp_profile {
58 
59 #ifndef SRTP_AEAD_AES_256_GCM
60  #undef HAVE_SRTP_AESGCM
61 #endif
62 
66 const char *janus_srtp_error_str(int error);
67 
68 #endif
const char * janus_srtp_error_str(int error)
Helper method to get a string representation of a libsrtp error code.
Definition: rtp.c:643
Definition: rtpsrtp.h:56
#define srtp_crypto_get_random
Definition: rtpsrtp.h:36
Definition: rtpsrtp.h:53
janus_srtp_profile
Definition: rtpsrtp.h:52
Definition: rtpsrtp.h:55
Definition: rtpsrtp.h:54