Commit 5d61ed6d authored by jehan's avatar jehan
Browse files

fix compilation issues and ice parsing

parent 6ef87545
......@@ -1072,7 +1072,7 @@ if test "$dtls" = "true" ; then
[[ssl_set_dtls_srtp_protection_profiles(0,0,0)]])]
,[found_polarssl=yes
AC_MSG_NOTICE([polarssl usable for DTLS-SRTP])]
,[AC_MSG_WARN([polarssl not usable for DTLS-SRTP])])
,[AC_MSG_ERROR([polarssl not usable for DTLS-SRTP])])
])
CPPFLAGS=$CPPFLAGS_save
......@@ -1081,8 +1081,8 @@ if test "$dtls" = "true" ; then
if test "x$found_polarssl" = "xyes" ; then
AC_DEFINE(HAVE_dtls, 1, [Defined when dtls support is compiled])
AC_MSG_NOTICE([polarssl usable for DTLS-SRTP])
CPPFLAGS="$CPPFLAGS $POLARSSL_CFLAGS"
LIBS="$LIBS $POLARSSL_LIBS"
AC_SUBST(POLARSSL_CFLAGS)
AC_SUBST(POLARSSL_LIBS)
fi
else
......
......@@ -28,7 +28,7 @@ extern "C"{
#endif
/* defined in mediastream.h */
typedef struct _MediaStream MediaStream;
struct _MediaStream;
typedef enum {
MSDtlsSrtpRoleInvalid,
......@@ -43,17 +43,17 @@ typedef struct MSDtlsSrtpParams {
MSDtlsSrtpRole role; /**< Unset(at caller init, role is then choosen by responder but we must still be able to receive packets) */
} MSDtlsSrtpParams;
typedef struct _MSDtlsSrtpContext MSDtlsSrtpContext ;
typedef struct _MSDtlsSrtpContext MSDtlsSrtpContext;
MS2_PUBLIC bool_t ms_dtls_available(void);
MS2_PUBLIC MSDtlsSrtpContext* ms_dtls_srtp_context_new(MediaStream *stream, RtpSession *s, MSDtlsSrtpParams *params);
MS2_PUBLIC MSDtlsSrtpContext* ms_dtls_srtp_context_new(struct _MediaStream *stream, RtpSession *s, MSDtlsSrtpParams *params);
MS2_PUBLIC void ms_dtls_srtp_start(MSDtlsSrtpContext* context);
MS2_PUBLIC void ms_dtls_srtp_context_destroy(MSDtlsSrtpContext *ctx);
MS2_PUBLIC void ms_dtls_srtp_set_role(MSDtlsSrtpContext *context, MSDtlsSrtpRole role);
MS2_PUBLIC MSDtlsSrtpRole ms_dtls_srtp_get_role(MSDtlsSrtpContext *context);
MS2_PUBLIC MSDtlsSrtpContext* ms_dtls_multistream_new(MediaStream *stream, MSDtlsSrtpContext* activeContext, RtpSession *s, MSDtlsSrtpParams *params);
MS2_PUBLIC MSDtlsSrtpContext* ms_dtls_multistream_new(struct _MediaStream *stream, MSDtlsSrtpContext* activeContext, RtpSession *s, MSDtlsSrtpParams *params);
MS2_PUBLIC void ms_dtls_srtp_set_peer_fingerprint(MSDtlsSrtpContext *context, const char *peer_fingerprint);
MS2_PUBLIC int ms_dtls_srtp_generate_self_signed_certificate(char *certif, char *pkey, char *fingerprint);
......
......@@ -381,7 +381,7 @@ MS2_PUBLIC void ice_session_set_remote_credentials(IceSession *session, const ch
*
* This function is to be called once the remote credentials have been received via SDP.
*/
MS2_PUBLIC const char* ice_check_list_set_remote_ufrag(const IceCheckList *cl);
MS2_PUBLIC const char* ice_check_list_get_remote_ufrag(const IceCheckList *cl);
/**
* get the remote pwd of an ICE check list.
......@@ -390,7 +390,7 @@ MS2_PUBLIC const char* ice_check_list_set_remote_ufrag(const IceCheckList *cl);
*
* This function is to be called once the remote credentials have been received via SDP.
*/
MS2_PUBLIC const char* ice_check_list_set_remote_pwd(const IceCheckList *cl);
MS2_PUBLIC const char* ice_check_list_get_remote_pwd(const IceCheckList *cl);
/**
* Define the maximum number of connectivity checks that will be performed by the agent.
......
......@@ -51,7 +51,8 @@ libmediastreamer_voip_la_LIBADD= libmediastreamer_base.la \
$(LIBV4LCONVERT_LIBS) \
$(SPANDSP_LIBS) \
$(PCAP_LIBS) \
$(OPUS_LIBS)
$(OPUS_LIBS) \
$(POLARSSL_LIBS)
if LIBBZRTP
......@@ -99,7 +100,7 @@ libmediastreamer_voip_la_SOURCES+= voip/private.h \
voip/qosanalyzer.c voip/qosanalyzer.h \
voip/bitratecontrol.c \
voip/zrtp.c \
voip/dtls_srtp.c
voip/dtls_srtp.c
else
libmediastreamer_base_la_SOURCES+= ortp-deps/logging.c \
ortp-deps/port.c \
......@@ -385,7 +386,8 @@ AM_CFLAGS=\
$(SPANDSP_CFLAGS) \
$(MSSILK_CFLAGS) \
$(PCAP_CFLAGS) \
$(OPUS_CFLAGS)
$(OPUS_CFLAGS) \
$(POLARSSL_CFLAGS)
AM_CXXFLAGS=\
$(STRICT_OPTIONS) \
......
......@@ -60,7 +60,7 @@ typedef struct _DtlsRawPacket {
#define READ_TIMEOUT_MS 1000
typedef struct _MSDtlsSrtpContext{
struct _MSDtlsSrtpContext{
RtpSession *session;
MediaStream *stream;
RtpTransportModifier *rtp_modifier;
......@@ -70,7 +70,7 @@ typedef struct _MSDtlsSrtpContext{
MSDtlsSrtpRole role; /**< can be unset(at init on caller side), client or server */
uint64_t time_reference; /**< an epoch in ms, used to manage retransmission when we are client */
char peer_fingerprint[256]; /**< used to store peer fingerprint passed through SDP */
} MSDtlsSrtpContext;
};
// Helper functions
static ORTP_INLINE uint64_t get_timeval_in_millis() {
......@@ -109,7 +109,6 @@ static int ms_dtls_srtp_sendData (void *ctx, const unsigned char *data, size_t l
RtpSession *session = context->session;
RtpTransport *rtpt=NULL;
mblk_t *msg;
int i;
ms_message("DTLS Send packet len %d :\n", (int)length);
......@@ -129,7 +128,6 @@ static int ms_dtls_srtp_DTLSread (void *ctx, unsigned char *buf, size_t len) {
if (context->incoming_buffer == NULL) {
return POLARSSL_ERR_NET_WANT_READ;
} else { /* read the first packet in the buffer and delete it */
int i;
DtlsRawPacket *next_packet = context->incoming_buffer->next;
size_t dataLength = context->incoming_buffer->length;
memcpy(buf, context->incoming_buffer->data, dataLength);
......@@ -218,7 +216,6 @@ static int ms_dtls_srtp_rtp_process_on_receive(struct _RtpTransportModifier *t,
/* check if it is a DTLS packet (first byte B as 19 < B < 64) rfc5764 section 5.1.2 */
if ((*(msg->b_rptr)>19) && (*(msg->b_rptr)<64)) {
int i;
DtlsRawPacket *incoming_dtls_packet = (DtlsRawPacket *)ms_malloc0(sizeof(DtlsRawPacket));
incoming_dtls_packet->next=NULL;
incoming_dtls_packet->data=(unsigned char *)ms_malloc(msgLength);
......@@ -249,7 +246,6 @@ static int ms_dtls_srtp_rtp_process_on_receive(struct _RtpTransportModifier *t,
}
if ((ret==0) && (ctx->channel_status == DTLS_STATUS_CONTEXT_READY)) { /* handshake is over, give the keys to srtp : 128 bits client write - 128 bits server write - 112 bits client salt - 112 server salt */
int i;
unsigned char *computed_peer_fingerprint = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment