Skip to content

Commit 3a252d8

Browse files
author
yngrtc
committed
Revert "add Aes128CmHmacSha1_32 support"
This reverts commit 4fbad4a.
1 parent 254bdd5 commit 3a252d8

File tree

4 files changed

+5
-16
lines changed

4 files changed

+5
-16
lines changed

srtp/src/cipher/cipher_aead_aes_gcm.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,7 @@ impl Cipher for CipherAeadAesGcm {
146146

147147
impl CipherAeadAesGcm {
148148
/// Create a new AEAD instance.
149-
pub(crate) fn new(
150-
profile: ProtectionProfile,
151-
master_key: &[u8],
152-
master_salt: &[u8],
153-
) -> Result<CipherAeadAesGcm> {
149+
pub(crate) fn new(profile: ProtectionProfile, master_key: &[u8], master_salt: &[u8]) -> Result<CipherAeadAesGcm> {
154150
let srtp_session_key = aes_cm_key_derivation(
155151
LABEL_SRTP_ENCRYPTION,
156152
master_key,

srtp/src/cipher/cipher_aes_cm_hmac_sha1/ctrcipher.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ impl Cipher for CipherAesCmHmacSha1 {
208208
let cipher_text = &encrypted[..encrypted_len - self.rtcp_auth_tag_len()];
209209

210210
// Generate the auth tag we expect to see from the ciphertext.
211-
let expected_tag =
212-
&self.inner.generate_srtcp_auth_tag(cipher_text)[..self.rtcp_auth_tag_len()];
211+
let expected_tag = &self.inner.generate_srtcp_auth_tag(cipher_text)[..self.rtcp_auth_tag_len()];
213212

214213
// See if the auth tag actually matches.
215214
// We use a constant time comparison to prevent timing attacks.

srtp/src/cipher/cipher_aes_cm_hmac_sha1/opensslcipher.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ use subtle::ConstantTimeEq;
55
use util::marshal::*;
66

77
use super::{Cipher, CipherInner};
8-
use crate::protection_profile::ProtectionProfile;
98
use crate::{
109
error::{Error, Result},
1110
key_derivation::*,
1211
};
12+
use crate::protection_profile::ProtectionProfile;
1313

1414
pub(crate) struct CipherAesCmHmacSha1 {
1515
inner: CipherInner,
@@ -167,8 +167,7 @@ impl Cipher for CipherAesCmHmacSha1 {
167167
fn encrypt_rtcp(&mut self, decrypted: &[u8], srtcp_index: usize, ssrc: u32) -> Result<Bytes> {
168168
let decrypted_len = decrypted.len();
169169

170-
let mut writer =
171-
Vec::with_capacity(decrypted_len + SRTCP_INDEX_SIZE + self.rtcp_auth_tag_len());
170+
let mut writer = Vec::with_capacity(decrypted_len + SRTCP_INDEX_SIZE + self.rtcp_auth_tag_len());
172171

173172
// Write the decrypted to the destination buffer.
174173
writer.extend_from_slice(&decrypted[..HEADER_LENGTH + SSRC_LENGTH]);
@@ -242,8 +241,7 @@ impl Cipher for CipherAesCmHmacSha1 {
242241
let cipher_text = &encrypted[..encrypted_len - self.rtcp_auth_tag_len()];
243242

244243
// Generate the auth tag we expect to see from the ciphertext.
245-
let expected_tag =
246-
&self.inner.generate_srtcp_auth_tag(cipher_text)[..self.rtcp_auth_tag_len()];
244+
let expected_tag = &self.inner.generate_srtcp_auth_tag(cipher_text)[..self.rtcp_auth_tag_len()];
247245

248246
// See if the auth tag actually matches.
249247
// We use a constant time comparison to prevent timing attacks.

webrtc/src/dtls_transport/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ pub(crate) fn default_srtp_protection_profiles() -> Vec<SrtpProtectionProfile> {
4646
SrtpProtectionProfile::Srtp_Aead_Aes_128_Gcm,
4747
SrtpProtectionProfile::Srtp_Aead_Aes_256_Gcm,
4848
SrtpProtectionProfile::Srtp_Aes128_Cm_Hmac_Sha1_80,
49-
SrtpProtectionProfile::Srtp_Aes128_Cm_Hmac_Sha1_32,
5049
]
5150
}
5251

@@ -422,9 +421,6 @@ impl RTCDtlsTransport {
422421
dtls::extension::extension_use_srtp::SrtpProtectionProfile::Srtp_Aes128_Cm_Hmac_Sha1_80 => {
423422
srtp::protection_profile::ProtectionProfile::Aes128CmHmacSha1_80
424423
}
425-
dtls::extension::extension_use_srtp::SrtpProtectionProfile::Srtp_Aes128_Cm_Hmac_Sha1_32 => {
426-
srtp::protection_profile::ProtectionProfile::Aes128CmHmacSha1_32
427-
}
428424
_ => {
429425
if let Err(err) = dtls_conn.close().await {
430426
log::error!("{}", err);

0 commit comments

Comments
 (0)