53 |
|
|
54 |
|
while ((cnt < 100) && (e = ERR_get_error())) |
55 |
|
{ |
56 |
< |
ilog(L_CRIT, "SSL error: %s", ERR_error_string(e, 0)); |
56 |
> |
ilog(LOG_TYPE_IRCD, "SSL error: %s", ERR_error_string(e, 0)); |
57 |
|
cnt++; |
58 |
|
} |
59 |
|
} |
71 |
|
/* If the rsa_private_key directive isn't found, error out. */ |
72 |
|
if (ServerInfo.rsa_private_key == NULL) |
73 |
|
{ |
74 |
< |
ilog(L_NOTICE, "rsa_private_key in serverinfo{} is not defined."); |
74 |
> |
ilog(LOG_TYPE_IRCD, "rsa_private_key in serverinfo{} is not defined."); |
75 |
|
return -1; |
76 |
|
} |
77 |
|
|
78 |
|
/* If rsa_private_key_file isn't available, error out. */ |
79 |
|
if (ServerInfo.rsa_private_key_file == NULL) |
80 |
|
{ |
81 |
< |
ilog(L_NOTICE, "Internal error: rsa_private_key_file isn't defined."); |
81 |
> |
ilog(LOG_TYPE_IRCD, "Internal error: rsa_private_key_file isn't defined."); |
82 |
|
return -1; |
83 |
|
} |
84 |
|
|
94 |
|
if (file == NULL) |
95 |
|
{ |
96 |
|
bio_spare_fd = save_spare_fd("SSL private key validation"); |
97 |
< |
ilog(L_NOTICE, "Failed to open private key file - can't validate it"); |
97 |
> |
ilog(LOG_TYPE_IRCD, "Failed to open private key file - can't validate it"); |
98 |
|
return -1; |
99 |
|
} |
100 |
|
|
102 |
|
|
103 |
|
if (key == NULL) |
104 |
|
{ |
105 |
< |
ilog(L_NOTICE, "PEM_read_bio_RSAPrivateKey() failed; possibly not RSA?"); |
105 |
> |
ilog(LOG_TYPE_IRCD, "PEM_read_bio_RSAPrivateKey() failed; possibly not RSA?"); |
106 |
|
report_crypto_errors(); |
107 |
|
return -1; |
108 |
|
} |
119 |
|
* in-memory key vs. the one we just loaded. This is bad, mmmkay? |
120 |
|
*/ |
121 |
|
if (mkey->pad != key->pad) |
122 |
< |
ilog(L_CRIT, "Private key corrupted: pad %i != pad %i", |
123 |
< |
mkey->pad, key->pad); |
122 |
> |
ilog(LOG_TYPE_IRCD, "Private key corrupted: pad %i != pad %i", |
123 |
> |
mkey->pad, key->pad); |
124 |
|
|
125 |
|
if (mkey->version != key->version) |
126 |
< |
ilog(L_CRIT, "Private key corrupted: version %li != version %li", |
127 |
< |
mkey->version, key->version); |
126 |
> |
ilog(LOG_TYPE_IRCD, "Private key corrupted: version %li != version %li", |
127 |
> |
mkey->version, key->version); |
128 |
|
|
129 |
|
if (BN_cmp(mkey->n, key->n)) |
130 |
< |
ilog(L_CRIT, "Private key corrupted: n differs"); |
130 |
> |
ilog(LOG_TYPE_IRCD, "Private key corrupted: n differs"); |
131 |
|
if (BN_cmp(mkey->e, key->e)) |
132 |
< |
ilog(L_CRIT, "Private key corrupted: e differs"); |
132 |
> |
ilog(LOG_TYPE_IRCD, "Private key corrupted: e differs"); |
133 |
|
if (BN_cmp(mkey->d, key->d)) |
134 |
< |
ilog(L_CRIT, "Private key corrupted: d differs"); |
134 |
> |
ilog(LOG_TYPE_IRCD, "Private key corrupted: d differs"); |
135 |
|
if (BN_cmp(mkey->p, key->p)) |
136 |
< |
ilog(L_CRIT, "Private key corrupted: p differs"); |
136 |
> |
ilog(LOG_TYPE_IRCD, "Private key corrupted: p differs"); |
137 |
|
if (BN_cmp(mkey->q, key->q)) |
138 |
< |
ilog(L_CRIT, "Private key corrupted: q differs"); |
138 |
> |
ilog(LOG_TYPE_IRCD, "Private key corrupted: q differs"); |
139 |
|
if (BN_cmp(mkey->dmp1, key->dmp1)) |
140 |
< |
ilog(L_CRIT, "Private key corrupted: dmp1 differs"); |
140 |
> |
ilog(LOG_TYPE_IRCD, "Private key corrupted: dmp1 differs"); |
141 |
|
if (BN_cmp(mkey->dmq1, key->dmq1)) |
142 |
< |
ilog(L_CRIT, "Private key corrupted: dmq1 differs"); |
142 |
> |
ilog(LOG_TYPE_IRCD, "Private key corrupted: dmq1 differs"); |
143 |
|
if (BN_cmp(mkey->iqmp, key->iqmp)) |
144 |
< |
ilog(L_CRIT, "Private key corrupted: iqmp differs"); |
144 |
> |
ilog(LOG_TYPE_IRCD, "Private key corrupted: iqmp differs"); |
145 |
|
|
146 |
|
RSA_free(key); |
147 |
|
return 0; |