From: Mark Andrews Date: Tue, 20 Oct 2009 03:06:32 +0000 (+0000) Subject: 2718. [bug] The space calculations in opensslrsa_todns() were X-Git-Tag: v9.5.2-P1~1^5~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceff44dae250e37a0f72b164b298f9d1ef28c170;p=thirdparty%2Fbind9.git 2718. [bug] The space calculations in opensslrsa_todns() were incorrect. [RT #20394] --- diff --git a/CHANGES b/CHANGES index ddd40fab78a..c79121bca96 100644 --- 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. diff --git a/lib/dns/opensslrsa_link.c b/lib/dns/opensslrsa_link.c index a3544a98006..63bacb09632 100644 --- a/lib/dns/opensslrsa_link.c +++ b/lib/dns/opensslrsa_link.c @@ -17,7 +17,7 @@ /* * Principal Author: Brian Wellington - * $Id: opensslrsa_link.c,v 1.16.128.3 2009/01/19 00:01:10 marka Exp $ + * $Id: opensslrsa_link.c,v 1.16.128.4 2009/10/20 03:06:32 marka Exp $ */ #ifdef OPENSSL @@ -372,19 +372,20 @@ opensslrsa_todns(const dst_key_t *key, isc_buffer_t *data) { if (r.length < 1) return (ISC_R_NOSPACE); isc_buffer_putuint8(data, (isc_uint8_t) e_bytes); + isc_region_consume(&r, 1); } else { if (r.length < 3) return (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); 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);