Skip to content

Commit 99b02bf

Browse files
committed
*) mod_md: update to version 2.6.6
- Fix a small memory leak when using OpenSSL's BIGNUMs. [Theo Buehler] - Fix reuse of curl easy handles by resetting them. [Michael Kaufmann] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1929883 13f79535-47bb-0310-9956-ffa450edef68
1 parent 3122c0a commit 99b02bf

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

changes-entries/md_v2.6.6.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*) mod_md: update to version 2.6.6
2+
- Fix a small memory leak when using OpenSSL's BIGNUMs. [Theo Buehler]
3+
- Fix reuse of curl easy handles by resetting them. [Michael Kaufmann]

modules/md/md_crypt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ const char *md_cert_get_serial_number(const md_cert_t *cert, apr_pool_t *p)
12441244
serial = BN_bn2hex(bn);
12451245
s = apr_pstrdup(p, serial);
12461246
OPENSSL_free((void*)serial);
1247-
OPENSSL_free((void*)bn);
1247+
BN_free(bn);
12481248
}
12491249
return s;
12501250
}
@@ -2254,7 +2254,7 @@ apr_status_t md_cert_get_ari_cert_id(const char **pari_cert_id,
22542254
memset(&ser_buf, 0, sizeof(ser_buf));
22552255
bn = ASN1_INTEGER_to_BN(serial, NULL);
22562256
sder_len = BN_bn2bin(bn, sbuf);
2257-
OPENSSL_free((void*)bn);
2257+
BN_free(bn);
22582258
if (sder_len < 1)
22592259
return APR_EINVAL;
22602260
ser_buf.len = (apr_size_t)sder_len;

modules/md/md_curl.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,19 @@ static apr_status_t internals_setup(md_http_request_t *req)
255255
rv = APR_EGENERAL;
256256
goto leave;
257257
}
258-
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_cb);
259-
curl_easy_setopt(curl, CURLOPT_HEADERDATA, NULL);
260-
curl_easy_setopt(curl, CURLOPT_READFUNCTION, req_data_cb);
261-
curl_easy_setopt(curl, CURLOPT_READDATA, NULL);
262-
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, resp_data_cb);
263-
curl_easy_setopt(curl, CURLOPT_WRITEDATA, NULL);
264258
}
265259
else {
266260
md_log_perror(MD_LOG_MARK, MD_LOG_TRACE3, 0, req->pool, "reusing curl instance from http");
261+
curl_easy_reset(curl);
267262
}
268263

264+
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_cb);
265+
curl_easy_setopt(curl, CURLOPT_HEADERDATA, NULL);
266+
curl_easy_setopt(curl, CURLOPT_READFUNCTION, req_data_cb);
267+
curl_easy_setopt(curl, CURLOPT_READDATA, NULL);
268+
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, resp_data_cb);
269+
curl_easy_setopt(curl, CURLOPT_WRITEDATA, NULL);
270+
269271
internals = apr_pcalloc(req->pool, sizeof(*internals));
270272
internals->curl = curl;
271273

modules/md/md_ocsp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ static const char *certid_summary(const OCSP_CERTID *certid, apr_pool_t *p)
532532
bn = ASN1_INTEGER_to_BN(aserial, NULL);
533533
s = BN_bn2hex(bn);
534534
serial = apr_pstrdup(p, s);
535-
OPENSSL_free((void*)bn);
535+
BN_free(bn);
536536
OPENSSL_free((void*)s);
537537
}
538538
return apr_psprintf(p, "certid[der=%s, issuer=%s, key=%s, serial=%s]",

modules/md/md_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
* @macro
2828
* Version number of the md module as c string
2929
*/
30-
#define MOD_MD_VERSION "2.6.5-git"
30+
#define MOD_MD_VERSION "2.6.6"
3131

3232
/**
3333
* @macro
3434
* Numerical representation of the version number of the md module
3535
* release. This is a 24 bit number with 8 bits for major number, 8 bits
3636
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
3737
*/
38-
#define MOD_MD_VERSION_NUM 0x020605
38+
#define MOD_MD_VERSION_NUM 0x020606
3939

4040
#define MD_ACME_DEF_URL "https://acme-v02.api.letsencrypt.org/directory"
4141

0 commit comments

Comments
 (0)