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

Comparing:
ircd-hybrid/src/rsa.c (file contents), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.3/src/rsa.c (file contents), Revision 1029 by michael, Sun Nov 8 13:10:50 2009 UTC

# Line 19 | Line 19
19   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
20   *  USA
21   *
22 < *  $Id: rsa.c,v 7.34 2005/07/26 03:33:05 adx Exp $
22 > *  $Id$
23   */
24  
25   #include "stdinc.h"
# Line 27 | Line 27
27   #include <openssl/pem.h>
28   #include <openssl/rand.h>
29   #include <openssl/rsa.h>
30 – #include <openssl/md5.h>
30   #include <openssl/bn.h>
31   #include <openssl/evp.h>
32   #include <openssl/err.h>
33 + #include <openssl/opensslv.h>
34  
35   #include "memory.h"
36   #include "rsa.h"
37 – #include "tools.h"
37   #include "s_conf.h"
38   #include "s_log.h"
39   #include "client.h" /* CIPHERKEYLEN .. eww */
40   #include "ircd.h" /* bio_spare_fd */
41  
43 – static void binary_to_hex(unsigned char *bin, char *hex, int length);
42  
43   /*
44   * report_crypto_errors - Dump crypto error list to log
# Line 100 | Line 98 | verify_private_key(void)
98      return -1;
99    }
100  
101 <  /*
104 <   * jdc -- Let's do this a little differently.  According to the
105 <   *        OpenSSL documentation, you need to METHOD_free(key) before
106 <   *        assigning it.  Don't believe me?  Check out the following
107 <   *        URL:  http://www.openssl.org/docs/crypto/pem.html#BUGS
108 <   * P.S. -- I have no idea why the key= assignment has to be typecasted.
109 <   *         For some reason the system thinks PEM_read_bio_RSAPrivateKey
110 <   *         is returning an int, not a RSA *.
111 <   * androsyn -- Thats because you didn't have a prototype and including
112 <   *             pem.h breaks things for some reason..
113 <   */
114 <  key = (RSA *) PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
101 >  key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
102  
103    if (key == NULL)
104    {
# Line 136 | Line 123 | verify_private_key(void)
123                   mkey->pad, key->pad);
124    
125    if (mkey->version != key->version)
139 –  {
140 – #if (OPENSSL_VERSION_NUMBER & 0x00907000) == 0x00907000
126      ilog(L_CRIT, "Private key corrupted: version %li != version %li",
127                   mkey->version, key->version);
143 – #else
144 –    ilog(L_CRIT, "Private key corrupted: version %i != version %i",
145 –                 mkey->version, key->version);
146 – #endif
147 –  }    
128  
129    if (BN_cmp(mkey->n, key->n))
130      ilog(L_CRIT, "Private key corrupted: n differs");
# Line 174 | Line 154 | binary_to_hex(unsigned char *bin, char *
154    static const char trans[] = "0123456789ABCDEF";
155    int i;
156  
157 <  for(i = 0; i < length; i++)
157 >  for (i = 0; i < length; i++)
158    {
159      hex[i  << 1]      = trans[bin[i] >> 4];
160      hex[(i << 1) + 1] = trans[bin[i] & 0xf];

Comparing:
ircd-hybrid/src/rsa.c (property svn:keywords), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.3/src/rsa.c (property svn:keywords), Revision 1029 by michael, Sun Nov 8 13:10:50 2009 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

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