]> git.sesse.net Git - vlc/commitdiff
Remove window size parameter.
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 10 Mar 2007 19:25:39 +0000 (19:25 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 10 Mar 2007 19:25:39 +0000 (19:25 +0000)
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

libs/srtp/recv.c
libs/srtp/srtp.c
libs/srtp/srtp.h

index 5fc32446ce6527a14bf76281278c35d204a8bdf8..e58a3d25264f5d52f52879412e7293ffa7959f81 100644 (file)
@@ -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))
index 877e324275d002d0bb6bfbbf7711f90279c8e5d6..8fd96b828fa7db6734298b662cafda47fe909c32 100644 (file)
@@ -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);
index 8f694056523ff415fb0f46bb694a6ad52bc37bb9..9ead86431fb062a3d0b5092eb1b2a567f0c24c02 100644 (file)
@@ -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);