#include "strtree.h"
#include "log.h"
#include "mypcre.h"
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
#include "myssl.h"
#endif
#include "mymalloc.h"
static const char *register_success =
"Registration successful! You will receive your password by email.";
static const char *shutdown_message = "Going down - Bye";
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
static const char *ssl_shutdown_message =
"GAME: SSL connections must be dropped, sorry.";
#endif
static bool console_mode = 0;
static int console_input = -1, console_output = -1;
static int sock = 0;
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
static int sslsock = 0;
SSL *ssl_master_socket = NULL; /**< Master SSL socket for ssl port */
#endif
initializesock(console_input, console_output, "localhost", "127.0.0.1", 0);
sock = 0;
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
sslsock = 0;
#endif
} else {
sock = make_socket(port, SOCK_STREAM, NULL, NULL, MUSH_IP_ADDR);
if (sock >= maxd)
maxd = sock + 1;
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (sslport) {
sslsock = make_socket(sslport, SOCK_STREAM, NULL, NULL, SSL_IP_ADDR);
ssl_master_socket = ssl_setup_socket(sslsock);
FD_ZERO(&output_set);
if (sock && ndescriptors < avail_descriptors)
FD_SET(sock, &input_set);
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (sslsock)
FD_SET(sslsock, &input_set);
#endif
} else
setup_desc(sock, false);
}
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (sslsock && FD_ISSET(sslsock, &input_set)) {
if (!info_slave_halted) {
addr_len = sizeof(addr);
#else /* INFO_SLAVE */
if (sock && FD_ISSET(sock, &input_set))
setup_desc(sock, false);
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (sslsock && FD_ISSET(sslsock, &input_set))
setup_desc(sslsock, true);
#endif
im_delete(descs_by_fd, d->descriptor);
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (sslsock && d->ssl) {
ssl_close_connection(d->ssl);
d->ssl = NULL;
d->pinfo.atr = NULL;
d->pinfo.lock = 0;
d->pinfo.function = NULL;
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
d->ssl = NULL;
d->ssl_state = 0;
#endif
descriptor_list = d;
d->width = 78;
d->height = 24;
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (use_ssl && sslsock) {
d->ssl = ssl_listen(d->descriptor, &d->ssl_state);
if (d->ssl_state < 0) {
{
struct text_block **qp, *cur;
int cnt;
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
int input_ready = 0;
#endif
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
/* Insure that we're not in a state where we need an SSL_handshake() */
if (d->ssl && (ssl_need_handshake(d->ssl_state))) {
d->ssl_state = ssl_handshake(d->ssl);
}
} else {
#endif /* HAVE_WRITEV */
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (d->ssl) {
cnt = 0;
d->ssl_state =
if (ssl_want_write(d->ssl_state))
return 1; /* Need to retry */
} else
-#endif /* HAS_OPENSSL */
+#endif /* HAVE_SSL */
{
if (d->outdesc == console_output)
cnt = write(d->outdesc, cur->start, cur->nchars);
errno = 0;
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (d->ssl) {
/* Insure that we're not in a state where we need an SSL_handshake() */
if (ssl_need_handshake(d->ssl_state)) {
else
return 0;
}
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
}
#endif
for (d = descriptor_list; d; d = dnext) {
dnext = d->next;
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (!d->ssl) {
#endif
#ifdef HAVE_WRITEV
send(d->outdesc, (char *) "\r\n", 2, 0);
}
#endif
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
} else {
int offset;
offset = 0;
time_format_1(now - d->connected_at),
time_format_2(now - d->last_time), csite ? d->cmds : 0,
csite ? d->descriptor : 0,
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
d->ssl ? 'S' : ' ',
#else
' ',
time_format_1(now - d->connected_at),
time_format_2(now - d->last_time), csite ? d->cmds : 0,
csite ? d->descriptor : 0,
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
d->ssl ? 'S' : ' ',
#else
' ',
"#-1",
time_format_1(now - d->connected_at),
time_format_2(now - d->last_time), d->cmds, d->descriptor,
- #ifdef HAS_OPENSSL
+ #ifdef HAVE_SSL
d->ssl ? 'S' : ' ',
#else
' ',
T("Connecting..."), "#-1",
time_format_1(now - d->connected_at),
time_format_2(now - d->last_time), d->cmds, d->descriptor,
- #ifdef HAS_OPENSSL
+ #ifdef HAVE_SSL
d->ssl ? 'S' : ' ',
#else
' ',
/* Return the status of the ssl flag on the least idle descriptor we
* find that matches the player's dbref.
*/
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
DESC *match;
if (!sslsock) {
safe_boolean(0, buff, bp);
safe_str(" pueblo", buff, bp);
if (match->conn_flags & CONN_TELNET)
safe_str(" telnet", buff, bp);
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (sslsock && match->ssl)
safe_str(" ssl", buff, bp);
#endif
#endif /* WIN 32 */
}
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
/** Take down all SSL client connections and close the SSL server socket.
* Typically, this is in preparation for a shutdown/reboot.
*/
d->raw_input = NULL;
d->raw_input_at = NULL;
d->quota = options.starting_quota;
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
d->ssl = NULL;
d->ssl_state = 0;
#endif
strcpy(poll_msg, getstring_noalloc(f));
globals.first_start_time = getref(f);
globals.reboot_count = getref(f) + 1;
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
if (SSLPORT) {
sslsock = make_socket(SSLPORT, SOCK_STREAM, NULL, NULL, SSL_IP_ADDR);
ssl_master_socket = ssl_setup_socket(sslsock);
if (globals.paranoid_checkpt < 1)
globals.paranoid_checkpt = 1;
}
-#ifdef HAS_OPENSSL
+#ifdef HAVE_SSL
close_ssl_connections();
#endif
sql_shutdown();