mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
agent: Don't use gcry_mpi_scan when not needed.
* agent/pksign.c (do_encode_md): Use %b to build sexp. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
705954149b
commit
0691234951
@ -62,19 +62,9 @@ do_encode_md (const byte * md, size_t mdlen, int algo, gcry_sexp_t * r_hash,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gcry_mpi_t mpi;
|
rc = gcry_sexp_build (&hash, NULL,
|
||||||
|
"(data (flags raw) (value %b))",
|
||||||
rc = gcry_mpi_scan (&mpi, GCRYMPI_FMT_USG, md, mdlen, NULL);
|
(int)mdlen, md);
|
||||||
if (!rc)
|
|
||||||
{
|
|
||||||
rc = gcry_sexp_build (&hash, NULL,
|
|
||||||
"(data (flags raw) (value %m))",
|
|
||||||
mpi);
|
|
||||||
gcry_mpi_release (mpi);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
hash = NULL;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*r_hash = hash;
|
*r_hash = hash;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user