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

Comparing ircd-hybrid-7.2/src/s_serv.c (file contents):
Revision 42 by adx, Sun Oct 2 23:25:27 2005 UTC vs.
Revision 319 by michael, Sat Dec 24 15:06:49 2005 UTC

# Line 227 | Line 227 | collect_zipstats(void *unused)
227   struct EncCapability *
228   check_cipher(struct Client *client_p, struct AccessItem *aconf)
229   {
230 <  struct EncCapability *epref;
230 >  struct EncCapability *epref = NULL;
231  
232    /* Use connect{} specific info if available */
233    if (aconf->cipher_preference)
234      epref = aconf->cipher_preference;
235 <  else
235 >  else if (ConfigFileEntry.default_cipher_preference)
236      epref = ConfigFileEntry.default_cipher_preference;
237  
238 <  /* If the server supports the capability in hand, return the matching
238 >  /*
239 >   * If the server supports the capability in hand, return the matching
240     * conf struct.  Otherwise, return NULL (an error).
241     */
242 <  if (IsCapableEnc(client_p, epref->cap))
243 <    return(epref);
242 >  if (epref && IsCapableEnc(client_p, epref->cap))
243 >    return epref;
244  
245 <  return(NULL);
245 >  return NULL;
246   }
247   #endif /* HAVE_LIBCRYPTO */
248  
# Line 811 | Line 812 | send_capabilities(struct Client *client_
812    int tl;
813    dlink_node *ptr;
814   #ifdef HAVE_LIBCRYPTO
815 <  struct EncCapability *epref;
815 >  const struct EncCapability *epref = NULL;
816    char *capend;
817    int sent_cipher = 0;
818   #endif
# Line 838 | Line 839 | send_capabilities(struct Client *client_
839      /* use connect{} specific info if available */
840      if (aconf->cipher_preference)
841        epref = aconf->cipher_preference;
842 <    else
842 >    else if (ConfigFileEntry.default_cipher_preference)
843        epref = ConfigFileEntry.default_cipher_preference;
844  
845 <    if ((epref->cap & enc_can_send))
845 >    if (epref && (epref->cap & enc_can_send))
846      {
847        /* Leave the space -- it is removed later. */
848        tl = ircsprintf(t, "%s ", epref->name);
# Line 853 | Line 854 | send_capabilities(struct Client *client_
854        t = capend; /* truncate string before ENC:, below */
855    }
856   #endif
857 <  *(t-1) = '\0';
857 >  *(t - 1) = '\0';
858    sendto_one(client_p, "CAPAB :%s", msgbuf);
859   }
860  

Diff Legend

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