diff options
author | NIIBE Yutaka <[email protected]> | 2020-05-04 10:00:38 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2020-05-04 10:00:38 +0000 |
commit | 70af2165ec2512b847251e1e3ff543c100e137ab (patch) | |
tree | 490f7bf4a6179e083f44ba228caded8cdeba0739 | |
parent | ecc-sos: Fix reading SEXP from agent. (diff) | |
download | gnupg-70af2165ec2512b847251e1e3ff543c100e137ab.tar.gz gnupg-70af2165ec2512b847251e1e3ff543c100e137ab.zip |
ecc-sos: Fix gpg_mpi_write for opaque bit string.
* g10/build-packet.c (gpg_mpi_write): Handle opaque bit string
when it's has exact number of bits.
Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r-- | g10/build-packet.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/build-packet.c b/g10/build-packet.c index 99ff69722..2e100f179 100644 --- a/g10/build-packet.c +++ b/g10/build-packet.c @@ -306,6 +306,7 @@ gpg_mpi_write (iobuf_t out, gcry_mpi_t a, unsigned int *r_nwritten) p = gcry_mpi_get_opaque (a, &nbits); if (p) { + nbits = ((nbits + 7)/8)*8; /* Strip leading zero bits. */ for (; nbits >= 8 && !*p; p++, nbits -= 8) ; |