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 16 matching lines...) Expand all Loading... |
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 | 30 |
31 #include <stdint.h> | 31 #include <stdint.h> |
32 | 32 |
33 #ifdef HAVE_SRTP | 33 #ifdef HAVE_SRTP |
34 #include "third_party/libsrtp/crypto/include/auth.h" | 34 #include "third_party/libsrtp/crypto/include/auth.h" |
35 #endif // HAVE_SRTP | 35 #endif // HAVE_SRTP |
36 | 36 |
37 #if defined(HAVE_SRTP) && defined(ENABLE_EXTERNAL_AUTH) | 37 #if defined(HAVE_SRTP) |
38 | 38 |
39 #define EXTERNAL_HMAC_SHA1 SRTP_HMAC_SHA1 + 1 | 39 #define EXTERNAL_HMAC_SHA1 SRTP_HMAC_SHA1 + 1 |
40 #define HMAC_KEY_LENGTH 20 | 40 #define HMAC_KEY_LENGTH 20 |
41 | 41 |
42 // The HMAC context structure used to store authentication keys. | 42 // The HMAC context structure used to store authentication keys. |
43 // The pointer to the key will be allocated in the external_hmac_init function. | 43 // The pointer to the key will be allocated in the external_hmac_init function. |
44 // This pointer is owned by srtp_t in a template context. | 44 // This pointer is owned by srtp_t in a template context. |
45 typedef struct { | 45 typedef struct { |
46 uint8_t key[HMAC_KEY_LENGTH]; | 46 uint8_t key[HMAC_KEY_LENGTH]; |
47 int key_length; | 47 int key_length; |
(...skipping 16 matching lines...) Expand all Loading... |
64 int msg_octets); | 64 int msg_octets); |
65 | 65 |
66 srtp_err_status_t external_hmac_compute(ExternalHmacContext* state, | 66 srtp_err_status_t external_hmac_compute(ExternalHmacContext* state, |
67 const void* message, | 67 const void* message, |
68 int msg_octets, | 68 int msg_octets, |
69 int tag_len, | 69 int tag_len, |
70 uint8_t* result); | 70 uint8_t* result); |
71 | 71 |
72 srtp_err_status_t external_crypto_init(); | 72 srtp_err_status_t external_crypto_init(); |
73 | 73 |
74 #endif // defined(HAVE_SRTP) && defined(ENABLE_EXTERNAL_AUTH) | 74 #endif // defined(HAVE_SRTP) |
75 #endif // WEBRTC_PC_EXTERNALHMAC_H_ | 75 #endif // WEBRTC_PC_EXTERNALHMAC_H_ |
OLD | NEW |