]> 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 03:03:09 +0000 (03:03 +0000)
committerMark Andrews <marka@isc.org>
Tue, 20 Oct 2009 03:03:09 +0000 (03:03 +0000)
                        incorrect. [RT #20394]

CHANGES
lib/dns/opensslrsa_link.c

diff --git a/CHANGES b/CHANGES
index a76ade76b727fd542b0648aa7141c6d1654c626c..6af202cc55882b3325dbf209e8093c2be09f636e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2718.  [bug]           The space calculations in opensslrsa_todns() were
+                       incorrect. [RT #20394]
+
 2716.  [bug]           nslookup debug mode didn't return the ttl. [RT #20414]
 
 2715.  [bug]           Require OpenSSL support to be explicitly disabled.
index 53143cde54dd9411fda3fed320b097e11247ad09..f68b05cff77899bbf3477468e2aa87c02477b68e 100644 (file)
@@ -17,7 +17,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: opensslrsa_link.c,v 1.20.50.4 2009/08/18 08:05:02 marka Exp $
+ * $Id: opensslrsa_link.c,v 1.20.50.5 2009/10/20 03:03:09 marka Exp $
  */
 #ifdef OPENSSL
 #ifndef USE_EVP
@@ -552,19 +552,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);