@@ -564,8 +564,13 @@ void tac_read(struct context *ctx, int cur)
564
564
if (config .rad_dict && ctx -> hdroff > 0 && ctx -> hdr .tac .version < TAC_PLUS_MAJOR_VER ) {
565
565
#ifdef WITH_SSL
566
566
if (ctx -> tls ) {
567
+ int ssl_version = SSL_version (ctx -> tls );
568
+ if (!(ctx -> host -> bug_compatibility & CLIENT_BUG_BAD_TLS_VERSION ) && (!tls_ver_ok (ctx -> tls_versions , ssl_version & 0xff ))) {
569
+ ctx -> reset_tcp = BISTATE_YES ;
570
+ reject_conn (ctx , NULL , (char * ) SSL_get_version (ctx -> tls ), __LINE__ );
571
+ return ;
572
+ }
567
573
if (ctx -> radius_1_1 == BISTATE_YES ) {
568
- int ssl_version = SSL_version (ctx -> tls );
569
574
switch (ssl_version ) {
570
575
case TLS1_3_VERSION :
571
576
case DTLS1_2_VERSION : // FIXME, is that fine for radius/1.1?
@@ -575,7 +580,7 @@ void tac_read(struct context *ctx, int cur)
575
580
break ;
576
581
default :
577
582
ctx -> reset_tcp = BISTATE_YES ;
578
- cleanup (ctx , cur );
583
+ reject_conn (ctx , NULL , ( char * ) SSL_get_version ( ctx -> tls ), __LINE__ );
579
584
return ;
580
585
}
581
586
}
@@ -606,12 +611,12 @@ void tac_read(struct context *ctx, int cur)
606
611
#ifdef WITH_SSL
607
612
if (ctx -> tls && ctx -> use_tls ) {
608
613
#define S "radsec"
609
- static struct tac_key key = { .len = sizeof (S ) - 1 , .key = S };
614
+ static struct tac_key key = {.len = sizeof (S ) - 1 ,.key = S };
610
615
#undef S
611
616
ctx -> key = & key ;
612
617
} else if (ctx -> tls && ctx -> use_dtls ) {
613
618
#define S "radius/dtls"
614
- static struct tac_key key = { .len = sizeof (S ) - 1 , .key = S };
619
+ static struct tac_key key = {.len = sizeof (S ) - 1 ,.key = S };
615
620
#undef S
616
621
ctx -> key = & key ;
617
622
} else
@@ -634,6 +639,12 @@ void tac_read(struct context *ctx, int cur)
634
639
CHECK_PROTOCOL (tacacs_tls , tacacs );
635
640
ctx -> aaa_protocol = S_tacacs_tls ;
636
641
int ssl_version = SSL_version (ctx -> tls );
642
+ if (!(ctx -> host -> bug_compatibility & CLIENT_BUG_BAD_TLS_VERSION )
643
+ && (!tls_ver_ok (ctx -> tls_versions , ssl_version & 0xff ) || ssl_version != TLS1_3_VERSION )) {
644
+ ctx -> reset_tcp = BISTATE_YES ;
645
+ reject_conn (ctx , NULL , (char * ) SSL_get_version (ctx -> tls ), __LINE__ );
646
+ return ;
647
+ }
637
648
switch (ssl_version ) {
638
649
case TLS1_2_VERSION :
639
650
case TLS1_3_VERSION :
@@ -642,11 +653,6 @@ void tac_read(struct context *ctx, int cur)
642
653
ssl_version = 0 ;
643
654
break ;
644
655
}
645
- if (!(ctx -> host -> bug_compatibility & CLIENT_BUG_BAD_TLS_VERSION ) && (!tls_ver_ok (ctx -> tls_versions , ssl_version & 0xff ) || ssl_version != TLS1_3_VERSION )) {
646
- ctx -> reset_tcp = BISTATE_YES ;
647
- cleanup (ctx , cur );
648
- return ;
649
- }
650
656
} else
651
657
#endif
652
658
{
@@ -1149,12 +1155,13 @@ void tac_write(struct context *ctx, int cur)
1149
1155
1150
1156
#define STR_TYPE (A ) { A, sizeof(A) - 1}
1151
1157
static str_t types [] = {
1152
- STR_TYPE ("" ), // 0
1153
- STR_TYPE ("authen" ), // 1, TAC_PLUS_AUTHEN
1154
- STR_TYPE ("author" ), // 2, TAC_PLUS_AUTHOR
1155
- STR_TYPE ("acct" ), // 3, TAC_PLUS_ACCT
1156
- STR_TYPE ("status" ), // 4
1158
+ STR_TYPE ("" ), // 0
1159
+ STR_TYPE ("authen" ), // 1, TAC_PLUS_AUTHEN
1160
+ STR_TYPE ("author" ), // 2, TAC_PLUS_AUTHOR
1161
+ STR_TYPE ("acct" ), // 3, TAC_PLUS_ACCT
1162
+ STR_TYPE ("status" ), // 4
1157
1163
};
1164
+
1158
1165
#undef STR_TYPE
1159
1166
1160
1167
static tac_session * new_session (struct context * ctx , tac_pak_hdr * tac_hdr , rad_pak_hdr * radhdr )
0 commit comments