Commit a3a04b83 authored by Rafaël Carré's avatar Rafaël Carré

update: support other hashing algorithms than SHA-1

parent 7d8714d9
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment