mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Add tests for ssl_get_bytes_avail()
This commit is contained in:
parent
e7a3b10dcc
commit
95c0a63023
2 changed files with 22 additions and 3 deletions
|
|
@ -112,7 +112,12 @@
|
|||
|
||||
#define MAX_PSK_LEN 256
|
||||
|
||||
/* Size of the basic I/O buffer. Able to hold our default response. */
|
||||
/*
|
||||
* Size of the basic I/O buffer. Able to hold our default response.
|
||||
*
|
||||
* You will need to adapt the ssl_get_bytes_avail() test in ssl-opt.sh
|
||||
* if you change this value to something outside the range <= 100 or > 500
|
||||
*/
|
||||
#define IO_BUF_LEN 200
|
||||
|
||||
/*
|
||||
|
|
@ -1491,9 +1496,10 @@ reset:
|
|||
memset( larger_buf, 0, ori_len + extra_len );
|
||||
memcpy( larger_buf, buf, ori_len );
|
||||
|
||||
/* This read should never fail */
|
||||
/* This read should never fail and get the whole cached data */
|
||||
ret = ssl_read( &ssl, larger_buf + ori_len, extra_len );
|
||||
if( ret != extra_len )
|
||||
if( ret != extra_len ||
|
||||
ssl_get_bytes_avail( &ssl ) != 0 )
|
||||
{
|
||||
printf( " ! ssl_read failed on cached data\n" );
|
||||
ret = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue