Test adding and removing a single stream from an srtp session. (Bug #2192597,
reported by Steve Kiser.)
diff --git a/test/srtp_driver.c b/test/srtp_driver.c
index 5e397d2..a1b4866 100644
--- a/test/srtp_driver.c
+++ b/test/srtp_driver.c
@@ -1444,7 +1444,7 @@
err_status_t
srtp_test_remove_stream() {
err_status_t status;
- srtp_policy_t *policy_list;
+ srtp_policy_t *policy_list, policy;
srtp_t session;
srtp_stream_t stream;
/*
@@ -1493,6 +1493,33 @@
if (status != err_status_ok)
return status;
+ /* Now test adding and removing a single stream */
+ crypto_policy_set_rtp_default(&policy.rtp);
+ crypto_policy_set_rtcp_default(&policy.rtcp);
+ policy.ssrc.type = ssrc_specific;
+ policy.ssrc.value = 0xcafebabe;
+ policy.key = test_key;
+ policy.ekt = NULL;
+ policy.window_size = 128;
+ policy.allow_repeat_tx = 0;
+ policy.next = NULL;
+
+ status = srtp_create(&session, NULL);
+ if (status != err_status_ok)
+ return status;
+
+ status = srtp_add_stream(session, &policy);
+ if (status != err_status_ok)
+ return status;
+
+ status = srtp_remove_stream(session, htonl(0xcafebabe));
+ if (status != err_status_ok)
+ return status;
+
+ status = srtp_dealloc(session);
+ if (status != err_status_ok)
+ return status;
+
return err_status_ok;
}