/[svn]/ircd-hybrid/trunk/src/tls_openssl.c
ViewVC logotype

Diff of /ircd-hybrid/trunk/src/tls_openssl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9934 by michael, Fri Jan 1 04:43:22 2021 UTC revision 9935 by michael, Thu May 13 07:06:31 2021 UTC
# Line 134  tls_new_credentials(void) Line 134  tls_new_credentials(void)
134    
135    if (ConfigServerInfo.tls_dh_param_file)    if (ConfigServerInfo.tls_dh_param_file)
136    {    {
137    #if OPENSSL_VERSION_NUMBER < 0x30000000L
138      BIO *file = BIO_new_file(ConfigServerInfo.tls_dh_param_file, "r");      BIO *file = BIO_new_file(ConfigServerInfo.tls_dh_param_file, "r");
139    
140      if (file)      if (file)
# Line 150  tls_new_credentials(void) Line 151  tls_new_credentials(void)
151      }      }
152      else      else
153        ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::tls_dh_param_file -- could not open/read Diffie-Hellman parameter file");        ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::tls_dh_param_file -- could not open/read Diffie-Hellman parameter file");
154    #else
155        EVP_PKEY *dhpkey = NULL;
156        OSSL_STORE_CTX *ctx = OSSL_STORE_open(ConfigServerInfo.tls_dh_param_file, NULL, NULL, NULL, NULL);
157        if (ctx)
158        {
159          if (OSSL_STORE_expect(ctx, OSSL_STORE_INFO_PARAMS))
160          {
161            while (OSSL_STORE_eof(ctx) == 0)
162            {
163              OSSL_STORE_INFO *info = OSSL_STORE_load(ctx);
164              if (info)
165              {
166                dhpkey = OSSL_STORE_INFO_get1_PARAMS(info);
167                OSSL_STORE_INFO_free(info);
168    
169                if (dhpkey)
170                {
171                  if (EVP_PKEY_is_a(dhpkey, "DH"))
172                    if (SSL_CTX_set0_tmp_dh_pkey(ConfigServerInfo.tls_ctx.server_ctx, dhpkey))
173                      break;
174    
175                  EVP_PKEY_free(dhpkey);
176                  dhpkey = NULL;
177                }
178              }
179            }
180          }
181    
182          OSSL_STORE_close(ctx);
183        }
184    
185        if (dhpkey == NULL)
186          ilog(LOG_TYPE_IRCD, "Ignoring serverinfo::tls_dh_param_file -- could not open/read Diffie-Hellman parameter file");
187    #endif
188    }    }
189    
190    if (ConfigServerInfo.tls_supported_groups == NULL)    if (ConfigServerInfo.tls_supported_groups == NULL)

Legend:
Removed from v.9934  
changed lines
  Added in v.9935

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28