| 2420 | } |
| 2421 | |
| 2422 | STACK_OF(X509_NAME) *ssl_init_FindCAList(server_rec *s, |
| 2423 | apr_pool_t *ptemp, |
| 2424 | const char *ca_file, |
| 2425 | const char *ca_path) |
| 2426 | { |
| 2427 | STACK_OF(X509_NAME) *ca_list = sk_X509_NAME_new_null();; |
| 2428 | |
| 2429 | /* |
| 2430 | * Process CA certificate bundle file |
| 2431 | */ |
| 2432 | if (ca_file) { |
| 2433 | SSL_add_file_cert_subjects_to_stack(ca_list, ca_file); |
| 2434 | /* |
| 2435 | * If ca_list is still empty after trying to load ca_file |
| 2436 | * then the file failed to load, and users should hear about that. |
| 2437 | */ |
| 2438 | if (sk_X509_NAME_num(ca_list) == 0) { |
| 2439 | ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(02210) |
| 2440 | "Failed to load SSLCACertificateFile: %s", ca_file); |
| 2441 | ssl_log_ssl_error(SSLLOG_MARK, APLOG_ERR, s); |
| 2442 | } |
| 2443 | } |
| 2444 | |
| 2445 | /* |
| 2446 | * Process CA certificate path files |
| 2447 | */ |
| 2448 | if (ca_path && |
| 2449 | ssl_init_ca_cert_path(s, ptemp, |
| 2450 | ca_path, ca_list, NULL) != APR_SUCCESS) { |
| 2451 | ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02211) |
| 2452 | "Failed to open Certificate Path `%s'", ca_path); |
| 2453 | sk_X509_NAME_pop_free(ca_list, X509_NAME_free); |
| 2454 | return NULL; |
| 2455 | } |
| 2456 | |
| 2457 | return ca_list; |
| 2458 | } |
| 2459 | |
| 2460 | void ssl_init_Child(apr_pool_t *p, server_rec *s) |
| 2461 | { |
no test coverage detected