OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 // can plug any desired authentication modules into libsrtp. | 24 // can plug any desired authentication modules into libsrtp. |
25 // libsrtp also provides a mechanism to select different auth functions for | 25 // libsrtp also provides a mechanism to select different auth functions for |
26 // individual streams. This can be done by setting the right value in | 26 // individual streams. This can be done by setting the right value in |
27 // the auth_type of srtp_policy_t. The application must first register auth | 27 // the auth_type of srtp_policy_t. The application must first register auth |
28 // functions and the corresponding authentication id using | 28 // functions and the corresponding authentication id using |
29 // crypto_kernel_replace_auth_type function. | 29 // crypto_kernel_replace_auth_type function. |
30 #if defined(HAVE_SRTP) && defined(ENABLE_EXTERNAL_AUTH) | 30 #if defined(HAVE_SRTP) && defined(ENABLE_EXTERNAL_AUTH) |
31 | 31 |
32 #include "webrtc/base/basictypes.h" | 32 #include "webrtc/base/basictypes.h" |
33 extern "C" { | 33 extern "C" { |
| 34 #ifdef SRTP_RELATIVE_PATH |
| 35 #include "auth.h" // NOLINT |
| 36 #else |
34 #include "third_party/libsrtp/srtp/crypto/include/auth.h" | 37 #include "third_party/libsrtp/srtp/crypto/include/auth.h" |
| 38 #endif // SRTP_RELATIVE_PATH |
35 } | 39 } |
36 | 40 |
37 #define EXTERNAL_HMAC_SHA1 HMAC_SHA1 + 1 | 41 #define EXTERNAL_HMAC_SHA1 HMAC_SHA1 + 1 |
38 #define HMAC_KEY_LENGTH 20 | 42 #define HMAC_KEY_LENGTH 20 |
39 | 43 |
40 // The HMAC context structure used to store authentication keys. | 44 // The HMAC context structure used to store authentication keys. |
41 // The pointer to the key will be allocated in the external_hmac_init function. | 45 // The pointer to the key will be allocated in the external_hmac_init function. |
42 // This pointer is owned by srtp_t in a template context. | 46 // This pointer is owned by srtp_t in a template context. |
43 typedef struct { | 47 typedef struct { |
44 uint8_t key[HMAC_KEY_LENGTH]; | 48 uint8_t key[HMAC_KEY_LENGTH]; |
(...skipping 17 matching lines...) Expand all Loading... |
62 err_status_t external_hmac_compute(ExternalHmacContext* state, | 66 err_status_t external_hmac_compute(ExternalHmacContext* state, |
63 const void* message, | 67 const void* message, |
64 int msg_octets, | 68 int msg_octets, |
65 int tag_len, | 69 int tag_len, |
66 uint8_t* result); | 70 uint8_t* result); |
67 | 71 |
68 err_status_t external_crypto_init(); | 72 err_status_t external_crypto_init(); |
69 | 73 |
70 #endif // defined(HAVE_SRTP) && defined(ENABLE_EXTERNAL_AUTH) | 74 #endif // defined(HAVE_SRTP) && defined(ENABLE_EXTERNAL_AUTH) |
71 #endif // TALK_SESSION_MEDIA_EXTERNAL_HMAC_H_ | 75 #endif // TALK_SESSION_MEDIA_EXTERNAL_HMAC_H_ |
OLD | NEW |