From: RĂ©mi Denis-Courmont Date: Sat, 10 Mar 2007 19:25:39 +0000 (+0000) Subject: Remove window size parameter. X-Git-Tag: 0.9.0-test0~8167 X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=9775069d0bd28eb34916f5721722ba5447612023 Remove window size parameter. It has to be at least 64, and it is too complicated to implement a bigger value, so it's not going to be configurable --- diff --git a/libs/srtp/recv.c b/libs/srtp/recv.c index 5fc32446ce..e58a3d2526 100644 --- a/libs/srtp/recv.c +++ b/libs/srtp/recv.c @@ -51,7 +51,7 @@ int main (void) static const uint8_t salt[14] = "\x12\x34\x56\x78\x90" "\x12\x34\x56\x78\x90" "\x12\x34\x56\x78"; - srtp_session_t *s = srtp_create ("AES_CM_128_HMAC_SHA1_80", 0, 0, 0); + srtp_session_t *s = srtp_create ("AES_CM_128_HMAC_SHA1_80", 0, 0); if (s == NULL) return 1; if (srtp_setkey (s, key, 16, salt, 14)) diff --git a/libs/srtp/srtp.c b/libs/srtp/srtp.c index 877e324275..8fd96b828f 100644 --- a/libs/srtp/srtp.c +++ b/libs/srtp/srtp.c @@ -49,6 +49,7 @@ typedef struct srtp_proto_t { gcry_cipher_hd_t cipher; gcry_md_hd_t mac; + uint64_t window; uint32_t salt[4]; } srtp_proto_t; @@ -161,21 +162,17 @@ static int proto_create (srtp_proto_t *p, int gcipher, int gmd) * * @param name cipher-suite name * @param kdr key derivation rate - * @param winsize anti-replay windows size (between 64 and 32767 inclusive) - * 0 disable replay attack protection (OK for send only) * @param flags OR'ed optional flags. * * @return NULL in case of error */ srtp_session_t * -srtp_create (const char *name, unsigned flags, unsigned kdr, uint16_t winsize) +srtp_create (const char *name, unsigned flags, unsigned kdr) { assert (name != NULL); if (kdr != 0) return NULL; // FIXME: KDR not implemented yet - if (winsize != 0) - return NULL; // FIXME: replay protection not implemented yet uint8_t tag_len; int cipher = GCRY_CIPHER_AES, md = GCRY_MD_SHA1; @@ -189,7 +186,7 @@ srtp_create (const char *name, unsigned flags, unsigned kdr, uint16_t winsize) // F8_128_HMAC_SHA1_80 is not implemented return NULL; - if ((flags & ~SRTP_FLAGS_MASK) || (winsize > 32767) || init_libgcrypt ()) + if ((flags & ~SRTP_FLAGS_MASK) || init_libgcrypt ()) return NULL; srtp_session_t *s = malloc (sizeof (*s)); @@ -657,7 +654,7 @@ srtcp_recv (srtp_session_t *s, uint8_t *buf, size_t *lenp) if (memcmp (buf + len, tag, s->tag_len)) return EACCES; - len -= 4; /* Remove SRTCP index befor decryption */ + len -= 4; /* Remove SRTCP index before decryption */ *lenp = len; return srtp_crypt (s, buf, len); diff --git a/libs/srtp/srtp.h b/libs/srtp/srtp.h index 8f69405652..9ead86431f 100644 --- a/libs/srtp/srtp.h +++ b/libs/srtp/srtp.h @@ -36,8 +36,7 @@ enum extern "C" { # endif -srtp_session_t *srtp_create (const char *name, unsigned flags, unsigned kdr, - uint16_t winsize); +srtp_session_t *srtp_create (const char *name, unsigned flags, unsigned kdr); void srtp_destroy (srtp_session_t *s); int srtp_setkey (srtp_session_t *s, const void *key, size_t keylen, const void *salt, size_t saltlen);