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
28d547fc
Commit
28d547fc
authored
Mar 24, 2004
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* csa.c: Fixed an encryption bug with packets smaller than 8 bytes.
parent
b09db111
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
modules/mux/mpeg/csa.c
modules/mux/mpeg/csa.c
+15
-13
No files found.
modules/mux/mpeg/csa.c
View file @
28d547fc
...
...
@@ -2,7 +2,7 @@
* libcsa.c: CSA scrambler/descrambler
*****************************************************************************
* Copyright (C) 2004 Laurent Aimar
* $Id
: csa.c,v 1.1 2004/01/25 02:26:04 fenrir Exp
$
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -210,6 +210,12 @@ void csa_Encrypt( csa_t *c, uint8_t *pkt, int b_odd )
n
=
(
188
-
i_hdr
)
/
8
;
i_residue
=
(
188
-
i_hdr
)
%
8
;
if
(
n
==
0
)
{
pkt
[
3
]
&=
0x3f
;
return
;
}
/* */
for
(
i
=
0
;
i
<
8
;
i
++
)
{
...
...
@@ -227,22 +233,18 @@ void csa_Encrypt( csa_t *c, uint8_t *pkt, int b_odd )
/* init csa state */
csa_StreamCypher
(
c
,
1
,
ck
,
ib
[
1
],
stream
);
if
(
n
>
0
)
for
(
i
=
0
;
i
<
8
;
i
++
)
{
for
(
i
=
0
;
i
<
8
;
i
++
)
{
pkt
[
i_hdr
+
i
]
=
ib
[
1
][
i
];
}
for
(
i
=
2
;
i
<
n
+
1
;
i
++
)
pkt
[
i_hdr
+
i
]
=
ib
[
1
][
i
];
}
for
(
i
=
2
;
i
<
n
+
1
;
i
++
)
{
csa_StreamCypher
(
c
,
0
,
ck
,
NULL
,
stream
);
for
(
j
=
0
;
j
<
8
;
j
++
)
{
csa_StreamCypher
(
c
,
0
,
ck
,
NULL
,
stream
);
for
(
j
=
0
;
j
<
8
;
j
++
)
{
pkt
[
i_hdr
+
8
*
(
i
-
1
)
+
j
]
=
ib
[
i
][
j
]
^
stream
[
j
];
}
pkt
[
i_hdr
+
8
*
(
i
-
1
)
+
j
]
=
ib
[
i
][
j
]
^
stream
[
j
];
}
}
/* FIXME I have no idea if it's correct */
if
(
i_residue
>
0
)
{
csa_StreamCypher
(
c
,
0
,
ck
,
NULL
,
stream
);
...
...
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