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

Side by Side Diff: srtp/test/rtpw.c

Issue 1098043003: Update libsrtp to 1.5.2 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libsrtp@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « srtp/test/rtp.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * rtpw.c 2 * rtpw.c
3 * 3 *
4 * rtp word sender/receiver 4 * rtp word sender/receiver
5 * 5 *
6 * David A. McGrew 6 * David A. McGrew
7 * Cisco Systems, Inc. 7 * Cisco Systems, Inc.
8 * 8 *
9 * This app is a simple RTP application intended only for testing 9 * This app is a simple RTP application intended only for testing
10 * libsrtp. It reads one word at a time from /usr/dict/words (or 10 * libsrtp. It reads one word at a time from /usr/dict/words (or
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include <stdio.h> /* for printf, fprintf */ 61 #include <stdio.h> /* for printf, fprintf */
62 #include <stdlib.h> /* for atoi() */ 62 #include <stdlib.h> /* for atoi() */
63 #include <errno.h> 63 #include <errno.h>
64 #include <signal.h> /* for signal() */ 64 #include <signal.h> /* for signal() */
65 65
66 #include <string.h> /* for strncpy() */ 66 #include <string.h> /* for strncpy() */
67 #include <time.h> /* for usleep() */ 67 #include <time.h> /* for usleep() */
68 68
69 #ifdef HAVE_UNISTD_H 69 #ifdef HAVE_UNISTD_H
70 #include <unistd.h> /* for close() */ 70 #include <unistd.h> /* for close() */
71 #elif defined(_MSC_VER)
72 #include <io.h> /* for _close() */
73 #define close _close
71 #endif 74 #endif
72 #ifdef HAVE_SYS_SOCKET_H 75 #ifdef HAVE_SYS_SOCKET_H
73 # include <sys/socket.h> 76 # include <sys/socket.h>
74 #endif 77 #endif
75 #ifdef HAVE_NETINET_IN_H 78 #ifdef HAVE_NETINET_IN_H
76 # include <netinet/in.h> 79 # include <netinet/in.h>
77 #elif defined HAVE_WINSOCK2_H 80 #elif defined HAVE_WINSOCK2_H
78 # include <winsock2.h> 81 # include <winsock2.h>
79 # include <ws2tcpip.h> 82 # include <ws2tcpip.h>
80 # define RTPW_USE_WINSOCK2 1 83 # define RTPW_USE_WINSOCK2 1
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 len = hex_string_to_octet_string(key, input_key, expected_len); 466 len = hex_string_to_octet_string(key, input_key, expected_len);
464 } 467 }
465 /* check that hex string is the right length */ 468 /* check that hex string is the right length */
466 if (len < expected_len) { 469 if (len < expected_len) {
467 fprintf(stderr, 470 fprintf(stderr,
468 "error: too few digits in key/salt " 471 "error: too few digits in key/salt "
469 "(should be %d digits, found %d)\n", 472 "(should be %d digits, found %d)\n",
470 expected_len, len); 473 expected_len, len);
471 exit(1); 474 exit(1);
472 } 475 }
473 if (strlen(input_key) > policy.rtp.cipher_key_len*2) { 476 if ((int) strlen(input_key) > policy.rtp.cipher_key_len*2) {
474 fprintf(stderr, 477 fprintf(stderr,
475 "error: too many digits in key/salt " 478 "error: too many digits in key/salt "
476 "(should be %d hexadecimal digits, found %u)\n", 479 "(should be %d hexadecimal digits, found %u)\n",
477 policy.rtp.cipher_key_len*2, (unsigned)strlen(input_key)); 480 policy.rtp.cipher_key_len*2, (unsigned)strlen(input_key));
478 exit(1); 481 exit(1);
479 } 482 }
480 483
481 printf("set master key/salt to %s/", octet_string_hex_string(key, 16)); 484 printf("set master key/salt to %s/", octet_string_hex_string(key, 16));
482 printf("%s\n", octet_string_hex_string(key+16, 14)); 485 printf("%s\n", octet_string_hex_string(key+16, 14));
483 486
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 } 703 }
701 #else 704 #else
702 if (signal(SIGTERM, handle_signal) == SIG_ERR) { 705 if (signal(SIGTERM, handle_signal) == SIG_ERR) {
703 fprintf(stderr, "%s: error setting up signal handler", name); 706 fprintf(stderr, "%s: error setting up signal handler", name);
704 perror(""); 707 perror("");
705 return -1; 708 return -1;
706 } 709 }
707 #endif 710 #endif
708 return 0; 711 return 0;
709 } 712 }
OLDNEW
« no previous file with comments | « srtp/test/rtp.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698