mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
ecc-sos: Remove zero-octet removal on write.
* g10/build-packet.c (gpg_mpi_write): Don't remove zero bits. * g10/packet.h (CALC_NBITS): Remove. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
70af2165ec
commit
e6c975280a
@ -304,14 +304,6 @@ gpg_mpi_write (iobuf_t out, gcry_mpi_t a, unsigned int *r_nwritten)
|
||||
|
||||
/* gcry_log_debugmpi ("a", a); */
|
||||
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)
|
||||
;
|
||||
CALC_NBITS (nbits, p);
|
||||
}
|
||||
/* gcry_log_debug (" [%u bit]\n", nbits); */
|
||||
/* gcry_log_debughex (" ", p, (nbits+7)/8); */
|
||||
lenhdr[0] = nbits >> 8;
|
||||
|
10
g10/packet.h
10
g10/packet.h
@ -63,16 +63,6 @@
|
||||
#define is_ELGAMAL(a) ((a)==PUBKEY_ALGO_ELGAMAL_E)
|
||||
#define is_DSA(a) ((a)==PUBKEY_ALGO_DSA)
|
||||
|
||||
#define CALC_NBITS(nbits,p) if (nbits >= 8 && !(*p & 0x80)) \
|
||||
if (--nbits >= 7 && !(*p & 0x40)) \
|
||||
if (--nbits >= 6 && !(*p & 0x20)) \
|
||||
if (--nbits >= 5 && !(*p & 0x10)) \
|
||||
if (--nbits >= 4 && !(*p & 0x08)) \
|
||||
if (--nbits >= 3 && !(*p & 0x04)) \
|
||||
if (--nbits >= 2 && !(*p & 0x02)) \
|
||||
if (--nbits >= 1 && !(*p & 0x01)) \
|
||||
--nbits
|
||||
|
||||
/* A pointer to the packet object. */
|
||||
typedef struct packet_struct PACKET;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user