ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/src/s_bsd.c
(Generate patch)

Comparing:
ircd-hybrid/trunk/src/s_bsd.c (file contents), Revision 3312 by michael, Tue Apr 15 12:13:07 2014 UTC vs.
ircd-hybrid/branches/8.2.x/src/s_bsd.c (file contents), Revision 4341 by michael, Sat Aug 2 16:53:48 2014 UTC

# Line 25 | Line 25
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>
# Line 39 | Line 42
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"
53 > #include "user.h"
54  
55  
56   static const char *comm_err_str[] = { "Comm OK", "Error during bind()",
# Line 70 | Line 73 | check_can_use_v6(void)
73    int v6;
74  
75    if ((v6 = socket(AF_INET6, SOCK_STREAM, 0)) < 0)
76 <    ServerInfo.can_use_v6 = 0;
76 >    ConfigServerInfo.can_use_v6 = 0;
77    else
78    {
79 <    ServerInfo.can_use_v6 = 1;
79 >    ConfigServerInfo.can_use_v6 = 1;
80      close(v6);
81    }
82   #else
83 <  ServerInfo.can_use_v6 = 0;
83 >  ConfigServerInfo.can_use_v6 = 0;
84   #endif
85   }
86  
# Line 269 | Line 272 | ssl_handshake(int fd, struct Client *cli
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))
284 >      if (X509_digest(cert, ConfigServerInfo.message_digest_algorithm, 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      }
# Line 347 | Line 349 | add_connection(struct Listener *listener
349   #ifdef HAVE_LIBCRYPTO
350    if (listener->flags & LISTENER_SSL)
351    {
352 <    if ((client_p->localClient->fd.ssl = SSL_new(ServerInfo.server_ctx)) == NULL)
352 >    if ((client_p->localClient->fd.ssl = SSL_new(ConfigServerInfo.server_ctx)) == NULL)
353      {
354        ilog(LOG_TYPE_IRCD, "SSL_new() ERROR! -- %s",
355             ERR_error_string(ERR_get_error(), NULL));

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)