ASN1_BIT_STRING_set_bit() didn't clear previously set bits
authorRichard Levitte <levitte@openssl.org>
Sun, 3 Feb 2002 21:27:04 +0000 (21:27 +0000)
committerRichard Levitte <levitte@openssl.org>
Sun, 3 Feb 2002 21:27:04 +0000 (21:27 +0000)
CHANGES
crypto/asn1/a_bitstr.c

diff --git a/CHANGES b/CHANGES
index 713f01b742ffbd54016aaea417d3396479997620..2c6d772d149aab73fbc3958753eb09ea0a381ccd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,10 @@
 
  Changes between 0.9.6c and 0.9.6d  [XX xxx XXXX]
 
+  *) Have ASN1_BIT_STRING_set_bit() really clear a bit when the requested
+     value is 0.
+     [Richard Levitte]
+
   *) Add the configuration target linux-s390x.
      [Neale Ferguson <Neale.Ferguson@SoftwareAG-USA.com> via Richard Levitte]
 
index 7013a407ad68385d0f82c27ec6d4aed864f5d4ea..cdedb29e4f50e27f5448c7676f58060ecae450d7 100644 (file)
@@ -224,6 +224,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
        w=n/8;
        v=1<<(7-(n&0x07));
        iv= ~v;
+       if (!value) v=0;
 
        a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */