diff options
| -rw-r--r-- | src/gnutls_hooks.c | 133 |
1 files changed, 88 insertions, 45 deletions
diff --git a/src/gnutls_hooks.c b/src/gnutls_hooks.c index e89c7f0..6619be5 100644 --- a/src/gnutls_hooks.c +++ b/src/gnutls_hooks.c | ||||
| @@ -209,8 +209,8 @@ const char static_dh_params[] = "-----BEGIN DH PARAMETERS-----\n" | ||||
| 209 | * | 209 | * | |
| 210 | * Returns negative on error. | 210 | * Returns negative on error. | |
| 211 | */ | 211 | */ | |
| 212 | static int read_crt_cn(server_rec *s, apr_pool_t * p, gnutls_x509_crt cert, | 212 | static int read_crt_cn(server_rec * s, apr_pool_t * p, | |
| 213 | char **cert_cn) | 213 | gnutls_x509_crt cert, char **cert_cn) | |
| 214 | { | 214 | { | |
| 215 | int rv = 0, i; | 215 | int rv = 0, i; | |
| 216 | size_t data_len; | 216 | size_t data_len; | |
| @@ -225,33 +225,37 @@ static int read_crt_cn(server_rec *s, apr_pool_t * p, gnutls_x509_crt cert, | ||||
| 225 | if (rv == GNUTLS_E_SHORT_MEMORY_BUFFER && data_len > 1) { | 225 | if (rv == GNUTLS_E_SHORT_MEMORY_BUFFER && data_len > 1) { | |
| 226 | *cert_cn = apr_palloc(p, data_len); | 226 | *cert_cn = apr_palloc(p, data_len); | |
| 227 | rv = gnutls_x509_crt_get_dn_by_oid(cert, | 227 | rv = gnutls_x509_crt_get_dn_by_oid(cert, | |
| 228 | GNUTLS_OID_X520_COMMON_NAME, 0, 0, *cert_cn, &data_len); | 228 | GNUTLS_OID_X520_COMMON_NAME, 0, | |
| 229 | 0, *cert_cn, &data_len); | |||
| 229 | } else { /* No CN return subject alternative name */ | 230 | } else { /* No CN return subject alternative name */ | |
| 230 | ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, | 231 | ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, | |
| 231 | "No common name found in certificate for '%s:%d'. Looking for subject alternative name.", | 232 | "No common name found in certificate for '%s:%d'. Looking for subject alternative name.", | |
| 232 | s->server_hostname, s->port); | 233 | s->server_hostname, s->port); | |
| 233 | rv = 0; | 234 | rv = 0; | |
| 234 | /* read subject alternative name */ | 235 | /* read subject alternative name */ | |
| 235 | for (i = 0; !(rv < 0); i++) { | 236 | for (i = 0; !(rv < 0); i++) { | |
| 237 | data_len = 0; | |||
| 236 | rv = gnutls_x509_crt_get_subject_alt_name(cert, i, | 238 | rv = gnutls_x509_crt_get_subject_alt_name(cert, i, | |
| 237 | NULL, &data_len, NULL); | 239 | NULL, &data_len, | |
| 238 | 240 | NULL); | ||
| 239 | if (rv == GNUTLS_E_SHORT_MEMORY_BUFFER && data_len > 1) { | 241 | ||
| 240 | /* FIXME: not very efficient. What if we have several alt names | 242 | if (rv == GNUTLS_E_SHORT_MEMORY_BUFFER && data_len > 1) { | |
| 241 | * before DNSName? | 243 | /* FIXME: not very efficient. What if we have several alt names | |
| 242 | */ | 244 | * before DNSName? | |
| 243 | *cert_cn = apr_palloc(p, data_len+1); | 245 | */ | |
| 244 | 246 | *cert_cn = apr_palloc(p, data_len + 1); | ||
| 245 | rv = gnutls_x509_crt_get_subject_alt_name(cert, i, | 247 | Christopher Powell | 2002-04-21 |
| * | Fixed buglet with preserve file (needed semicolon) and updated README.1.15 | 2002-04-08 | ||
| * | *** empty log message *** | 2002-04-08 | ||
| * | Added - but did not activate - routines to handle proxy environment variables. | 2002-04-08 | ||
| * | This is a "pre" snapshot of 1.15. Numerous changes emphasizing how SQL | 2002-04-02 | ||
| * | *** empty log message ***1.14 | 2002-02-24 | ||
| * | Minor but significant updates to the instructions for apxs users. | 2002-02-24 | ||
| * | Ported to mysql_real_connect, made a change for the mass-virtual-hosting1.13 | 2002-01-15 | ||
| * | Fixed another typo in make_combined_log; improved DSO instructions | 2002-01-02 | ||
| * | Added a mysql_close mechanism to the child exit process to fix MySQL | 2001-12-07 | ||
| * | Fixed a bug where make_combined_log.pl's data[] types were off by one1.121.11 | 2001-12-04 | ||
| * | 'make distro' now copies textfiles to html directory for online perusal. | 2001-12-03 | ||
| * | Big changes including reworked cookie code, new directives, SSL logging, | 2001-12-03 | ||
| * | A lot of code cleanup and tweaking, plus cookie logging:1.10 | 2001-11-30 | ||
| * | Initial revision1.09 | 2001-11-28 | ||
