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 3347 by michael, Sun Apr 20 14:03:06 2014 UTC vs.
Revision 3375 by michael, Wed Apr 23 16:03:50 2014 UTC

# Line 269 | Line 269 | ssl_handshake(int fd, struct Client *cli
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        }

Diff Legend

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