2020-01-24 08:13:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "frame.hh"
|
2020-10-01 04:58:14 +00:00
|
|
|
#include "socket.hh"
|
2020-01-24 08:13:43 +00:00
|
|
|
#include "util.hh"
|
|
|
|
|
2020-09-04 08:25:16 +00:00
|
|
|
#include "zrtp/defines.hh"
|
2020-09-09 07:31:11 +00:00
|
|
|
#include "zrtp/zrtp_receiver.hh"
|
2020-01-24 08:13:43 +00:00
|
|
|
|
2020-04-27 11:07:24 +00:00
|
|
|
namespace uvg_rtp {
|
2020-01-24 08:13:43 +00:00
|
|
|
|
2020-02-02 06:22:58 +00:00
|
|
|
typedef struct zrtp_session zrtp_session_t;
|
|
|
|
|
2020-01-24 08:13:43 +00:00
|
|
|
namespace zrtp_msg {
|
|
|
|
|
2020-08-13 03:47:26 +00:00
|
|
|
PACKED_STRUCT(zrtp_dh) {
|
2020-01-24 08:13:43 +00:00
|
|
|
zrtp_msg msg_start;
|
2020-01-29 09:19:46 +00:00
|
|
|
uint32_t hash[8];
|
|
|
|
uint8_t rs1_id[8];
|
|
|
|
uint8_t rs2_id[8];
|
|
|
|
uint8_t aux_secret[8];
|
|
|
|
uint8_t pbx_secret[8];
|
|
|
|
uint8_t pk[384];
|
|
|
|
uint8_t mac[8];
|
|
|
|
uint32_t crc;
|
2020-01-24 08:13:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class dh_key_exchange {
|
|
|
|
public:
|
2020-01-29 10:10:53 +00:00
|
|
|
dh_key_exchange(zrtp_session_t& session, int part);
|
|
|
|
dh_key_exchange(struct zrtp_dh *dh);
|
2020-01-24 08:13:43 +00:00
|
|
|
~dh_key_exchange();
|
|
|
|
|
|
|
|
/* TODO: */
|
2020-10-01 04:58:14 +00:00
|
|
|
rtp_error_t send_msg(uvg_rtp::socket *socket, sockaddr_in& addr);
|
2020-01-24 08:13:43 +00:00
|
|
|
|
|
|
|
/* TODO: */
|
2020-04-27 11:07:24 +00:00
|
|
|
rtp_error_t parse_msg(uvg_rtp::zrtp_msg::receiver& receiver, zrtp_session_t& session);
|
2020-01-29 09:19:46 +00:00
|
|
|
|
2020-01-24 08:13:43 +00:00
|
|
|
private:
|
2020-04-27 11:07:24 +00:00
|
|
|
uvg_rtp::frame::zrtp_frame *frame_;
|
|
|
|
uvg_rtp::frame::zrtp_frame *rframe_;
|
2020-01-24 08:13:43 +00:00
|
|
|
size_t len_, rlen_;
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|