mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
agent: Clean up do_encode_md.
* agent/pksign.c (do_encode_md): Directly use sexp_build. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
074ab108e7
commit
4c0b12f817
@ -61,20 +61,10 @@ do_encode_md (const byte * md, size_t mdlen, int algo, gcry_sexp_t * r_hash,
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gcry_mpi_t mpi;
|
||||
|
||||
rc = gcry_mpi_scan (&mpi, GCRYMPI_FMT_USG, md, mdlen, NULL);
|
||||
if (!rc)
|
||||
{
|
||||
rc = gcry_sexp_build (&hash, NULL,
|
||||
"(data (flags raw) (value %m))",
|
||||
mpi);
|
||||
gcry_mpi_release (mpi);
|
||||
}
|
||||
else
|
||||
hash = NULL;
|
||||
|
||||
"(data (flags raw) (value %b))",
|
||||
(int)mdlen, md);
|
||||
}
|
||||
|
||||
*r_hash = hash;
|
||||
|
Loading…
x
Reference in New Issue
Block a user