Changeset 18:e7187583dcf8 in freeDiameter for freeDiameter/fdd.y
- Timestamp:
- Oct 5, 2009, 5:13:01 PM (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameter/fdd.y
r14 r18 112 112 %token CONNPEER 113 113 %token CONNTO 114 %token TLS_CRED 115 %token TLS_CA 116 %token TLS_CRL 117 %token TLS_PRIO 118 %token TLS_DH_BITS 114 119 115 120 … … 118 123 119 124 /* The grammar definition - Sections blocs. */ 120 conffile: /* Empty is OK */125 conffile: /* Empty is OK -- for simplicity here, we reject in daemon later */ 121 126 | conffile identity 122 127 | conffile realm … … 136 141 | conffile loadext 137 142 | conffile connpeer 143 | conffile tls_cred 144 | conffile tls_ca 145 | conffile tls_crl 146 | conffile tls_prio 147 | conffile tls_dh 138 148 | conffile errors 139 149 { … … 447 457 } 448 458 ; 459 460 tls_cred: TLS_CRED '=' QSTRING ',' QSTRING ';' 461 { 462 conf->cnf_sec_data.cert_file = $3; 463 conf->cnf_sec_data.key_file = $5; 464 465 CHECK_GNUTLS_DO( gnutls_certificate_set_x509_key_file( 466 conf->cnf_sec_data.credentials, 467 conf->cnf_sec_data.cert_file, 468 conf->cnf_sec_data.key_file, 469 GNUTLS_X509_FMT_PEM), 470 { yyerror (&yylloc, conf, "Error opening certificate or private key file."); YYERROR; } ); 471 } 472 ; 473 474 tls_ca: TLS_CA '=' QSTRING ';' 475 { 476 conf->cnf_sec_data.ca_file = $3; 477 CHECK_GNUTLS_DO( gnutls_certificate_set_x509_trust_file( 478 conf->cnf_sec_data.credentials, 479 conf->cnf_sec_data.ca_file, 480 GNUTLS_X509_FMT_PEM), 481 { yyerror (&yylloc, conf, "Error setting CA parameters."); YYERROR; } ); 482 } 483 ; 484 485 tls_crl: TLS_CRL '=' QSTRING ';' 486 { 487 conf->cnf_sec_data.crl_file = $3; 488 CHECK_GNUTLS_DO( gnutls_certificate_set_x509_crl_file( 489 conf->cnf_sec_data.credentials, 490 conf->cnf_sec_data.ca_file, 491 GNUTLS_X509_FMT_PEM), 492 { yyerror (&yylloc, conf, "Error setting CRL parameters."); YYERROR; } ); 493 } 494 ; 495 496 tls_prio: TLS_PRIO '=' QSTRING ';' 497 { 498 const char * err_pos = NULL; 499 conf->cnf_sec_data.prio_string = $3; 500 CHECK_GNUTLS_DO( gnutls_priority_init( 501 &conf->cnf_sec_data.prio_cache, 502 conf->cnf_sec_data.prio_string, 503 &err_pos), 504 { yyerror (&yylloc, conf, "Error setting Priority parameter."); 505 fprintf(stderr, "Error at position : %s\n", err_pos); 506 YYERROR; } ); 507 } 508 ; 509 510 tls_dh: TLS_DH_BITS '=' INTEGER ';' 511 { 512 conf->cnf_sec_data.dh_bits = $3; 513 CHECK_GNUTLS_DO( gnutls_dh_params_generate2( 514 conf->cnf_sec_data.dh_cache, 515 conf->cnf_sec_data.dh_bits), 516 { yyerror (&yylloc, conf, "Error setting DH Bits parameters."); 517 YYERROR; } ); 518 } 519 ;
Note: See TracChangeset
for help on using the changeset viewer.