]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2718. [bug] The space calculations in opensslrsa_todns() were
authorMark Andrews <marka@isc.org>
Tue, 20 Oct 2009 02:59:19 +0000 (02:59 +0000)
committerMark Andrews <marka@isc.org>
Tue, 20 Oct 2009 02:59:19 +0000 (02:59 +0000)
                        incorrect. [RT #20394]

CHANGES
lib/dns/opensslrsa_link.c

diff --git a/CHANGES b/CHANGES
index 1de6cb1c2cbaf85e28c37b4495e2d043375a9bf1..118a99edc12f71318fbb95d8491e809fb0d890dc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2718.  [bug]           The space calculations in opensslrsa_todns() were
+                       incorrect. [RT #20394]
+
 2717.  [bug]           named failed to update the NSEC/NSEC3 record when
                        the last private type record was removed as a result
                        of completing the signing the zone with a key.
index e81b4b9ab4d4bf4d0a07d884111472a8be826c73..5e22ea5ce6d9f5924ae34dcf8a5096f3049c484d 100644 (file)
@@ -17,7 +17,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: opensslrsa_link.c,v 1.29 2009/10/05 17:30:49 fdupont Exp $
+ * $Id: opensslrsa_link.c,v 1.30 2009/10/20 02:59:19 marka Exp $
  */
 #ifdef OPENSSL
 #ifndef USE_EVP
@@ -549,19 +549,20 @@ opensslrsa_todns(const dst_key_t *key, isc_buffer_t *data) {
                if (r.length < 1)
                        DST_RET(ISC_R_NOSPACE);
                isc_buffer_putuint8(data, (isc_uint8_t) e_bytes);
+               isc_region_consume(&r, 1);
        } else {
                if (r.length < 3)
                        DST_RET(ISC_R_NOSPACE);
                isc_buffer_putuint8(data, 0);
                isc_buffer_putuint16(data, (isc_uint16_t) e_bytes);
+               isc_region_consume(&r, 3);
        }
 
        if (r.length < e_bytes + mod_bytes)
-               return (ISC_R_NOSPACE);
-       isc_buffer_availableregion(data, &r);
+               DST_RET(ISC_R_NOSPACE);
 
        BN_bn2bin(rsa->e, r.base);
-       r.base += e_bytes;
+       isc_region_consume(&r, e_bytes);
        BN_bn2bin(rsa->n, r.base);
 
        isc_buffer_add(data, e_bytes + mod_bytes);