mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Drop invalid records with DTLS
This commit is contained in:
parent
167a37632d
commit
63eca930d7
3 changed files with 65 additions and 12 deletions
|
|
@ -297,10 +297,8 @@ int send_packet( const packet *p, const char *why )
|
|||
}
|
||||
|
||||
/* Don't duplicate Application Data, only handshake covered */
|
||||
// Don't duplicate CSS for now (TODO later)
|
||||
if( opt.duplicate != 0 &&
|
||||
strcmp( p->type, "ApplicationData" ) != 0 &&
|
||||
strcmp( p->type, "ChangeCipherSpec" ) != 0 &&
|
||||
++dupl_cnt == opt.duplicate )
|
||||
{
|
||||
dupl_cnt = 0;
|
||||
|
|
@ -322,7 +320,7 @@ int handle_message( const char *way, int dst, int src )
|
|||
packet cur;
|
||||
static packet prev;
|
||||
|
||||
/* receivec packet */
|
||||
/* receive packet */
|
||||
if( ( ret = net_recv( &src, cur.buf, sizeof( cur.buf ) ) ) <= 0 )
|
||||
{
|
||||
printf( " ! net_recv returned %d\n", ret );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue