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 3322 by michael, Tue Apr 15 16:11:11 2014 UTC vs.
ircd-hybrid/branches/8.2.x/src/s_bsd.c (file contents), Revision 4115 by michael, Tue Jul 1 16:49:54 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 41 | Line 44
44   #include "packet.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 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, ServerInfo.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      }

Diff Legend

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