Give key agreement type for init_session() as a parameter

This commit is contained in:
Aaro Altonen 2020-06-26 08:18:55 +03:00
parent 027bbf3c73
commit e8b2947072
2 changed files with 4 additions and 4 deletions

View File

@ -236,7 +236,7 @@ namespace uvg_rtp {
*
* Return RTP_OK on success
* Return RTP_TIMEOUT if no message is received from remote before T2 expires */
rtp_error_t init_session();
rtp_error_t init_session(int key_agreement);
/* Calculate HMAC-SHA256 using "key" for "buf" of "len" bytes
* and compare the truncated, 64-bit hash digest against "mac".

View File

@ -372,13 +372,13 @@ rtp_error_t uvg_rtp::zrtp::begin_session()
return RTP_TIMEOUT;
}
rtp_error_t uvg_rtp::zrtp::init_session()
rtp_error_t uvg_rtp::zrtp::init_session(int key_agreement)
{
/* Create ZRTP session from capabilities struct we've constructed */
session_.hash_algo = S256;
session_.cipher_algo = AES1;
session_.auth_tag_type = HS32;
session_.key_agreement_type = DH3k;
session_.key_agreement_type = key_agreement;
session_.sas_type = B32;
int type = 0;
@ -651,7 +651,7 @@ rtp_error_t uvg_rtp::zrtp::init_dhm(uint32_t ssrc, socket_t& socket, sockaddr_in
*
* init_session() will exchange the Commit messages and select roles for the
* participants (initiator/responder) based on rules determined in RFC 6189 */
if ((ret = init_session()) != RTP_OK) {
if ((ret = init_session(DH3k)) != RTP_OK) {
LOG_ERROR("Could not agree on ZRTP session parameters or roles of participants!");
return ret;
}