ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/src/conf_parser.y
(Generate patch)

Comparing ircd-hybrid-8/src/ircd_parser.y (file contents):
Revision 1303 by michael, Fri Mar 23 10:52:19 2012 UTC vs.
Revision 1306 by michael, Sat Mar 24 07:43:04 2012 UTC

# Line 52 | Line 52
52   #include <openssl/rsa.h>
53   #include <openssl/bio.h>
54   #include <openssl/pem.h>
55 + #include <openssl/dh.h>
56   #endif
57  
58   static char *class_name = NULL;
# Line 273 | Line 274 | unhook_hub_leaf_confs(void)
274   %token  RSA_PRIVATE_KEY_FILE
275   %token  RSA_PUBLIC_KEY_FILE
276   %token  SSL_CERTIFICATE_FILE
277 + %token  SSL_DH_PARAM_FILE
278   %token  T_SSL_CONNECTION_METHOD
279   %token  T_SSLV3
280   %token  T_TLSV1
# Line 309 | Line 311 | unhook_hub_leaf_confs(void)
311   %token  T_CALLERID
312   %token  T_CCONN
313   %token  T_CCONN_FULL
314 + %token  T_SSL_CIPHER_LIST
315   %token  T_CLIENT_FLOOD
316   %token  T_DEAF
317   %token  T_DEBUG
# Line 464 | Line 467 | serverinfo_items:       serverinfo_items
467   serverinfo_item:        serverinfo_name | serverinfo_vhost |
468                          serverinfo_hub | serverinfo_description |
469                          serverinfo_network_name | serverinfo_network_desc |
470 <                        serverinfo_max_clients |
470 >                        serverinfo_max_clients | serverinfo_ssl_dh_param_file |
471                          serverinfo_rsa_private_key_file | serverinfo_vhost6 |
472                          serverinfo_sid | serverinfo_ssl_certificate_file |
473 <                        serverinfo_ssl_connection_method |
473 >                        serverinfo_ssl_connection_method | serverinfo_ssl_cipher_list |
474                          error ';' ;
475  
476  
# Line 578 | Line 581 | serverinfo_rsa_private_key_file: RSA_PRI
581        break;
582      }
583  
584 <    ServerInfo.rsa_private_key = (RSA *)PEM_read_bio_RSAPrivateKey(file, NULL,
582 <      0, NULL);
584 >    ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
585  
586      BIO_set_close(file, BIO_CLOSE);
587      BIO_free(file);
# Line 611 | Line 613 | serverinfo_rsa_private_key_file: RSA_PRI
613   #endif
614   };
615  
616 + serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';'
617 + {
618 + /* TBD - XXX: error reporting */
619 + #ifdef HAVE_LIBCRYPTO
620 +  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
621 +  {
622 +    BIO *file = BIO_new_file(yylval.string, "r");
623 +
624 +    if (file)
625 +    {
626 +      DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL);
627 +
628 +      BIO_free(file);
629 +
630 +      if (dh)
631 +      {
632 +        SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh);
633 +        DH_free(dh);
634 +      }
635 +    }
636 +  }
637 + #endif
638 + };
639 +
640 + serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
641 + {
642 + #ifdef HAVE_LIBCRYPTO
643 +  if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx)
644 +  {
645 +    SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string);
646 +  }
647 + #endif
648 + };
649 +
650   serverinfo_name: NAME '=' QSTRING ';'
651   {
652    /* this isn't rehashable */
# Line 2155 | Line 2191 | connect_entry: CONNECT
2191   connect_items:  connect_items connect_item | connect_item;
2192   connect_item:   connect_name | connect_host | connect_vhost |
2193                  connect_send_password | connect_accept_password |
2194 <                connect_aftype | connect_port |
2194 >                connect_aftype | connect_port | connect_ssl_cipher_list |
2195                  connect_flags | connect_hub_mask | connect_leaf_mask |
2196                  connect_class | connect_encrypted |
2197                  error ';' ;
# Line 2330 | Line 2366 | connect_class: CLASS '=' QSTRING ';'
2366    }
2367   };
2368  
2369 + connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';'
2370 + {
2371 + #ifdef HAVE_LIBCRYPTO
2372 +  if (conf_parser_ctx.pass == 2)
2373 +  {
2374 +    MyFree(yy_aconf->cipher_list);
2375 +    DupString(yy_aconf->cipher_list, yylval.string);
2376 +  }
2377 + #else
2378 +  if (conf_parser_ctx.pass == 2)
2379 +    yyerror("Ignoring connect::ciphers -- no OpenSSL support");
2380 + #endif
2381 + };
2382 +
2383 +
2384   /***************************************************************************
2385   *  section kill
2386   ***************************************************************************/

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)