Ticket #692: ssl_cipher_bits.patch

File ssl_cipher_bits.patch, 1.7 KB (added by Marcin Deranek, 12 years ago)
  • src/event/ngx_event_openssl.c

    old new  
    30303030
    30313031
    30323032ngx_int_t
     3033ngx_ssl_get_cipher_bits(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
     3034{
     3035    s->data = ngx_pnalloc(pool, NGX_INT_T_LEN);
     3036    if (s->data == NULL) {
     3037        return NGX_ERROR;
     3038    }
     3039    s->len = ngx_sprintf(s->data, "%ui", SSL_get_cipher_bits(c->ssl->connection, NULL)) - s->data;
     3040    return NGX_OK;
     3041}
     3042
     3043
     3044ngx_int_t
    30333045ngx_ssl_get_session_id(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
    30343046{
    30353047    u_char        *buf;
  • src/event/ngx_event_openssl.h

    old new  
    169169    ngx_str_t *s);
    170170ngx_int_t ngx_ssl_get_cipher_name(ngx_connection_t *c, ngx_pool_t *pool,
    171171    ngx_str_t *s);
     172ngx_int_t ngx_ssl_get_cipher_bits(ngx_connection_t *c, ngx_pool_t *pool,
     173    ngx_str_t *s);
    172174ngx_int_t ngx_ssl_get_session_id(ngx_connection_t *c, ngx_pool_t *pool,
    173175    ngx_str_t *s);
    174176ngx_int_t ngx_ssl_get_session_reused(ngx_connection_t *c, ngx_pool_t *pool,
  • src/http/modules/ngx_http_ssl_module.c

    old new  
    276276    { ngx_string("ssl_cipher"), NULL, ngx_http_ssl_static_variable,
    277277      (uintptr_t) ngx_ssl_get_cipher_name, NGX_HTTP_VAR_CHANGEABLE, 0 },
    278278
     279    { ngx_string("ssl_cipher_bits"), NULL, ngx_http_ssl_variable,
     280      (uintptr_t) ngx_ssl_get_cipher_bits, NGX_HTTP_VAR_CHANGEABLE, 0 },
     281
    279282    { ngx_string("ssl_session_id"), NULL, ngx_http_ssl_variable,
    280283      (uintptr_t) ngx_ssl_get_session_id, NGX_HTTP_VAR_CHANGEABLE, 0 },
    281284