[vlc-commits] update: use gcrypt enums, they are mapped to the spec already
Rafaël Carré
git at videolan.org
Sat May 10 12:34:19 CEST 2014
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sat May 10 12:26:41 2014 +0200| [01f224b81fd9c3916739b0de40c6c7c95963933e] | committer: Rafaël Carré
update: use gcrypt enums, they are mapped to the spec already
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=01f224b81fd9c3916739b0de40c6c7c95963933e
---
src/misc/update.h | 13 -------------
src/misc/update_crypto.c | 6 +++---
2 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/src/misc/update.h b/src/misc/update.h
index 61925e2..a586bc6 100644
--- a/src/misc/update.h
+++ b/src/misc/update.h
@@ -40,18 +40,6 @@
#include <vlc_update.h>
#include <vlc_atomic.h>
-enum /* Public key algorithms */
-{
- /* we will only use DSA public keys */
- PUBLIC_KEY_ALGO_DSA = 0x11
-};
-
-enum /* Digest algorithms */
-{
- /* and DSA use SHA-1 digest */
- DIGEST_ALGO_SHA1 = 0x02
-};
-
enum /* Packet types */
{
SIGNATURE_PACKET = 0x02,
@@ -237,4 +225,3 @@ hash_sha1_from_file(
*/
uint8_t *
hash_sha1_from_public_key( public_key_t *p_pkey );
-
diff --git a/src/misc/update_crypto.c b/src/misc/update_crypto.c
index 1cdfccd..ae0d1be 100644
--- a/src/misc/update_crypto.c
+++ b/src/misc/update_crypto.c
@@ -105,7 +105,7 @@ static int parse_public_key_packet( public_key_packet_t *p_key,
memcpy( p_key->timestamp, p_buf, 4 ); p_buf += 4; i_read += 4;
p_key->algo = *p_buf++; i_read++;
- if( p_key->algo != PUBLIC_KEY_ALGO_DSA )
+ if( p_key->algo != GCRY_PK_DSA )
return VLC_EGENERIC;
READ_MPI(p_key->p, 1024);
@@ -282,10 +282,10 @@ static int parse_signature_packet( signature_packet_t *p_sig,
if( i_read == 0 ) /* signature packet parsing has failed */
goto error;
- if( p_sig->public_key_algo != PUBLIC_KEY_ALGO_DSA )
+ if( p_sig->public_key_algo != GCRY_PK_DSA )
goto error;
- if( p_sig->digest_algo != DIGEST_ALGO_SHA1 )
+ if( p_sig->digest_algo != GCRY_MD_SHA1 )
goto error;
switch( p_sig->type )
More information about the vlc-commits
mailing list