mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 19:55:36 +01:00
Add option for serialization in ssl_client/server2
This commit is contained in:
parent
7667afd4fc
commit
0ea3cfe5bf
@ -122,6 +122,7 @@ int main( void )
|
||||
#define DFL_FALLBACK -1
|
||||
#define DFL_EXTENDED_MS -1
|
||||
#define DFL_ETM -1
|
||||
#define DFL_SERIALIZE 0
|
||||
#define DFL_EXTENDED_MS_ENFORCE -1
|
||||
|
||||
#define GET_REQUEST "GET %s HTTP/1.0\r\nExtra-header: "
|
||||
@ -343,6 +344,7 @@ int main( void )
|
||||
" configuration macro is defined and 1\n" \
|
||||
" otherwise. The expansion of the macro\n" \
|
||||
" is printed if it is defined\n" \
|
||||
" serialize=%%d default: 0 (do not serialize/deserialize)\n" \
|
||||
" acceptable ciphersuite names:\n"
|
||||
|
||||
#define ALPN_LIST_SIZE 10
|
||||
@ -419,6 +421,7 @@ struct options
|
||||
int cid_enabled_renego; /* whether to use the CID extension or not
|
||||
* during renegotiation */
|
||||
const char *cid_val; /* the CID to use for incoming messages */
|
||||
int serialize; /* serialize/deserialize connection */
|
||||
const char *cid_val_renego; /* the CID to use for incoming messages
|
||||
* after renegotiation */
|
||||
} opt;
|
||||
@ -832,6 +835,7 @@ int main( int argc, char *argv[] )
|
||||
opt.enforce_extended_master_secret = DFL_EXTENDED_MS_ENFORCE;
|
||||
opt.etm = DFL_ETM;
|
||||
opt.dgram_packing = DFL_DGRAM_PACKING;
|
||||
opt.serialize = DFL_SERIALIZE;
|
||||
|
||||
for( i = 1; i < argc; i++ )
|
||||
{
|
||||
@ -1215,6 +1219,12 @@ int main( int argc, char *argv[] )
|
||||
{
|
||||
return query_config( q );
|
||||
}
|
||||
else if( strcmp( p, "serialize") == 0 )
|
||||
{
|
||||
opt.serialize = atoi( q );
|
||||
if( opt.serialize < 0 || opt.serialize > 1)
|
||||
goto usage;
|
||||
}
|
||||
else
|
||||
goto usage;
|
||||
}
|
||||
|
@ -163,6 +163,7 @@ int main( void )
|
||||
#define DFL_DGRAM_PACKING 1
|
||||
#define DFL_EXTENDED_MS -1
|
||||
#define DFL_ETM -1
|
||||
#define DFL_SERIALIZE 0
|
||||
#define DFL_EXTENDED_MS_ENFORCE -1
|
||||
|
||||
#define LONG_RESPONSE "<p>01-blah-blah-blah-blah-blah-blah-blah-blah-blah\r\n" \
|
||||
@ -445,6 +446,7 @@ int main( void )
|
||||
" configuration macro is defined and 1\n" \
|
||||
" otherwise. The expansion of the macro\n" \
|
||||
" is printed if it is defined\n" \
|
||||
" serialize=%%d default: 0 (do not serialize/deserialize)\n" \
|
||||
" acceptable ciphersuite names:\n"
|
||||
|
||||
|
||||
@ -542,6 +544,7 @@ struct options
|
||||
int cid_enabled_renego; /* whether to use the CID extension or not
|
||||
* during renegotiation */
|
||||
const char *cid_val; /* the CID to use for incoming messages */
|
||||
int serialize; /* serialize/deserialize connection */
|
||||
const char *cid_val_renego; /* the CID to use for incoming messages
|
||||
* after renegotiation */
|
||||
} opt;
|
||||
@ -1500,6 +1503,7 @@ int main( int argc, char *argv[] )
|
||||
opt.extended_ms = DFL_EXTENDED_MS;
|
||||
opt.enforce_extended_master_secret = DFL_EXTENDED_MS_ENFORCE;
|
||||
opt.etm = DFL_ETM;
|
||||
opt.serialize = DFL_SERIALIZE;
|
||||
|
||||
for( i = 1; i < argc; i++ )
|
||||
{
|
||||
@ -1917,6 +1921,12 @@ int main( int argc, char *argv[] )
|
||||
{
|
||||
return query_config( q );
|
||||
}
|
||||
else if( strcmp( p, "serialize") == 0 )
|
||||
{
|
||||
opt.serialize = atoi( q );
|
||||
if( opt.serialize < 0 || opt.serialize > 1)
|
||||
goto usage;
|
||||
}
|
||||
else
|
||||
goto usage;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user