Lines 107-130
Link Here
|
107 |
SSL_CTX_set_default_passwd_cb(ctx, pem_passwd_cb); |
107 |
SSL_CTX_set_default_passwd_cb(ctx, pem_passwd_cb); |
108 |
#endif |
108 |
#endif |
109 |
for(i=0; i<3; i++) { |
109 |
for(i=0; i<3; i++) { |
110 |
#ifdef NO_RSA |
|
|
111 |
if(SSL_CTX_use_PrivateKey_file(ctx, options.key, |
110 |
if(SSL_CTX_use_PrivateKey_file(ctx, options.key, |
112 |
SSL_FILETYPE_PEM)) |
111 |
SSL_FILETYPE_PEM)) |
113 |
#else /* NO_RSA */ |
|
|
114 |
if(SSL_CTX_use_RSAPrivateKey_file(ctx, options.key, |
115 |
SSL_FILETYPE_PEM)) |
116 |
#endif /* NO_RSA */ |
117 |
break; |
112 |
break; |
118 |
if(i<2 && ERR_GET_REASON(ERR_peek_error())==EVP_R_BAD_DECRYPT) { |
113 |
if(i<2 && ERR_GET_REASON(ERR_peek_error())==EVP_R_BAD_DECRYPT) { |
119 |
sslerror_stack(); /* dump the error stack */ |
114 |
sslerror_stack(); /* dump the error stack */ |
120 |
log(LOG_ERR, "Wrong pass phrase: retrying"); |
115 |
log(LOG_ERR, "Wrong pass phrase: retrying"); |
121 |
continue; |
116 |
continue; |
122 |
} |
117 |
} |
123 |
#ifdef NO_RSA |
|
|
124 |
sslerror("SSL_CTX_use_PrivateKey_file"); |
118 |
sslerror("SSL_CTX_use_PrivateKey_file"); |
125 |
#else /* NO_RSA */ |
|
|
126 |
sslerror("SSL_CTX_use_RSAPrivateKey_file"); |
127 |
#endif /* NO_RSA */ |
128 |
exit(1); |
119 |
exit(1); |
129 |
} |
120 |
} |
130 |
if(!SSL_CTX_check_private_key(ctx)) { |
121 |
if(!SSL_CTX_check_private_key(ctx)) { |