| 158 |
|
assert(client_p->connection->fd); |
| 159 |
|
assert(client_p->connection->fd == F); |
| 160 |
|
|
| 161 |
< |
tls_handshake_status_t ret = tls_handshake(&F->ssl, TLS_ROLE_SERVER, NULL); |
| 161 |
> |
tls_handshake_status_t ret = tls_handshake(&F->tls, TLS_ROLE_SERVER, NULL); |
| 162 |
|
if (ret != TLS_HANDSHAKE_DONE) |
| 163 |
|
{ |
| 164 |
|
if ((event_base->time.sec_monotonic - client_p->connection->created_monotonic) > TLS_HANDSHAKE_TIMEOUT) |
| 183 |
|
|
| 184 |
|
comm_settimeout(F, 0, NULL, NULL); |
| 185 |
|
|
| 186 |
< |
if (tls_verify_cert(&F->ssl, ConfigServerInfo.message_digest_algorithm, &client_p->certfp) == false) |
| 186 |
> |
if (tls_verify_cert(&F->tls, ConfigServerInfo.message_digest_algorithm, &client_p->certfp) == false) |
| 187 |
|
ilog(LOG_TYPE_IRCD, "Client %s!%s@%s gave bad TLS client certificate", |
| 188 |
|
client_p->name, client_p->username, client_p->host); |
| 189 |
|
|
| 202 |
|
{ |
| 203 |
|
struct Client *client_p = client_make(NULL); |
| 204 |
|
|
| 205 |
< |
client_p->connection->fd = fd_open(fd, true, (listener->flags & LISTENER_SSL) ? |
| 206 |
< |
"Incoming SSL connection" : "Incoming connection"); |
| 205 |
> |
client_p->connection->fd = fd_open(fd, true, (listener->flags & LISTENER_TLS) ? |
| 206 |
> |
"Incoming TLS connection" : "Incoming connection"); |
| 207 |
|
|
| 208 |
|
/* |
| 209 |
|
* copy address to 'sockhost' as a string, copy it to host too |
| 226 |
|
client_p->connection->listener = listener; |
| 227 |
|
++listener->ref_count; |
| 228 |
|
|
| 229 |
< |
if (listener->flags & LISTENER_SSL) |
| 229 |
> |
if (listener->flags & LISTENER_TLS) |
| 230 |
|
{ |
| 231 |
< |
if (tls_new(&client_p->connection->fd->ssl, fd, TLS_ROLE_SERVER) == false) |
| 231 |
> |
if (tls_new(&client_p->connection->fd->tls, fd, TLS_ROLE_SERVER) == false) |
| 232 |
|
{ |
| 233 |
|
SetDead(client_p); |
| 234 |
|
exit_client(client_p, "TLS context initialization failed"); |
| 235 |
|
return; |
| 236 |
|
} |
| 237 |
|
|
| 238 |
< |
AddFlag(client_p, FLAGS_SSL); |
| 238 |
> |
AddFlag(client_p, FLAGS_TLS); |
| 239 |
|
ssl_handshake(client_p->connection->fd, client_p); |
| 240 |
|
} |
| 241 |
|
else |