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))
{
gcry_cipher_hd_t cipher;
gcry_md_hd_t mac;
+ uint64_t window;
uint32_t salt[4];
} srtp_proto_t;
*
* @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;
// 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));
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);
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);