View | Details | Raw Unified | Return to bug 39243
Collapse All | Expand All

(-)httpd-2.2.8.vanilla/modules/ssl/mod_ssl.c (+3 lines)
Lines 92-97 Link Here
92
    SSL_CMD_SRV(RandomSeed, TAKE23,
92
    SSL_CMD_SRV(RandomSeed, TAKE23,
93
                "SSL Pseudo Random Number Generator (PRNG) seeding source "
93
                "SSL Pseudo Random Number Generator (PRNG) seeding source "
94
                "(`startup|connect builtin|file:/path|exec:/path [bytes]')")
94
                "(`startup|connect builtin|file:/path|exec:/path [bytes]')")
95
    SSL_CMD_SRV(MaximumBufferSize, TAKE1,
96
               "Maximum size of input buffer, if unset or zero defaults "
97
               "to 128k")
95
98
96
    /*
99
    /*
97
     * Per-server context configuration directives
100
     * Per-server context configuration directives
(-)httpd-2.2.8.vanilla/modules/ssl/ssl_engine_config.c (+9 lines)
Lines 75-80 Link Here
75
#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
75
#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
76
    mc->szCryptoDevice         = NULL;
76
    mc->szCryptoDevice         = NULL;
77
#endif
77
#endif
78
    mc->nMaximumBufferSize     = 0;
78
79
79
    memset(mc->pTmpKeys, 0, sizeof(mc->pTmpKeys));
80
    memset(mc->pTmpKeys, 0, sizeof(mc->pTmpKeys));
80
81
Lines 1402-1407 Link Here
1402
    return NULL;
1403
    return NULL;
1403
}
1404
}
1404
1405
1406
const char *ssl_cmd_SSLMaximumBufferSize(cmd_parms *cmd,
1407
                                         void *dcfg,
1408
                                         const char *arg)
1409
{
1410
    SSLModConfigRec *sc = myModConfig(cmd->server);
1411
    sc->nMaximumBufferSize = (apr_off_t)strtol(arg, NULL, 10);
1412
    return NULL;
1413
}
1405
1414
1406
const char *ssl_cmd_SSLUserName(cmd_parms *cmd, void *dcfg,
1415
const char *ssl_cmd_SSLUserName(cmd_parms *cmd, void *dcfg,
1407
                                const char *arg)
1416
                                const char *arg)
(-)httpd-2.2.8.vanilla/modules/ssl/ssl_engine_io.c (-1 / +6 lines)
Lines 1464-1469 Link Here
1464
    apr_bucket_brigade *tempb;
1464
    apr_bucket_brigade *tempb;
1465
    apr_off_t total = 0; /* total length buffered */
1465
    apr_off_t total = 0; /* total length buffered */
1466
    int eos = 0; /* non-zero once EOS is seen */
1466
    int eos = 0; /* non-zero once EOS is seen */
1467
    SSLModConfigRec *mc = myModConfig(r->server);
1468
    apr_off_t max_io_buffer = SSL_MAX_IO_BUFFER;
1469
    if (mc->nMaximumBufferSize != 0)
1470
        max_io_buffer = mc->nMaximumBufferSize;
1471
    ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c, "Using %u as SSL_MAX_IO_BUFFER", max_io_buffer);
1467
1472
1468
    /* Create the context which will be passed to the input filter;
1473
    /* Create the context which will be passed to the input filter;
1469
     * containing a setaside pool and a brigade which constrain the
1474
     * containing a setaside pool and a brigade which constrain the
Lines 1531-1537 Link Here
1531
                      total, eos);
1536
                      total, eos);
1532
1537
1533
        /* Fail if this exceeds the maximum buffer size. */
1538
        /* Fail if this exceeds the maximum buffer size. */
1534
        if (total > SSL_MAX_IO_BUFFER) {
1539
        if (total > max_io_buffer) {
1535
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
1540
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
1536
                          "request body exceeds maximum size for SSL buffer");
1541
                          "request body exceeds maximum size for SSL buffer");
1537
            return HTTP_REQUEST_ENTITY_TOO_LARGE;
1542
            return HTTP_REQUEST_ENTITY_TOO_LARGE;
(-)httpd-2.2.8.vanilla/modules/ssl/ssl_private.h (+2 lines)
Lines 374-379 Link Here
374
    struct {
374
    struct {
375
        void *pV1, *pV2, *pV3, *pV4, *pV5, *pV6, *pV7, *pV8, *pV9, *pV10;
375
        void *pV1, *pV2, *pV3, *pV4, *pV5, *pV6, *pV7, *pV8, *pV9, *pV10;
376
    } rCtx;
376
    } rCtx;
377
    apr_off_t      nMaximumBufferSize;
377
} SSLModConfigRec;
378
} SSLModConfigRec;
378
379
379
/** public cert/private key */
380
/** public cert/private key */
Lines 525-530 Link Here
525
const char  *ssl_cmd_SSLProxyCARevocationFile(cmd_parms *, void *, const char *);
526
const char  *ssl_cmd_SSLProxyCARevocationFile(cmd_parms *, void *, const char *);
526
const char  *ssl_cmd_SSLProxyMachineCertificatePath(cmd_parms *, void *, const char *);
527
const char  *ssl_cmd_SSLProxyMachineCertificatePath(cmd_parms *, void *, const char *);
527
const char  *ssl_cmd_SSLProxyMachineCertificateFile(cmd_parms *, void *, const char *);
528
const char  *ssl_cmd_SSLProxyMachineCertificateFile(cmd_parms *, void *, const char *);
529
const char  *ssl_cmd_SSLMaximumBufferSize(cmd_parms *, void *, const char *);
528
530
529
/**  module initialization  */
531
/**  module initialization  */
530
int          ssl_init_Module(apr_pool_t *, apr_pool_t *, apr_pool_t *, server_rec *);
532
int          ssl_init_Module(apr_pool_t *, apr_pool_t *, apr_pool_t *, server_rec *);

Return to bug 39243