Changeset 4624
- Timestamp:
- 02/14/07 17:39:21 (2 years ago)
- Files:
-
- wired/branches/p7/wired/server.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wired/branches/p7/wired/server.c
r4615 r4624 66 66 67 67 static wi_p7_spec_t *wd_p7_spec; 68 static EVP_PKEY *wd_p7_pkey;68 static wi_p7_rsa_t *wd_p7_rsa; 69 69 70 70 wi_string_t *wd_banner; … … 283 283 wi_log_err(WI_STR("Could not set anonymous DH key: %m"));*/ 284 284 285 286 287 288 RSA *rsa; 289 FILE *fp; 290 291 fp = fopen("key", "r"); 292 293 if(!fp) 294 wi_log_err(WI_STR("fopen(): key: %s"), strerror(errno)); 295 296 ERR_load_crypto_strings(); 297 298 rsa = PEM_read_RSAPrivateKey(fp, NULL, NULL, NULL); 299 300 if(!rsa) 301 wi_log_err(WI_STR("PEM_read_RSAPublicKey(): %s"), ERR_reason_error_string(ERR_get_error())); 302 303 wd_p7_pkey = EVP_PKEY_new(); 304 EVP_PKEY_assign_RSA(wd_p7_pkey, rsa); 285 wd_p7_rsa = wi_p7_rsa_init_with_private_pem_file(wi_p7_rsa_alloc(), WI_STR("key")); 305 286 } 306 287 … … 341 322 342 323 p7_socket = wi_autorelease(wi_p7_socket_init_with_socket(wi_p7_socket_alloc(), socket, wd_p7_spec)); 343 wi_p7_socket_set_private_ key(p7_socket, wd_p7_pkey);324 wi_p7_socket_set_private_rsa(p7_socket, wd_p7_rsa); 344 325 345 326 if(!wi_p7_socket_accept(p7_socket, 10.0, WI_P7_ALL)) {
