[vlc-commits] update: support other hashing algorithms than SHA-1

Rafaël Carré git at videolan.org
Sun May 11 13:13:41 CEST 2014


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sun May 11 13:08:40 2014 +0200| [a3a04b83df39a96f1382c2cf222c774e2f483674] | committer: Rafaël Carré

update: support other hashing algorithms than SHA-1

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a3a04b83df39a96f1382c2cf222c774e2f483674
---

 src/misc/update_crypto.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/misc/update_crypto.c b/src/misc/update_crypto.c
index 6c576fd..3555f4f 100644
--- a/src/misc/update_crypto.c
+++ b/src/misc/update_crypto.c
@@ -285,9 +285,6 @@ static int parse_signature_packet( signature_packet_t *p_sig,
     if( p_sig->public_key_algo != GCRY_PK_DSA )
         goto error;
 
-    if( p_sig->digest_algo != GCRY_MD_SHA1 )
-        goto error;
-
     switch( p_sig->type )
     {
         case BINARY_SIGNATURE:
@@ -454,6 +451,10 @@ int verify_signature( signature_packet_t *sign, public_key_packet_t *p_key,
         goto problem;
 
     int i_hash_len = gcry_md_get_algo_dlen (sign->digest_algo);
+    if (sign->public_key_algo == GCRY_PK_DSA) {
+        if (i_hash_len > 20)
+            i_hash_len = 20;
+    }
     if( gcry_mpi_scan( &hash, GCRYMPI_FMT_USG, p_hash, i_hash_len, NULL ) ||
         gcry_sexp_build( &hash_sexp, &erroff, hash_sexp_s, hash ) )
         goto problem;



More information about the vlc-commits mailing list