Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
0eeb4286
Commit
0eeb4286
authored
Mar 10, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ahem. Fix crappy previous commit.
parent
5c09dbba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
libs/srtp/srtp.c
libs/srtp/srtp.c
+12
-12
No files found.
libs/srtp/srtp.c
View file @
0eeb4286
...
@@ -600,10 +600,14 @@ static int srtcp_crypt (srtp_session_t *s, uint8_t *buf, size_t len)
...
@@ -600,10 +600,14 @@ static int srtcp_crypt (srtp_session_t *s, uint8_t *buf, size_t len)
if
((
len
<
12
)
||
((
buf
[
0
]
>>
6
)
!=
2
))
if
((
len
<
12
)
||
((
buf
[
0
]
>>
6
)
!=
2
))
return
EINVAL
;
return
EINVAL
;
uint32_t
index
=
s
->
rtcp_index
++
;
/* Updates SRTCP index (safe here) */
if
(
index
==
0x7fffffff
)
uint32_t
index
;
s
->
rtcp_index
=
0
;
/* 31-bit wrap */
memcpy
(
&
index
,
buf
+
len
,
4
);
index
=
ntohl
(
index
);
if
(((
index
-
s
->
rtcp_index
)
&
0x7fffffff
)
<
0x40000000
)
s
->
rtcp_index
=
index
;
/* Update index */
/* Crypts SRTCP */
if
(
s
->
flags
&
SRTCP_UNENCRYPTED
)
if
(
s
->
flags
&
SRTCP_UNENCRYPTED
)
return
0
;
return
0
;
...
@@ -637,7 +641,10 @@ srtcp_send (srtp_session_t *s, uint8_t *buf, size_t *lenp, size_t bufsize)
...
@@ -637,7 +641,10 @@ srtcp_send (srtp_session_t *s, uint8_t *buf, size_t *lenp, size_t bufsize)
if
(
bufsize
<
(
len
+
4
+
s
->
tag_len
))
if
(
bufsize
<
(
len
+
4
+
s
->
tag_len
))
return
ENOSPC
;
return
ENOSPC
;
uint32_t
index
=
s
->
rtcp_index
;
uint32_t
index
=
++
s
->
rtcp_index
;
if
(
index
>>
31
)
s
->
rtcp_index
=
index
=
0
;
/* 31-bit wrap */
if
((
s
->
flags
&
SRTCP_UNENCRYPTED
)
==
0
)
if
((
s
->
flags
&
SRTCP_UNENCRYPTED
)
==
0
)
index
|=
0x80000000
;
/* Set Encrypted bit */
index
|=
0x80000000
;
/* Set Encrypted bit */
memcpy
(
buf
+
len
,
&
(
uint32_t
){
htonl
(
index
)
},
4
);
memcpy
(
buf
+
len
,
&
(
uint32_t
){
htonl
(
index
)
},
4
);
...
@@ -646,12 +653,11 @@ srtcp_send (srtp_session_t *s, uint8_t *buf, size_t *lenp, size_t bufsize)
...
@@ -646,12 +653,11 @@ srtcp_send (srtp_session_t *s, uint8_t *buf, size_t *lenp, size_t bufsize)
if
(
val
)
if
(
val
)
return
val
;
return
val
;
len
+=
4
;
/* Digest SRTCP index too */
len
+=
4
;
/* Digest
s
SRTCP index too */
const
uint8_t
*
tag
=
rtcp_digest
(
s
->
rtp
.
mac
,
buf
,
len
);
const
uint8_t
*
tag
=
rtcp_digest
(
s
->
rtp
.
mac
,
buf
,
len
);
memcpy
(
buf
+
len
,
tag
,
s
->
tag_len
);
memcpy
(
buf
+
len
,
tag
,
s
->
tag_len
);
*
lenp
=
len
+
s
->
tag_len
;
*
lenp
=
len
+
s
->
tag_len
;
s
->
rtcp_index
++
;
/* Update index */
return
0
;
return
0
;
}
}
...
@@ -683,12 +689,6 @@ srtcp_recv (srtp_session_t *s, uint8_t *buf, size_t *lenp)
...
@@ -683,12 +689,6 @@ srtcp_recv (srtp_session_t *s, uint8_t *buf, size_t *lenp)
return
EACCES
;
return
EACCES
;
len
-=
4
;
/* Remove SRTCP index before decryption */
len
-=
4
;
/* Remove SRTCP index before decryption */
uint32_t
index
;
memcpy
(
&
index
,
buf
+
len
,
4
);
index
=
ntohl
(
index
);
if
(((
index
-
s
->
rtcp_index
)
&
0xffffffff
)
<
0x80000000
)
s
->
rtcp_index
=
index
;
/* Update index */
*
lenp
=
len
;
*
lenp
=
len
;
return
srtp_crypt
(
s
,
buf
,
len
);
return
srtp_crypt
(
s
,
buf
,
len
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment