static void on_zrtp_secure(zrtp_stream_t *stream) { const struct menc_media *st = zrtp_stream_get_userdata(stream); const struct menc_sess *sess = st->sess; zrtp_session_info_t sess_info; zrtp_session_get(sess->zrtp_session, &sess_info); if (!sess_info.sas_is_verified && sess_info.sas_is_ready) { info("zrtp: verify SAS <%s> <%s> for remote peer %w" " (press 'Z' <ZID> to verify)\n", sess_info.sas1.buffer, sess_info.sas2.buffer, sess_info.peer_zid.buffer, (size_t)sess_info.peer_zid.length); } }
static void on_zrtp_secure(zrtp_stream_t *stream) { const struct menc_media *st = zrtp_stream_get_userdata(stream); const struct menc_sess *sess = st->sess; zrtp_session_info_t sess_info; char buf[128] = ""; zrtp_session_get(sess->zrtp_session, &sess_info); if (!sess_info.sas_is_verified && sess_info.sas_is_ready) { info("zrtp: verify SAS <%s> <%s> for remote peer %w" " (type /zrtp_verify %w to verify)\n", sess_info.sas1.buffer, sess_info.sas2.buffer, sess_info.peer_zid.buffer, (size_t)sess_info.peer_zid.length, sess_info.peer_zid.buffer, (size_t)sess_info.peer_zid.length); if (sess->eventh) { if (re_snprintf(buf, sizeof(buf), "%s,%s,%w", sess_info.sas1.buffer, sess_info.sas2.buffer, sess_info.peer_zid.buffer, (size_t)sess_info.peer_zid.length)) (sess->eventh)(MENC_EVENT_VERIFY_REQUEST, buf, sess->arg); else warning("zrtp: failed to print verify " " arguments\n"); } } else if (sess_info.sas_is_verified) { info("zrtp: secure session with verified remote peer %w\n", sess_info.peer_zid.buffer, (size_t)sess_info.peer_zid.length); if (sess->eventh) { if (re_snprintf(buf, sizeof(buf), "%w", sess_info.peer_zid.buffer, (size_t)sess_info.peer_zid.length)) (sess->eventh)(MENC_EVENT_PEER_VERIFIED, buf, sess->arg); else warning("zrtp: failed to print verified " " argument\n"); } } }
zrtp_status_t zrtp_test_session_get(zrtp_test_id_t id, zrtp_test_session_info_t* info) { zrtp_status_t s; zrtp_test_session_t *session = zrtp_test_session_by_id(id); if (session) { s = zrtp_session_get(session->zrtp, &info->zrtp); if (zrtp_status_ok == s) { unsigned i; for (i=0; i<session->streams_count; i++) { s = zrtp_test_stream_get(session->streams[i].id, &info->streams[i]); if (zrtp_status_ok != s) break; } } return s; } else { return zrtp_status_bad_param; } }