Changeset bc539d5 in mod_gnutls
- Timestamp:
- Jan 27, 2016, 12:30:40 PM (6 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, jessie-backports, master, proxy-ticket, upstream
- Children:
- 29d3311
- Parents:
- 600cf16
- git-author:
- Thomas Klute <thomas2.klute@…> (01/27/16 02:26:34)
- git-committer:
- Thomas Klute <thomas2.klute@…> (01/27/16 12:30:40)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_hooks.c
r600cf16 rbc539d5 4 4 * Copyright 2011 Dash Shendy 5 5 * Copyright 2013-2014 Daniel Kahn Gillmor 6 * Copyright 2015 Thomas Klute6 * Copyright 2015-2016 Thomas Klute 7 7 * 8 8 * Licensed under the Apache License, Version 2.0 (the "License"); … … 1655 1655 #endif /* ENABLE_MSVA */ 1656 1656 1657 static int mgs_status_hook(request_rec *r, int flags __attribute__((unused))) 1657 1658 1659 /* 1660 * This hook writes the mod_gnutls status message for a mod_status 1661 * report. According to the comments in mod_status.h, the "flags" 1662 * parameter is a bitwise OR of the AP_STATUS_ flags. 1663 * 1664 * Note that this implementation gives flags explicitly requesting a 1665 * simple response priority, e.g. if AP_STATUS_SHORT is set, flags 1666 * requesting an HTML report will be ignored. As of Apache 2.4.10, the 1667 * following flags were defined in mod_status.h: 1668 * 1669 * AP_STATUS_SHORT (short, non-HTML report requested) 1670 * AP_STATUS_NOTABLE (HTML report without tables) 1671 * AP_STATUS_EXTENDED (detailed report) 1672 */ 1673 static int mgs_status_hook(request_rec *r, int flags) 1658 1674 { 1659 mgs_srvconf_rec *sc;1660 1661 1675 if (r == NULL) 1662 1676 return OK; 1663 1677 1664 sc = (mgs_srvconf_rec *) ap_get_module_config(r->server->module_config, &gnutls_module); 1678 mgs_srvconf_rec *sc = (mgs_srvconf_rec *) 1679 ap_get_module_config(r->server->module_config, &gnutls_module); 1665 1680 1666 1681 _gnutls_log(debug_log_fp, "%s: %d\n", __func__, __LINE__); 1667 1682 1668 ap_rputs("<hr>\n", r); 1669 ap_rputs("<h2>GnuTLS Information:</h2>\n<dl>\n", r); 1670 1671 ap_rprintf(r, "<dt>GnuTLS version:</dt><dd>%s</dd>\n", gnutls_check_version(NULL)); 1672 ap_rputs("<dt>Built against:</dt><dd>" GNUTLS_VERSION "</dd>\n", r); 1673 ap_rprintf(r, "<dt>using TLS:</dt><dd>%s</dd>\n", (sc->enabled == GNUTLS_ENABLED_FALSE ? "no" : "yes")); 1674 if (sc->enabled != GNUTLS_ENABLED_FALSE) { 1675 mgs_handle_t* ctxt; 1676 ctxt = ap_get_module_config(r->connection->conn_config, &gnutls_module); 1683 if (flags & AP_STATUS_SHORT) 1684 { 1685 ap_rprintf(r, "Using GnuTLS version: %s\n", gnutls_check_version(NULL)); 1686 ap_rputs("Built against GnuTLS version: " GNUTLS_VERSION "\n", r); 1687 } 1688 else 1689 { 1690 ap_rputs("<hr>\n", r); 1691 ap_rputs("<h2>GnuTLS Information:</h2>\n<dl>\n", r); 1692 1693 ap_rprintf(r, "<dt>Using GnuTLS version:</dt><dd>%s</dd>\n", 1694 gnutls_check_version(NULL)); 1695 ap_rputs("<dt>Built against GnuTLS version:</dt><dd>" 1696 GNUTLS_VERSION "</dd>\n", r); 1697 ap_rprintf(r, "<dt>Using TLS:</dt><dd>%s</dd>\n", 1698 (sc->enabled == GNUTLS_ENABLED_FALSE ? "no" : "yes")); 1699 } 1700 1701 if (sc->enabled != GNUTLS_ENABLED_FALSE) 1702 { 1703 mgs_handle_t* ctxt = 1704 ap_get_module_config(r->connection->conn_config, &gnutls_module); 1677 1705 if (ctxt && ctxt->session != NULL) 1678 1706 { 1679 char* z = NULL; 1680 z = gnutls_session_get_desc(ctxt->session); 1681 if (z) { 1682 ap_rprintf(r, "<dt>This TLS Session:</dt><dd>%s</dd>\n", z); 1683 gnutls_free(z); 1707 char* s_info = gnutls_session_get_desc(ctxt->session); 1708 if (s_info) 1709 { 1710 if (flags & AP_STATUS_SHORT) 1711 ap_rprintf(r, "Current TLS session: %s\n", s_info); 1712 else 1713 ap_rprintf(r, "<dt>Current TLS session:</dt><dd>%s</dd>\n", 1714 s_info); 1715 gnutls_free(s_info); 1684 1716 } 1685 1717 } 1686 1718 } 1687 1719 1688 ap_rputs("</dl>\n", r); 1720 if (!(flags & AP_STATUS_SHORT)) 1721 ap_rputs("</dl>\n", r); 1722 1689 1723 return OK; 1690 1724 } -
test/tests/16_view-status/output
r600cf16 rbc539d5 1 <dt> using TLS:</dt><dd>yes</dd>2 <dt> This TLS Session:</dt><dd>(TLS1.0)-(RSA)-(AES-128-CBC)-(SHA1)</dd>1 <dt>Using TLS:</dt><dd>yes</dd> 2 <dt>Current TLS session:</dt><dd>(TLS1.0)-(RSA)-(AES-128-CBC)-(SHA1)</dd> 3 3 </dl> 4 4 </body></html>
Note: See TracChangeset
for help on using the changeset viewer.