@@ -224,20 +224,6 @@ static DH *load_dh_param(const char *dhfile);
224
224
static void s_server_init (void );
225
225
#endif
226
226
227
- #ifndef OPENSSL_NO_TLSEXT
228
-
229
- static const unsigned char auth_ext_data []= {TLSEXT_AUTHZDATAFORMAT_dtcp };
230
-
231
- static unsigned char * generated_supp_data = NULL ;
232
-
233
- static const unsigned char * most_recent_supplemental_data = NULL ;
234
- static size_t most_recent_supplemental_data_length = 0 ;
235
-
236
- static int client_provided_server_authz = 0 ;
237
- static int client_provided_client_authz = 0 ;
238
-
239
- #endif
240
-
241
227
/* static int load_CA(SSL_CTX *ctx, char *file);*/
242
228
243
229
#undef BUFSIZZ
@@ -302,29 +288,9 @@ static int cert_chain = 0;
302
288
#endif
303
289
304
290
#ifndef OPENSSL_NO_TLSEXT
305
- static int suppdata_cb (SSL * s , unsigned short supp_data_type ,
306
- const unsigned char * in ,
307
- unsigned short inlen , int * al ,
308
- void * arg );
309
-
310
- static int auth_suppdata_generate_cb (SSL * s , unsigned short supp_data_type ,
311
- const unsigned char * * out ,
312
- unsigned short * outlen , int * al , void * arg );
313
-
314
- static int authz_tlsext_generate_cb (SSL * s , unsigned short ext_type ,
315
- const unsigned char * * out , unsigned short * outlen ,
316
- int * al , void * arg );
317
-
318
- static int authz_tlsext_cb (SSL * s , unsigned short ext_type ,
319
- const unsigned char * in ,
320
- unsigned short inlen , int * al ,
321
- void * arg );
322
-
323
291
static BIO * serverinfo_in = NULL ;
324
292
static const char * s_serverinfo_file = NULL ;
325
293
326
- static int c_auth = 0 ;
327
- static int c_auth_require_reneg = 0 ;
328
294
#endif
329
295
330
296
#ifndef OPENSSL_NO_PSK
@@ -490,8 +456,6 @@ static void sv_usage(void)
490
456
BIO_printf (bio_err ," -naccept arg - terminate after 'arg' connections\n" );
491
457
#ifndef OPENSSL_NO_TLSEXT
492
458
BIO_printf (bio_err ," -serverinfo arg - PEM serverinfo file for certificate\n" );
493
- BIO_printf (bio_err ," -auth - send and receive RFC 5878 TLS auth extensions and supplemental data\n" );
494
- BIO_printf (bio_err ," -auth_require_reneg - Do not send TLS auth extensions until renegotiation\n" );
495
459
#endif
496
460
BIO_printf (bio_err ," -no_resumption_on_reneg - set SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION flag\n" );
497
461
BIO_printf (bio_err ," -crl_check - check the peer certificate has not been revoked by its CA.\n" \
@@ -1178,15 +1142,7 @@ int MAIN(int argc, char *argv[])
1178
1142
if (-- argc < 1 ) goto bad ;
1179
1143
s_serverinfo_file = * (++ argv );
1180
1144
}
1181
- else if (strcmp (* argv ,"- auth ") == 0 )
1182
- {
1183
- c_auth = 1 ;
1184
- }
1185
1145
#endif
1186
- else if (strcmp (* argv ,"- auth_require_reneg ") == 0 )
1187
- {
1188
- c_auth_require_reneg = 1 ;
1189
- }
1190
1146
else if (strcmp (* argv ,"- certform ") == 0 )
1191
1147
{
1192
1148
if (-- argc < 1 ) goto bad ;
@@ -1997,12 +1953,6 @@ int MAIN(int argc, char *argv[])
1997
1953
ERR_print_errors (bio_err );
1998
1954
goto end ;
1999
1955
}
2000
- if (c_auth )
2001
- {
2002
- SSL_CTX_set_custom_srv_ext (ctx , TLSEXT_TYPE_client_authz , authz_tlsext_cb , authz_tlsext_generate_cb , bio_err );
2003
- SSL_CTX_set_custom_srv_ext (ctx , TLSEXT_TYPE_server_authz , authz_tlsext_cb , authz_tlsext_generate_cb , bio_err );
2004
- SSL_CTX_set_srv_supp_data (ctx , TLSEXT_SUPPLEMENTALDATATYPE_authz_data , auth_suppdata_generate_cb , suppdata_cb , bio_err );
2005
- }
2006
1956
#endif
2007
1957
#ifndef OPENSSL_NO_TLSEXT
2008
1958
if (ctx2 && !set_cert_key_stuff (ctx2 ,s_cert2 ,s_key2 , NULL , build_chain ))
@@ -2722,12 +2672,6 @@ static int init_ssl_connection(SSL *con)
2722
2672
i = SSL_accept (con );
2723
2673
}
2724
2674
#endif
2725
- /*handshake is complete - free the generated supp data allocated in the callback */
2726
- if (generated_supp_data )
2727
- {
2728
- OPENSSL_free (generated_supp_data );
2729
- generated_supp_data = NULL ;
2730
- }
2731
2675
2732
2676
if (i <= 0 )
2733
2677
{
@@ -3615,77 +3559,3 @@ static void free_sessions(void)
3615
3559
}
3616
3560
first = NULL ;
3617
3561
}
3618
-
3619
- #ifndef OPENSSL_NO_TLSEXT
3620
- static int authz_tlsext_cb (SSL * s , unsigned short ext_type ,
3621
- const unsigned char * in ,
3622
- unsigned short inlen , int * al ,
3623
- void * arg )
3624
- {
3625
- if (TLSEXT_TYPE_server_authz == ext_type )
3626
- client_provided_server_authz
3627
- = memchr (in , TLSEXT_AUTHZDATAFORMAT_dtcp , inlen ) != NULL ;
3628
-
3629
- if (TLSEXT_TYPE_client_authz == ext_type )
3630
- client_provided_client_authz
3631
- = memchr (in , TLSEXT_AUTHZDATAFORMAT_dtcp , inlen ) != NULL ;
3632
-
3633
- return 1 ;
3634
- }
3635
-
3636
- static int authz_tlsext_generate_cb (SSL * s , unsigned short ext_type ,
3637
- const unsigned char * * out , unsigned short * outlen ,
3638
- int * al , void * arg )
3639
- {
3640
- if (c_auth && client_provided_client_authz && client_provided_server_authz )
3641
- {
3642
- /*if auth_require_reneg flag is set, only send extensions if
3643
- renegotiation has occurred */
3644
- if (!c_auth_require_reneg
3645
- || (c_auth_require_reneg && SSL_num_renegotiations (s )))
3646
- {
3647
- * out = auth_ext_data ;
3648
- * outlen = 1 ;
3649
- return 1 ;
3650
- }
3651
- }
3652
- /* no auth extension to send */
3653
- return -1 ;
3654
- }
3655
-
3656
- static int suppdata_cb (SSL * s , unsigned short supp_data_type ,
3657
- const unsigned char * in ,
3658
- unsigned short inlen , int * al ,
3659
- void * arg )
3660
- {
3661
- if (supp_data_type == TLSEXT_SUPPLEMENTALDATATYPE_authz_data )
3662
- {
3663
- most_recent_supplemental_data = in ;
3664
- most_recent_supplemental_data_length = inlen ;
3665
- }
3666
- return 1 ;
3667
- }
3668
-
3669
- static int auth_suppdata_generate_cb (SSL * s , unsigned short supp_data_type ,
3670
- const unsigned char * * out ,
3671
- unsigned short * outlen , int * al , void * arg )
3672
- {
3673
- if (c_auth && client_provided_client_authz && client_provided_server_authz )
3674
- {
3675
- /*if auth_require_reneg flag is set, only send supplemental data if
3676
- renegotiation has occurred */
3677
- if (!c_auth_require_reneg
3678
- || (c_auth_require_reneg && SSL_num_renegotiations (s )))
3679
- {
3680
- generated_supp_data = OPENSSL_malloc (10 );
3681
- memcpy (generated_supp_data , "1234512345" , 10 );
3682
- * out = generated_supp_data ;
3683
- * outlen = 10 ;
3684
- return 1 ;
3685
- }
3686
- }
3687
- /* no supplemental data to send */
3688
- return -1 ;
3689
- }
3690
- #endif
3691
-
0 commit comments