mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-02-19 00:39:46 +00:00
Introduced x509_crt_init(), x509_crl_init() and x509_csr_init()
This commit is contained in:
@@ -90,7 +90,7 @@ int main( int argc, char *argv[] )
|
||||
* 0. Initialize the RNG and the session data
|
||||
*/
|
||||
memset( &ssl, 0, sizeof( ssl_context ) );
|
||||
memset( &cacert, 0, sizeof( x509_cert ) );
|
||||
x509_crt_init( &cacert );
|
||||
|
||||
printf( "\n . Seeding the random number generator..." );
|
||||
fflush( stdout );
|
||||
|
||||
@@ -269,8 +269,8 @@ int main( int argc, char *argv[] )
|
||||
memset( &ssl, 0, sizeof( ssl_context ) );
|
||||
memset( &saved_session, 0, sizeof( ssl_session ) );
|
||||
#if defined(POLARSSL_X509_CRT_PARSE_C)
|
||||
memset( &cacert, 0, sizeof( x509_cert ) );
|
||||
memset( &clicert, 0, sizeof( x509_cert ) );
|
||||
x509_crt_init( &cacert );
|
||||
x509_crt_init( &clicert );
|
||||
pk_init( &pkey );
|
||||
#endif
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ int main( int argc, char *argv[] )
|
||||
printf( " . Loading the server cert. and key..." );
|
||||
fflush( stdout );
|
||||
|
||||
memset( &srvcert, 0, sizeof( x509_cert ) );
|
||||
x509_crt_init( &srvcert );
|
||||
|
||||
/*
|
||||
* This demonstration program uses embedded test certificates.
|
||||
|
||||
@@ -363,8 +363,8 @@ int main( int argc, char *argv[] )
|
||||
* Make sure memory references are valid.
|
||||
*/
|
||||
server_fd = 0;
|
||||
memset( &cacert, 0, sizeof( x509_cert ) );
|
||||
memset( &clicert, 0, sizeof( x509_cert ) );
|
||||
x509_crt_init( &cacert );
|
||||
x509_crt_init( &clicert );
|
||||
pk_init( &pkey );
|
||||
|
||||
if( argc == 0 )
|
||||
|
||||
@@ -114,7 +114,7 @@ int main( int argc, char *argv[] )
|
||||
printf( "\n . Loading the server cert. and key..." );
|
||||
fflush( stdout );
|
||||
|
||||
memset( &srvcert, 0, sizeof( x509_cert ) );
|
||||
x509_crt_init( &srvcert );
|
||||
|
||||
/*
|
||||
* This demonstration program uses embedded test certificates.
|
||||
|
||||
@@ -237,8 +237,8 @@ int main( int argc, char *argv[] )
|
||||
*/
|
||||
listen_fd = 0;
|
||||
#if defined(POLARSSL_X509_CRT_PARSE_C)
|
||||
memset( &cacert, 0, sizeof( x509_cert ) );
|
||||
memset( &srvcert, 0, sizeof( x509_cert ) );
|
||||
x509_crt_init( &cacert );
|
||||
x509_crt_init( &srvcert );
|
||||
pk_init( &pkey );
|
||||
#endif
|
||||
#if defined(POLARSSL_SSL_CACHE_C)
|
||||
|
||||
@@ -89,8 +89,8 @@ int main( int argc, char *argv[] )
|
||||
((void) argc);
|
||||
((void) argv);
|
||||
|
||||
memset( &cacert, 0, sizeof( x509_cert ) );
|
||||
memset( &crl, 0, sizeof( x509_crl ) );
|
||||
x509_crt_init( &cacert );
|
||||
x509_crl_init( &crl );
|
||||
|
||||
/*
|
||||
* 1.1. Load the trusted CA
|
||||
@@ -142,7 +142,7 @@ int main( int argc, char *argv[] )
|
||||
x509_cert clicert;
|
||||
pk_context pk;
|
||||
|
||||
memset( &clicert, 0, sizeof( x509_cert ) );
|
||||
x509_crt_init( &clicert );
|
||||
pk_init( &pk );
|
||||
|
||||
snprintf(name, 512, "ssl/test-ca/%s", client_certificates[i]);
|
||||
|
||||
@@ -187,7 +187,7 @@ static int ssl_test( struct options *opt )
|
||||
memset( read_state, 0, sizeof( read_state ) );
|
||||
memset( write_state, 0, sizeof( write_state ) );
|
||||
|
||||
memset( &srvcert, 0, sizeof( x509_cert ) );
|
||||
x509_crt_init( &srvcert );
|
||||
pk_init( &pkey );
|
||||
|
||||
if( opt->opmode == OPMODE_CLIENT )
|
||||
|
||||
@@ -168,8 +168,8 @@ int main( int argc, char *argv[] )
|
||||
* Set to sane values
|
||||
*/
|
||||
server_fd = 0;
|
||||
memset( &cacert, 0, sizeof( x509_cert ) );
|
||||
memset( &clicert, 0, sizeof( x509_cert ) );
|
||||
x509_crt_init( &cacert );
|
||||
x509_crt_init( &clicert );
|
||||
pk_init( &pkey );
|
||||
|
||||
if( argc == 0 )
|
||||
@@ -269,7 +269,7 @@ int main( int argc, char *argv[] )
|
||||
{
|
||||
x509_cert crt;
|
||||
x509_cert *cur = &crt;
|
||||
memset( &crt, 0, sizeof( x509_cert ) );
|
||||
x509_crt_init( &crt );
|
||||
|
||||
/*
|
||||
* 1.1. Load the certificate(s)
|
||||
|
||||
@@ -208,9 +208,9 @@ int main( int argc, char *argv[] )
|
||||
pk_init( &loaded_subject_key );
|
||||
mpi_init( &serial );
|
||||
#if defined(POLARSSL_X509_CSR_PARSE_C)
|
||||
memset( &csr, 0, sizeof(x509_csr) );
|
||||
x509_csr_init( &csr );
|
||||
#endif
|
||||
memset( &issuer_crt, 0, sizeof(x509_cert) );
|
||||
x509_crt_init( &issuer_crt );
|
||||
memset( buf, 0, 1024 );
|
||||
|
||||
if( argc == 0 )
|
||||
|
||||
@@ -76,7 +76,7 @@ int main( int argc, char *argv[] )
|
||||
/*
|
||||
* Set to sane values
|
||||
*/
|
||||
memset( &crl, 0, sizeof( x509_crl ) );
|
||||
x509_crl_init( &crl );
|
||||
|
||||
if( argc == 0 )
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ int main( int argc, char *argv[] )
|
||||
/*
|
||||
* Set to sane values
|
||||
*/
|
||||
memset( &csr, 0, sizeof( x509_csr ) );
|
||||
x509_csr_init( &csr );
|
||||
|
||||
if( argc == 0 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user