FS-9785: upgrade libsrtp to 2.1

This commit is contained in:
Mike Jerris committed 2017-06-26 14:14:36 -05:00
1 parent 19e8621682
commit 3bcf5b7ff8
129 files changed
+21084 -21652

No files matched your search

+21 -18
View File
@@ -8,7 +8,7 @@
*/
/*
*
* Copyright(c) 2001-2006 Cisco Systems, Inc.
* Copyright(c) 2001-2017 Cisco Systems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,8 +43,12 @@
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h> /* for printf() */
#include <unistd.h> /* for getopt() */
#include "getopt_s.h"
#include "crypto_kernel.h"
void
@@ -55,25 +59,24 @@ usage(char *prog_name) {
int
main (int argc, char *argv[]) {
extern char *optarg;
int q;
int do_validation = 0;
err_status_t status;
srtp_err_status_t status;
if (argc == 1)
usage(argv[0]);
/* initialize kernel - we need to do this before anything else */
status = crypto_kernel_init();
status = srtp_crypto_kernel_init();
if (status) {
printf("error: crypto_kernel init failed\n");
printf("error: srtp_crypto_kernel init failed\n");
exit(1);
}
printf("crypto_kernel successfully initalized\n");
printf("srtp_crypto_kernel successfully initalized\n");
/* process input arguments */
while (1) {
q = getopt(argc, argv, "vd:");
q = getopt_s(argc, argv, "vd:");
if (q == -1)
break;
switch (q) {
@@ -81,9 +84,9 @@ main (int argc, char *argv[]) {
do_validation = 1;
break;
case 'd':
status = crypto_kernel_set_debug_module(optarg, 1);
status = srtp_crypto_kernel_set_debug_module(optarg_s, 1);
if (status) {
printf("error: set debug module (%s) failed\n", optarg);
printf("error: set debug module (%s) failed\n", optarg_s);
exit(1);
}
break;
@@ -93,21 +96,21 @@ main (int argc, char *argv[]) {
}
if (do_validation) {
printf("checking crypto_kernel status...\n");
status = crypto_kernel_status();
printf("checking srtp_crypto_kernel status...\n");
status = srtp_crypto_kernel_status();
if (status) {
printf("failed\n");
exit(1);
}
printf("crypto_kernel passed self-tests\n");
printf("srtp_crypto_kernel passed self-tests\n");
}
status = crypto_kernel_shutdown();
status = srtp_crypto_kernel_shutdown();
if (status) {
printf("error: crypto_kernel shutdown failed\n");
printf("error: srtp_crypto_kernel shutdown failed\n");
exit(1);
}
printf("crypto_kernel successfully shut down\n");
printf("srtp_crypto_kernel successfully shut down\n");
return 0;
}
@@ -117,10 +120,10 @@ main (int argc, char *argv[]) {
* of the crypto_kernel
*/
err_status_t
srtp_err_status_t
crypto_kernel_cipher_test(void) {
/* not implemented yet! */
return err_status_ok;
return srtp_err_status_ok;
}