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
cdd3630b
Commit
cdd3630b
authored
May 10, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: use the digest algo specified in the signature
We already check that it is SHA1
parent
01f224b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/misc/update_crypto.c
src/misc/update_crypto.c
+4
-4
No files found.
src/misc/update_crypto.c
View file @
cdd3630b
...
...
@@ -654,7 +654,7 @@ static uint8_t *hash_finish( gcry_md_hd_t hd, signature_packet_t *p_sig )
gcry_md_final
(
hd
);
uint8_t
*
p_tmp
=
(
uint8_t
*
)
gcry_md_read
(
hd
,
GCRY_MD_SHA1
)
;
uint8_t
*
p_tmp
=
(
uint8_t
*
)
gcry_md_read
(
hd
,
p_sig
->
digest_algo
)
;
uint8_t
*
p_hash
=
malloc
(
20
);
if
(
p_hash
)
memcpy
(
p_hash
,
p_tmp
,
20
);
...
...
@@ -670,7 +670,7 @@ uint8_t *hash_sha1_from_text( const char *psz_string,
signature_packet_t
*
p_sig
)
{
gcry_md_hd_t
hd
;
if
(
gcry_md_open
(
&
hd
,
GCRY_MD_SHA1
,
0
)
)
if
(
gcry_md_open
(
&
hd
,
p_sig
->
digest_algo
,
0
)
)
return
NULL
;
if
(
p_sig
->
type
==
TEXT_SIGNATURE
)
...
...
@@ -704,7 +704,7 @@ uint8_t *hash_sha1_from_text( const char *psz_string,
uint8_t
*
hash_sha1_from_file
(
const
char
*
psz_file
,
signature_packet_t
*
p_sig
)
{
gcry_md_hd_t
hd
;
if
(
gcry_md_open
(
&
hd
,
GCRY_MD_SHA1
,
0
)
)
if
(
gcry_md_open
(
&
hd
,
p_sig
->
digest_algo
,
0
)
)
return
NULL
;
if
(
hash_from_binary_file
(
psz_file
,
hd
)
<
0
)
...
...
@@ -733,7 +733,7 @@ uint8_t *hash_sha1_from_public_key( public_key_t *p_pkey )
gcry_error_t
error
=
0
;
gcry_md_hd_t
hd
;
error
=
gcry_md_open
(
&
hd
,
GCRY_MD_SHA1
,
0
);
error
=
gcry_md_open
(
&
hd
,
p_pkey
->
sig
.
digest_algo
,
0
);
if
(
error
)
return
NULL
;
...
...
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