diff src/event/ngx_event_openssl.c @ 559:c1f965ef9718 release-0.3.1

nginx-0.3.1-RELEASE import *) Bugfix: the segmentation fault occurred when the signal queue overflowed if the "rtsig" method was used; the bug had appeared in 0.2.0. *) Change: correct handling of the "\\", "\"", "\'", and "\$" pairs in SSI.
author Igor Sysoev <igor@sysoev.ru>
date Mon, 10 Oct 2005 12:59:41 +0000
parents e16a8d574da5
children 9c2f3ed7a247
line wrap: on
line diff
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -144,6 +144,10 @@ ngx_ssl_certificate(ngx_ssl_t *ssl, u_ch
 ngx_int_t
 ngx_ssl_generate_rsa512_key(ngx_ssl_t *ssl)
 {
+    if (SSL_CTX_need_tmp_RSA(ssl->ctx) == 0) {
+        return NGX_OK;
+    }
+
     ssl->rsa512_key = RSA_generate_key(512, RSA_F4, NULL, NULL);
 
     if (ssl->rsa512_key) {
@@ -851,7 +855,10 @@ ngx_ssl_cleanup_ctx(void *data)
 {
    ngx_ssl_t  *ssl = data;
 
-   RSA_free(ssl->rsa512_key);
+   if (ssl->rsa512_key) {
+       RSA_free(ssl->rsa512_key);
+   }
+
    SSL_CTX_free(ssl->ctx);
 }