| 25 |
|
*/ |
| 26 |
|
|
| 27 |
|
#include "stdinc.h" |
| 28 |
+ |
#ifdef HAVE_LIBCRYPTO |
| 29 |
+ |
#include "rsa.h" |
| 30 |
+ |
#endif |
| 31 |
|
#include <netinet/in_systm.h> |
| 32 |
|
#include <netinet/ip.h> |
| 33 |
|
#include <netinet/tcp.h> |
| 42 |
|
#include "listener.h" |
| 43 |
|
#include "numeric.h" |
| 44 |
|
#include "packet.h" |
| 45 |
< |
#include "irc_res.h" |
| 45 |
> |
#include "res.h" |
| 46 |
|
#include "restart.h" |
| 47 |
< |
#include "s_auth.h" |
| 47 |
> |
#include "auth.h" |
| 48 |
|
#include "conf.h" |
| 49 |
|
#include "log.h" |
| 50 |
< |
#include "s_serv.h" |
| 50 |
> |
#include "server.h" |
| 51 |
|
#include "send.h" |
| 52 |
|
#include "memory.h" |
| 53 |
< |
#include "s_user.h" |
| 54 |
< |
#include "hook.h" |
| 53 |
> |
#include "user.h" |
| 54 |
> |
|
| 55 |
|
|
| 56 |
|
static const char *comm_err_str[] = { "Comm OK", "Error during bind()", |
| 57 |
|
"Error during DNS lookup", "connect timeout", "Error during connect()", |
| 176 |
|
* even if it is marked as blocked (COMM_SELECT_READ handler is called |
| 177 |
|
* before COMM_SELECT_WRITE). Let's try, nothing to lose.. -adx |
| 178 |
|
*/ |
| 179 |
+ |
DelFlag(client_p, FLAGS_BLOCKED); |
| 180 |
|
send_queued_write(client_p); |
| 181 |
|
} |
| 182 |
|
|
| 228 |
|
|
| 229 |
|
MyFree(client_p->localClient->passwd); |
| 230 |
|
detach_conf(client_p, CONF_CLIENT|CONF_OPER|CONF_SERVER); |
| 227 |
– |
client_p->from = NULL; /* ...this should catch them! >:) --msa */ |
| 231 |
|
} |
| 232 |
|
|
| 233 |
|
#ifdef HAVE_LIBCRYPTO |
| 272 |
|
if ((cert = SSL_get_peer_certificate(client_p->localClient->fd.ssl))) |
| 273 |
|
{ |
| 274 |
|
int res = SSL_get_verify_result(client_p->localClient->fd.ssl); |
| 275 |
< |
char buf[EVP_MAX_MD_SIZE * 2 + 1] = { '\0' }; |
| 276 |
< |
unsigned char md[EVP_MAX_MD_SIZE] = { '\0' }; |
| 275 |
> |
char buf[EVP_MAX_MD_SIZE * 2 + 1] = ""; |
| 276 |
> |
unsigned char md[EVP_MAX_MD_SIZE] = ""; |
| 277 |
|
|
| 278 |
|
if (res == X509_V_OK || res == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN || |
| 279 |
|
res == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE || |
| 280 |
|
res == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) |
| 281 |
|
{ |
| 282 |
< |
unsigned int i = 0, n = 0; |
| 282 |
> |
unsigned int n = 0; |
| 283 |
|
|
| 284 |
|
if (X509_digest(cert, EVP_sha256(), md, &n)) |
| 285 |
|
{ |
| 286 |
< |
for (; i < n; ++i) |
| 284 |
< |
snprintf(buf + 2 * i, 3, "%02X", md[i]); |
| 286 |
> |
binary_to_hex(md, buf, n); |
| 287 |
|
client_p->certfp = xstrdup(buf); |
| 288 |
|
} |
| 289 |
|
} |