Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
32bfb8dc
Commit
32bfb8dc
authored
Oct 01, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: constify
parent
6841a105
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
src/misc/update_crypto.c
src/misc/update_crypto.c
+10
-10
No files found.
src/misc/update_crypto.c
View file @
32bfb8dc
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
#define packet_header_len( c ) ( ( c & 0x03 ) + 1 )
/* number of bytes in a packet header */
#define packet_header_len( c ) ( ( c & 0x03 ) + 1 )
/* number of bytes in a packet header */
static
inline
int
scalar_number
(
uint8_t
*
p
,
int
header_len
)
static
inline
int
scalar_number
(
const
uint8_t
*
p
,
int
header_len
)
{
{
assert
(
header_len
==
1
||
header_len
==
2
||
header_len
==
4
);
assert
(
header_len
==
1
||
header_len
==
2
||
header_len
==
4
);
...
@@ -88,8 +88,8 @@ static inline int scalar_number( uint8_t *p, int header_len )
...
@@ -88,8 +88,8 @@ static inline int scalar_number( uint8_t *p, int header_len )
* fill a public_key_packet_t structure from public key packet data
* fill a public_key_packet_t structure from public key packet data
* verify that it is a version 4 public key packet, using DSA
* verify that it is a version 4 public key packet, using DSA
*/
*/
static
int
parse_public_key_packet
(
public_key_packet_t
*
p_key
,
uint8_t
*
p_buf
,
static
int
parse_public_key_packet
(
public_key_packet_t
*
p_key
,
size_t
i_packet_len
)
const
uint8_t
*
p_buf
,
size_t
i_packet_len
)
{
{
if
(
i_packet_len
>
418
||
i_packet_len
<
6
)
if
(
i_packet_len
>
418
||
i_packet_len
<
6
)
...
@@ -124,7 +124,7 @@ error:
...
@@ -124,7 +124,7 @@ error:
static
size_t
parse_signature_v3_packet
(
signature_packet_t
*
p_sig
,
static
size_t
parse_signature_v3_packet
(
signature_packet_t
*
p_sig
,
uint8_t
*
p_buf
,
size_t
i_sig_len
)
const
uint8_t
*
p_buf
,
size_t
i_sig_len
)
{
{
size_t
i_read
=
1
;
/* we already read the version byte */
size_t
i_read
=
1
;
/* we already read the version byte */
...
@@ -161,7 +161,7 @@ static size_t parse_signature_v3_packet( signature_packet_t *p_sig,
...
@@ -161,7 +161,7 @@ static size_t parse_signature_v3_packet( signature_packet_t *p_sig,
* verify that it was used with a DSA public key, using SHA-1 digest
* verify that it was used with a DSA public key, using SHA-1 digest
*/
*/
static
size_t
parse_signature_v4_packet
(
signature_packet_t
*
p_sig
,
static
size_t
parse_signature_v4_packet
(
signature_packet_t
*
p_sig
,
uint8_t
*
p_buf
,
size_t
i_sig_len
)
const
uint8_t
*
p_buf
,
size_t
i_sig_len
)
{
{
size_t
i_read
=
1
;
/* we already read the version byte */
size_t
i_read
=
1
;
/* we already read the version byte */
...
@@ -257,7 +257,7 @@ static size_t parse_signature_v4_packet( signature_packet_t *p_sig,
...
@@ -257,7 +257,7 @@ static size_t parse_signature_v4_packet( signature_packet_t *p_sig,
static
int
parse_signature_packet
(
signature_packet_t
*
p_sig
,
static
int
parse_signature_packet
(
signature_packet_t
*
p_sig
,
uint8_t
*
p_buf
,
size_t
i_packet_len
)
const
uint8_t
*
p_buf
,
size_t
i_packet_len
)
{
{
if
(
!
i_packet_len
)
/* 1st sanity check, we need at least the version */
if
(
!
i_packet_len
)
/* 1st sanity check, we need at least the version */
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
...
@@ -354,10 +354,10 @@ static long crc_octets( uint8_t *octets, size_t len )
...
@@ -354,10 +354,10 @@ static long crc_octets( uint8_t *octets, size_t len )
* Transform an armored document in binary format
* Transform an armored document in binary format
* Used on public keys and signatures
* Used on public keys and signatures
*/
*/
static
int
pgp_unarmor
(
char
*
p_ibuf
,
size_t
i_ibuf_len
,
static
int
pgp_unarmor
(
c
onst
c
har
*
p_ibuf
,
size_t
i_ibuf_len
,
uint8_t
*
p_obuf
,
size_t
i_obuf_len
)
uint8_t
*
p_obuf
,
size_t
i_obuf_len
)
{
{
char
*
p_ipos
=
p_ibuf
;
c
onst
c
har
*
p_ipos
=
p_ibuf
;
uint8_t
*
p_opos
=
p_obuf
;
uint8_t
*
p_opos
=
p_obuf
;
int
i_end
=
0
;
int
i_end
=
0
;
int
i_header_skipped
=
0
;
int
i_header_skipped
=
0
;
...
@@ -485,8 +485,8 @@ problem:
...
@@ -485,8 +485,8 @@ problem:
int
parse_public_key
(
const
uint8_t
*
p_key_data
,
size_t
i_key_len
,
int
parse_public_key
(
const
uint8_t
*
p_key_data
,
size_t
i_key_len
,
public_key_t
*
p_key
,
const
uint8_t
*
p_sig_issuer
)
public_key_t
*
p_key
,
const
uint8_t
*
p_sig_issuer
)
{
{
uint8_t
*
pos
=
(
uint8_t
*
)
p_key_data
;
const
uint8_t
*
pos
=
p_key_data
;
uint8_t
*
max_pos
=
pos
+
i_key_len
;
const
uint8_t
*
max_pos
=
pos
+
i_key_len
;
int
i_status
=
0
;
int
i_status
=
0
;
#define PUBLIC_KEY_FOUND 0x01
#define PUBLIC_KEY_FOUND 0x01
...
...
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