mod_proxy_fcgi: Fix a potential crash with response headers' size above
8K. [Teguh <chain rop.io>, Yann Ylavic, Jeff Trawick]
+ *) mod_ssl: Fix recognition of OCSP stapling responses that are encoded
+ improperly or too large. [Jeff Trawick]
+
*) mod_proxy_fcgi, mod_authnz_fcgi: stop reading the response and issue an
error when parsing or forwarding the response fails. [Yann Ylavic]
BOOL ok, apr_pool_t *pool)
{
SSLModConfigRec *mc = myModConfig(s);
- unsigned char resp_der[MAX_STAPLING_DER];
+ unsigned char resp_der[MAX_STAPLING_DER]; /* includes one-byte flag + response */
unsigned char *p;
int resp_derlen;
BOOL rv;
apr_time_t expiry;
- resp_derlen = i2d_OCSP_RESPONSE(rsp, NULL) + 1;
+ resp_derlen = i2d_OCSP_RESPONSE(rsp, NULL);
if (resp_derlen <= 0) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(01927)
return FALSE;
}
- if (resp_derlen > sizeof resp_der) {
+ if (resp_derlen + 1 > sizeof resp_der) { /* response + ok flag too big? */
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(01928)
"OCSP stapling response too big (%u bytes)", resp_derlen);
return FALSE;