| 28 |
|
#include <sys/types.h> |
| 29 |
|
#include <string.h> |
| 30 |
|
|
| 31 |
+ |
#include "config.h" |
| 32 |
|
#include "stdinc.h" |
| 33 |
|
#include "ircd.h" |
| 33 |
– |
#include "tools.h" |
| 34 |
|
#include "list.h" |
| 35 |
|
#include "s_conf.h" |
| 36 |
|
#include "event.h" |
| 37 |
|
#include "s_log.h" |
| 38 |
|
#include "client.h" /* for UMODE_ALL only */ |
| 39 |
– |
#include "pcre.h" |
| 39 |
|
#include "irc_string.h" |
| 40 |
|
#include "irc_getaddrinfo.h" |
| 41 |
|
#include "sprintf_irc.h" |
| 72 |
|
static char reasonbuf[REASONLEN + 1]; |
| 73 |
|
static char gecos_name[REALLEN * 4]; |
| 74 |
|
|
| 76 |
– |
extern dlink_list gdeny_items; /* XXX */ |
| 77 |
– |
|
| 75 |
|
static char *resv_reason = NULL; |
| 76 |
|
static char *listener_address = NULL; |
| 77 |
|
static int not_atom = 0; |
| 499 |
|
|
| 500 |
|
serverinfo_ssl_connection_method: T_SSL_CONNECTION_METHOD |
| 501 |
|
{ |
| 502 |
+ |
#ifdef HAVE_LIBCRYPTO |
| 503 |
|
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 504 |
|
ServerInfo.tls_version = 0; |
| 505 |
+ |
#endif |
| 506 |
|
} '=' method_types ';' |
| 507 |
|
{ |
| 508 |
+ |
#ifdef HAVE_LIBCRYPTO |
| 509 |
|
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 510 |
|
{ |
| 511 |
|
if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_SSLV3)) |
| 513 |
|
if (!(ServerInfo.tls_version & CONF_SERVER_INFO_TLS_VERSION_TLSV1)) |
| 514 |
|
SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1); |
| 515 |
|
} |
| 516 |
+ |
#endif |
| 517 |
|
}; |
| 518 |
|
|
| 519 |
|
method_types: method_types ',' method_type_item | method_type_item; |
| 520 |
|
method_type_item: T_SSLV3 |
| 521 |
|
{ |
| 522 |
+ |
#ifdef HAVE_LIBCRYPTO |
| 523 |
|
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 524 |
|
ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_SSLV3; |
| 525 |
+ |
#endif |
| 526 |
|
} | T_TLSV1 |
| 527 |
|
{ |
| 528 |
+ |
#ifdef HAVE_LIBCRYPTO |
| 529 |
|
if (conf_parser_ctx.boot && conf_parser_ctx.pass == 2) |
| 530 |
|
ServerInfo.tls_version |= CONF_SERVER_INFO_TLS_VERSION_TLSV1; |
| 531 |
+ |
#endif |
| 532 |
|
}; |
| 533 |
|
|
| 534 |
|
serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';' |
| 2922 |
|
{ |
| 2923 |
|
if (regex_ban) |
| 2924 |
|
{ |
| 2925 |
< |
pcre *exp_user = NULL; |
| 2926 |
< |
pcre *exp_host = NULL; |
| 2925 |
> |
#ifdef HAVE_LIBPCRE |
| 2926 |
> |
void *exp_user = NULL; |
| 2927 |
> |
void *exp_host = NULL; |
| 2928 |
|
const char *errptr = NULL; |
| 2929 |
|
|
| 2930 |
|
if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) || |
| 2946 |
|
DupString(yy_aconf->reason, reasonbuf); |
| 2947 |
|
else |
| 2948 |
|
DupString(yy_aconf->reason, "No reason"); |
| 2949 |
+ |
#else |
| 2950 |
+ |
ilog(L_ERROR, "Failed to add regular expression based K-Line: no PCRE support"); |
| 2951 |
+ |
break; |
| 2952 |
+ |
#endif |
| 2953 |
|
} |
| 2954 |
|
else |
| 2955 |
|
{ |
| 3091 |
|
{ |
| 3092 |
|
if (regex_ban) |
| 3093 |
|
{ |
| 3094 |
< |
pcre *exp_p = NULL; |
| 3094 |
> |
#ifdef HAVE_LIBPCRE |
| 3095 |
> |
void *exp_p = NULL; |
| 3096 |
|
const char *errptr = NULL; |
| 3097 |
|
|
| 3098 |
|
if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr))) |
| 3104 |
|
|
| 3105 |
|
yy_conf = make_conf_item(RXLINE_TYPE); |
| 3106 |
|
yy_conf->regexpname = exp_p; |
| 3107 |
+ |
#else |
| 3108 |
+ |
ilog(L_ERROR, "Failed to add regular expression based X-Line: no PCRE support"); |
| 3109 |
+ |
break; |
| 3110 |
+ |
#endif |
| 3111 |
|
} |
| 3112 |
|
else |
| 3113 |
|
yy_conf = make_conf_item(XLINE_TYPE); |