gcrypt: Use GCRYMPI_FMT_USG for gcry_sexp_nth_mpi().
authorAndre Noll <maan@systemlinux.org>
Mon, 4 Jul 2011 22:08:14 +0000 (00:08 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 6 Jul 2011 06:41:26 +0000 (08:41 +0200)
The manual says: If you use this function to parse results of
a public key function, you most likely want to use `GCRYMPI_FMT_USG'.

gcrypt.c

index 1312aaedc275206ba88ce4cd44cd89c01d2ba9ba..49e27f2d0c2002c03b532d145ed395cdaf6d5f47 100644 (file)
--- a/gcrypt.c
+++ b/gcrypt.c
@@ -837,7 +837,7 @@ int pub_encrypt(struct asymmetric_key *pub, unsigned char *inbuf,
        if (!out_a)
                goto out_release;
        /* convert sexp out_a -> out_mpi */
-       out_mpi = gcry_sexp_nth_mpi(out_a, 1, GCRYMPI_FMT_STD);
+       out_mpi = gcry_sexp_nth_mpi(out_a, 1, GCRYMPI_FMT_USG);
        if (!out_mpi) {
                ret = -E_SEXP_FIND;
                goto out_a_release;