| 40 |
|
#include "numeric.h" |
| 41 |
|
#include "packet.h" |
| 42 |
|
#include "conf.h" |
| 43 |
< |
#include "s_serv.h" |
| 43 |
> |
#include "server.h" |
| 44 |
|
#include "log.h" |
| 45 |
< |
#include "s_user.h" |
| 45 |
> |
#include "user.h" |
| 46 |
|
#include "send.h" |
| 47 |
|
#include "memory.h" |
| 48 |
|
#include "channel.h" |
| 874 |
|
if ((cert = SSL_get_peer_certificate(client_p->localClient->fd.ssl))) |
| 875 |
|
{ |
| 876 |
|
int res = SSL_get_verify_result(client_p->localClient->fd.ssl); |
| 877 |
< |
char buf[EVP_MAX_MD_SIZE * 2 + 1] = { '\0' }; |
| 878 |
< |
unsigned char md[EVP_MAX_MD_SIZE] = { '\0' }; |
| 877 |
> |
char buf[EVP_MAX_MD_SIZE * 2 + 1] = ""; |
| 878 |
> |
unsigned char md[EVP_MAX_MD_SIZE] = ""; |
| 879 |
|
|
| 880 |
|
if (res == X509_V_OK || res == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN || |
| 881 |
|
res == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE || |
| 882 |
|
res == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) |
| 883 |
|
{ |
| 884 |
< |
unsigned int i = 0, n = 0; |
| 884 |
> |
unsigned int n = 0; |
| 885 |
|
|
| 886 |
|
if (X509_digest(cert, EVP_sha256(), md, &n)) |
| 887 |
|
{ |
| 888 |
< |
for (; i < n; ++i) |
| 888 |
> |
for (unsigned int i = 0; i < n; ++i) |
| 889 |
|
snprintf(buf + 2 * i, 3, "%02X", md[i]); |
| 890 |
|
client_p->certfp = xstrdup(buf); |
| 891 |
|
} |