| 39 |
|
#include "listener.h" |
| 40 |
|
#include "numeric.h" |
| 41 |
|
#include "packet.h" |
| 42 |
< |
#include "irc_res.h" |
| 42 |
> |
#include "res.h" |
| 43 |
|
#include "restart.h" |
| 44 |
< |
#include "s_auth.h" |
| 44 |
> |
#include "auth.h" |
| 45 |
|
#include "conf.h" |
| 46 |
|
#include "log.h" |
| 47 |
< |
#include "s_serv.h" |
| 47 |
> |
#include "server.h" |
| 48 |
|
#include "send.h" |
| 49 |
|
#include "memory.h" |
| 50 |
< |
#include "s_user.h" |
| 50 |
> |
#include "user.h" |
| 51 |
|
|
| 52 |
|
|
| 53 |
|
static const char *comm_err_str[] = { "Comm OK", "Error during bind()", |
| 168 |
|
|
| 169 |
|
if (!IsDead(client_p)) |
| 170 |
|
{ |
| 171 |
< |
/* |
| 172 |
< |
* Flush pending write buffer, if any, but first clear the |
| 173 |
< |
* cork as it no longer matters, this connection is being |
| 174 |
< |
* closed now |
| 171 |
> |
/* attempt to flush any pending dbufs. Evil, but .. -- adrian */ |
| 172 |
> |
/* there is still a chance that we might send data to this socket |
| 173 |
> |
* even if it is marked as blocked (COMM_SELECT_READ handler is called |
| 174 |
> |
* before COMM_SELECT_WRITE). Let's try, nothing to lose.. -adx |
| 175 |
|
*/ |
| 176 |
< |
DelFlag(client_p, FLAGS_CORK); |
| 176 |
> |
DelFlag(client_p, FLAGS_BLOCKED); |
| 177 |
|
send_queued_write(client_p); |
| 178 |
|
} |
| 179 |
|
|
| 269 |
|
if ((cert = SSL_get_peer_certificate(client_p->localClient->fd.ssl))) |
| 270 |
|
{ |
| 271 |
|
int res = SSL_get_verify_result(client_p->localClient->fd.ssl); |
| 272 |
< |
char buf[EVP_MAX_MD_SIZE * 2 + 1] = { '\0' }; |
| 273 |
< |
unsigned char md[EVP_MAX_MD_SIZE] = { '\0' }; |
| 272 |
> |
char buf[EVP_MAX_MD_SIZE * 2 + 1] = ""; |
| 273 |
> |
unsigned char md[EVP_MAX_MD_SIZE] = ""; |
| 274 |
|
|
| 275 |
|
if (res == X509_V_OK || res == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN || |
| 276 |
|
res == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE || |
| 277 |
|
res == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) |
| 278 |
|
{ |
| 279 |
< |
unsigned int i = 0, n = 0; |
| 279 |
> |
unsigned int n = 0; |
| 280 |
|
|
| 281 |
|
if (X509_digest(cert, EVP_sha256(), md, &n)) |
| 282 |
|
{ |
| 283 |
< |
for (; i < n; ++i) |
| 283 |
> |
for (unsigned int i = 0; i < n; ++i) |
| 284 |
|
snprintf(buf + 2 * i, 3, "%02X", md[i]); |
| 285 |
|
client_p->certfp = xstrdup(buf); |
| 286 |
|
} |