Changeset 0da10eb in mod_gnutls for src/gnutls_sni.c
- Timestamp:
- Nov 21, 2018, 2:38:58 PM (4 years ago)
- Branches:
- asyncio, debian/master, main, master, proxy-ticket
- Children:
- 2ead314
- Parents:
- 0020874
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_sni.c
r0020874 r0da10eb 32 32 #define SERVER_NAME_HDR_SIZE (sizeof(uint16_t) + sizeof(uint8_t)) 33 33 34 /** 35 * Read a 16 bit unsigned int in network byte order from the data, 36 * and return the value in host byte order. 37 */ 34 38 static inline uint16_t read_uint16(const unsigned char *data) 35 39 { … … 43 47 44 48 /** 45 * APR port of GnuTLS' _gnutls_dnsname_is_valid() (from lib/str.h) 49 * Check if the string contains only alphanumeric characters, `-`, and 50 * `.`. APR port of GnuTLS' _gnutls_dnsname_is_valid() (from 51 * lib/str.h). 52 * 53 * @param str the string to check 54 * @param size length of the input string (must not include any 55 * terminating null byte) 56 * 57 * @return `1` if the string is a valid DNS name, `0` otherwise 46 58 */ 47 59 static inline int is_valid_dnsname(const unsigned char *str, unsigned int size) … … 56 68 57 69 /** 58 * Callback for gnutls_ext_raw_parse(), called for each 59 * extension. Check if the extension is a Server Name Indication, 60 * parse if so. The SNI data structure is defined in [RFC 6066 61 * Sec. 3](https://tools.ietf.org/html/rfc6066#section-3) 70 * Callback for gnutls_ext_raw_parse(), checks if the extension is a 71 * Server Name Indication, and tries to parse it if so. In case of 72 * success the requested hostname is stored in the mod_gnutls session 73 * context. 74 * 75 * See [RFC 6066 Sec. 3](https://tools.ietf.org/html/rfc6066#section-3) 76 * for the definition of the SNI data structure. The function 77 * signature is defined by the GnuTLS API. 78 * 79 * @param ctx must be the `gnutls_session_t` for the current 80 * connection 81 * @param tls_id TLS extension ID 82 * @param data the extension data 83 * @param size length of the extension data (bytes) 84 * 85 * @return `GNUTLS_E_SUCCESS` or a GnuTLS error code 62 86 */ 63 87 int mgs_sni_ext_hook(void *ctx, unsigned tls_id, … … 136 160 ctxt->sni_name = name; 137 161 } 138 return 0;162 return GNUTLS_E_SUCCESS; 139 163 } 140 164
Note: See TracChangeset
for help on using the changeset viewer.