Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: test/dtls_srtp_driver.c

Issue 2344973002: Update libsrtp to version 2.0 (Closed)
Patch Set: Add '.' back to include_dirs Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « srtp/update.sh ('k') | test/getopt_s.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/dtls_srtp_driver.c
diff --git a/srtp/test/dtls_srtp_driver.c b/test/dtls_srtp_driver.c
similarity index 88%
rename from srtp/test/dtls_srtp_driver.c
rename to test/dtls_srtp_driver.c
index 24de11717de58cf550630acad90604db6a4431cc..cc2a002d93b9aacdd4822f99f795b86aed2f7aa3 100644
--- a/srtp/test/dtls_srtp_driver.c
+++ b/test/dtls_srtp_driver.c
@@ -46,7 +46,7 @@
#include "getopt_s.h" /* for local getopt() */
#include "srtp_priv.h"
-err_status_t
+srtp_err_status_t
test_dtls_srtp(void);
srtp_hdr_t *
@@ -64,7 +64,7 @@ int
main(int argc, char *argv[]) {
unsigned do_list_mods = 0;
int q;
- err_status_t err;
+ srtp_err_status_t err;
printf("dtls_srtp_driver\n");
@@ -85,7 +85,7 @@ main(int argc, char *argv[]) {
do_list_mods = 1;
break;
case 'd':
- err = crypto_kernel_set_debug_module(optarg_s, 1);
+ err = srtp_crypto_kernel_set_debug_module(optarg_s, 1);
if (err) {
printf("error: set debug module (%s) failed\n", optarg_s);
exit(1);
@@ -97,7 +97,7 @@ main(int argc, char *argv[]) {
}
if (do_list_mods) {
- err = crypto_kernel_list_debug_modules();
+ err = srtp_crypto_kernel_list_debug_modules();
if (err) {
printf("error: list of debug modules failed\n");
exit(1);
@@ -123,7 +123,7 @@ main(int argc, char *argv[]) {
}
-err_status_t
+srtp_err_status_t
test_dtls_srtp(void) {
srtp_hdr_t *test_packet;
int test_packet_len = 80;
@@ -133,7 +133,9 @@ test_dtls_srtp(void) {
uint8_t salt[SRTP_MAX_KEY_LEN];
unsigned int key_len, salt_len;
srtp_profile_t profile;
- err_status_t err;
+ srtp_err_status_t err;
+
+ memset(&policy, 0x0, sizeof(srtp_policy_t));
/* create a 'null' SRTP session */
err = srtp_create(&s, NULL);
@@ -142,53 +144,52 @@ test_dtls_srtp(void) {
/*
* verify that packet-processing functions behave properly - we
- * expect that these functions will return err_status_no_ctx
+ * expect that these functions will return srtp_err_status_no_ctx
*/
test_packet = srtp_create_test_packet(80, 0xa5a5a5a5);
if (test_packet == NULL)
- return err_status_alloc_fail;
+ return srtp_err_status_alloc_fail;
err = srtp_protect(s, test_packet, &test_packet_len);
- if (err != err_status_no_ctx) {
+ if (err != srtp_err_status_no_ctx) {
printf("wrong return value from srtp_protect() (got code %d)\n",
err);
- return err_status_fail;
+ return srtp_err_status_fail;
}
err = srtp_unprotect(s, test_packet, &test_packet_len);
- if (err != err_status_no_ctx) {
+ if (err != srtp_err_status_no_ctx) {
printf("wrong return value from srtp_unprotect() (got code %d)\n",
err);
- return err_status_fail;
+ return srtp_err_status_fail;
}
err = srtp_protect_rtcp(s, test_packet, &test_packet_len);
- if (err != err_status_no_ctx) {
+ if (err != srtp_err_status_no_ctx) {
printf("wrong return value from srtp_protect_rtcp() (got code %d)\n",
err);
- return err_status_fail;
+ return srtp_err_status_fail;
}
err = srtp_unprotect_rtcp(s, test_packet, &test_packet_len);
- if (err != err_status_no_ctx) {
+ if (err != srtp_err_status_no_ctx) {
printf("wrong return value from srtp_unprotect_rtcp() (got code %d)\n",
err);
- return err_status_fail;
+ return srtp_err_status_fail;
}
/*
* set keys to known values for testing
*/
- memset(&policy, 0, sizeof(policy));
profile = srtp_profile_aes128_cm_sha1_80;
key_len = srtp_profile_get_master_key_length(profile);
salt_len = srtp_profile_get_master_salt_length(profile);
memset(key, 0xff, key_len);
memset(salt, 0xee, salt_len);
- append_salt_to_key(key, key_len, salt, salt_len);
+ srtp_append_salt_to_key(key, key_len, salt, salt_len);
policy.key = key;
/* initialize SRTP policy from profile */
- err = crypto_policy_set_from_profile_for_rtp(&policy.rtp, profile);
+ err = srtp_crypto_policy_set_from_profile_for_rtp(&policy.rtp, profile);
if (err) return err;
- err = crypto_policy_set_from_profile_for_rtcp(&policy.rtcp, profile);
+ err = srtp_crypto_policy_set_from_profile_for_rtcp(&policy.rtcp, profile);
if (err) return err;
policy.ssrc.type = ssrc_any_inbound;
policy.ekt = NULL;
@@ -206,7 +207,7 @@ test_dtls_srtp(void) {
free(test_packet);
- return err_status_ok;
+ return srtp_err_status_ok;
}
« no previous file with comments | « srtp/update.sh ('k') | test/getopt_s.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698