Changeset 9775069d0bd28eb34916f5721722ba5447612023
- Timestamp:
- 10/03/07 20:25:39
(2 years ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1173554739 +0000
- git-parent:
[bfd8795c23735f60369cf72cf1571fd332546184]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1173554739 +0000
- Message:
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
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r10ee356 |
r9775069 |
|
| 52 | 52 | "\x12\x34\x56\x78\x90" "\x12\x34\x56\x78\x90" "\x12\x34\x56\x78"; |
|---|
| 53 | 53 | |
|---|
| 54 | | srtp_session_t *s = srtp_create ("AES_CM_128_HMAC_SHA1_80", 0, 0, 0); |
|---|
| | 54 | srtp_session_t *s = srtp_create ("AES_CM_128_HMAC_SHA1_80", 0, 0); |
|---|
| 55 | 55 | if (s == NULL) |
|---|
| 56 | 56 | return 1; |
|---|
| re5c071a |
r9775069 |
|
| 50 | 50 | gcry_cipher_hd_t cipher; |
|---|
| 51 | 51 | gcry_md_hd_t mac; |
|---|
| | 52 | uint64_t window; |
|---|
| 52 | 53 | uint32_t salt[4]; |
|---|
| 53 | 54 | } srtp_proto_t; |
|---|
| … | … | |
| 162 | 163 | * @param name cipher-suite name |
|---|
| 163 | 164 | * @param kdr key derivation rate |
|---|
| 164 | | * @param winsize anti-replay windows size (between 64 and 32767 inclusive) |
|---|
| 165 | | * 0 disable replay attack protection (OK for send only) |
|---|
| 166 | 165 | * @param flags OR'ed optional flags. |
|---|
| 167 | 166 | * |
|---|
| … | … | |
| 169 | 168 | */ |
|---|
| 170 | 169 | srtp_session_t * |
|---|
| 171 | | srtp_create (const char *name, unsigned flags, unsigned kdr, uint16_t winsize) |
|---|
| | 170 | srtp_create (const char *name, unsigned flags, unsigned kdr) |
|---|
| 172 | 171 | { |
|---|
| 173 | 172 | assert (name != NULL); |
|---|
| … | … | |
| 175 | 174 | if (kdr != 0) |
|---|
| 176 | 175 | return NULL; // FIXME: KDR not implemented yet |
|---|
| 177 | | if (winsize != 0) |
|---|
| 178 | | return NULL; // FIXME: replay protection not implemented yet |
|---|
| 179 | 176 | |
|---|
| 180 | 177 | uint8_t tag_len; |
|---|
| … | … | |
| 190 | 187 | return NULL; |
|---|
| 191 | 188 | |
|---|
| 192 | | if ((flags & ~SRTP_FLAGS_MASK) || (winsize > 32767) || init_libgcrypt ()) |
|---|
| | 189 | if ((flags & ~SRTP_FLAGS_MASK) || init_libgcrypt ()) |
|---|
| 193 | 190 | return NULL; |
|---|
| 194 | 191 | |
|---|
| … | … | |
| 658 | 655 | return EACCES; |
|---|
| 659 | 656 | |
|---|
| 660 | | len -= 4; /* Remove SRTCP index befor decryption */ |
|---|
| | 657 | len -= 4; /* Remove SRTCP index before decryption */ |
|---|
| 661 | 658 | *lenp = len; |
|---|
| 662 | 659 | |
|---|
| re5c071a |
r9775069 |
|
| 37 | 37 | # endif |
|---|
| 38 | 38 | |
|---|
| 39 | | srtp_session_t *srtp_create (const char *name, unsigned flags, unsigned kdr, |
|---|
| 40 | | uint16_t winsize); |
|---|
| | 39 | srtp_session_t *srtp_create (const char *name, unsigned flags, unsigned kdr); |
|---|
| 41 | 40 | void srtp_destroy (srtp_session_t *s); |
|---|
| 42 | 41 | int srtp_setkey (srtp_session_t *s, const void *key, size_t keylen, |
|---|