| Index: testing/libfuzzer/fuzzers/libsrtp_fuzzer.cc
|
| diff --git a/testing/libfuzzer/fuzzers/libsrtp_fuzzer.cc b/testing/libfuzzer/fuzzers/libsrtp_fuzzer.cc
|
| index 2d79e06f0baf39bffc9226ee7c2f827df3d5829a..963f7be8358f7bcac1c66b561b21297b9e422198 100644
|
| --- a/testing/libfuzzer/fuzzers/libsrtp_fuzzer.cc
|
| +++ b/testing/libfuzzer/fuzzers/libsrtp_fuzzer.cc
|
| @@ -3,16 +3,15 @@
|
| // found in the LICENSE file.
|
|
|
| #include <assert.h>
|
| -#include <netinet/in.h>
|
| #include <stddef.h>
|
| #include <stdint.h>
|
|
|
| #include <algorithm>
|
| #include <vector>
|
|
|
| -#include "third_party/libsrtp/include/rtp.h"
|
| -#include "third_party/libsrtp/include/rtp_priv.h"
|
| -#include "third_party/libsrtp/include/srtp.h"
|
| +#include "third_party/libsrtp/srtp/include/rtp.h"
|
| +#include "third_party/libsrtp/srtp/include/rtp_priv.h"
|
| +#include "third_party/libsrtp/srtp/include/srtp.h"
|
|
|
| // TODO(katrielc) Also test the authenticated path, which is what
|
| // WebRTC uses. This is nontrivial because you need to bypass the MAC
|
| @@ -36,21 +35,21 @@
|
| switch (crypto_policy) {
|
| case LibSrtpFuzzer::NUMBER_OF_POLICIES:
|
| case LibSrtpFuzzer::NONE:
|
| - srtp_crypto_policy_set_null_cipher_null_auth(&policy.rtp);
|
| - srtp_crypto_policy_set_null_cipher_null_auth(&policy.rtcp);
|
| + crypto_policy_set_null_cipher_null_auth(&policy.rtp);
|
| + crypto_policy_set_null_cipher_null_auth(&policy.rtcp);
|
| break;
|
| case LibSrtpFuzzer::LIKE_WEBRTC:
|
| - srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtp);
|
| - srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtcp);
|
| + crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtp);
|
| + crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy.rtcp);
|
| break;
|
| case LibSrtpFuzzer::LIKE_WEBRTC_WITHOUT_AUTH:
|
| - srtp_crypto_policy_set_aes_cm_128_null_auth(&policy.rtp);
|
| - srtp_crypto_policy_set_aes_cm_128_null_auth(&policy.rtcp);
|
| + crypto_policy_set_aes_cm_128_null_auth(&policy.rtp);
|
| + crypto_policy_set_aes_cm_128_null_auth(&policy.rtcp);
|
| break;
|
| case LibSrtpFuzzer::AES_GCM:
|
| // There was a security bug in the GCM mode in libsrtp 1.5.2.
|
| - srtp_crypto_policy_set_aes_gcm_128_8_auth(&policy.rtp);
|
| - srtp_crypto_policy_set_aes_gcm_128_8_auth(&policy.rtcp);
|
| + crypto_policy_set_aes_gcm_128_8_auth(&policy.rtp);
|
| + crypto_policy_set_aes_gcm_128_8_auth(&policy.rtcp);
|
| break;
|
| }
|
|
|
| @@ -75,11 +74,10 @@
|
| srtp_policy_t policy;
|
| unsigned char key[SRTP_MASTER_KEY_LEN] = {0};
|
|
|
| - static void srtp_crypto_policy_set_null_cipher_null_auth(
|
| - srtp_crypto_policy_t* p) {
|
| - p->cipher_type = SRTP_NULL_CIPHER;
|
| + static void crypto_policy_set_null_cipher_null_auth(crypto_policy_t* p) {
|
| + p->cipher_type = NULL_CIPHER;
|
| p->cipher_key_len = 0;
|
| - p->auth_type = SRTP_NULL_AUTH;
|
| + p->auth_type = NULL_AUTH;
|
| p->auth_key_len = 0;
|
| p->auth_tag_len = 0;
|
| p->sec_serv = sec_serv_none;
|
| @@ -112,8 +110,8 @@
|
| size -= SRTP_MASTER_KEY_LEN;
|
|
|
| srtp_t session;
|
| - srtp_err_status_t error = srtp_create(&session, &srtp_policy);
|
| - if (error != srtp_err_status_ok) {
|
| + err_status_t error = srtp_create(&session, &srtp_policy);
|
| + if (error != err_status_ok) {
|
| assert(false);
|
| return 0;
|
| }
|
|
|