Renamed x509parse_* functions to new form

e.g. x509parse_crtfile -> x509_crt_parse_file
This commit is contained in:
Paul Bakker 2013-09-18 13:46:23 +02:00
parent 369d2eb2a2
commit ddf26b4e38
26 changed files with 258 additions and 201 deletions

View file

@ -101,7 +101,7 @@ static int my_verify( void *data, x509_cert *crt, int depth, int *flags )
((void) data);
printf( "\nVerify requested for (Depth %d):\n", depth );
x509parse_cert_info( buf, sizeof( buf ) - 1, "", crt );
x509_crt_info( buf, sizeof( buf ) - 1, "", crt );
printf( "%s", buf );
if( ( (*flags) & BADCERT_EXPIRED ) != 0 )
@ -248,18 +248,18 @@ int main( int argc, char *argv[] )
if( strlen( opt.ca_path ) )
{
ret = x509parse_crtpath( &cacert, opt.ca_path );
ret = x509_crt_parse_path( &cacert, opt.ca_path );
verify = 1;
}
else if( strlen( opt.ca_file ) )
{
ret = x509parse_crtfile( &cacert, opt.ca_file );
ret = x509_crt_parse_file( &cacert, opt.ca_file );
verify = 1;
}
if( ret < 0 )
{
printf( " failed\n ! x509parse_crt returned -0x%x\n\n", -ret );
printf( " failed\n ! x509_crt_parse returned -0x%x\n\n", -ret );
goto exit;
}
@ -277,18 +277,18 @@ int main( int argc, char *argv[] )
printf( "\n . Loading the certificate(s) ..." );
fflush( stdout );
ret = x509parse_crtfile( &crt, opt.filename );
ret = x509_crt_parse_file( &crt, opt.filename );
if( ret < 0 )
{
printf( " failed\n ! x509parse_crt returned %d\n\n", ret );
printf( " failed\n ! x509_crt_parse_file returned %d\n\n", ret );
x509_crt_free( &crt );
goto exit;
}
if( opt.permissive == 0 && ret > 0 )
{
printf( " failed\n ! x509parse_crt failed to parse %d certificates\n\n", ret );
printf( " failed\n ! x509_crt_parse failed to parse %d certificates\n\n", ret );
x509_crt_free( &crt );
goto exit;
}
@ -301,10 +301,11 @@ int main( int argc, char *argv[] )
while( cur != NULL )
{
printf( " . Peer certificate information ...\n" );
ret = x509parse_cert_info( (char *) buf, sizeof( buf ) - 1, " ", cur );
ret = x509_crt_info( (char *) buf, sizeof( buf ) - 1, " ",
cur );
if( ret == -1 )
{
printf( " failed\n ! x509parse_cert_info returned %d\n\n", ret );
printf( " failed\n ! x509_crt_info returned %d\n\n", ret );
x509_crt_free( &crt );
goto exit;
}
@ -321,8 +322,8 @@ int main( int argc, char *argv[] )
{
printf( " . Verifying X.509 certificate..." );
if( ( ret = x509parse_verify( &crt, &cacert, NULL, NULL, &flags,
my_verify, NULL ) ) != 0 )
if( ( ret = x509_crt_verify( &crt, &cacert, NULL, NULL, &flags,
my_verify, NULL ) ) != 0 )
{
printf( " failed\n" );
@ -426,11 +427,11 @@ int main( int argc, char *argv[] )
* 5. Print the certificate
*/
printf( " . Peer certificate information ...\n" );
ret = x509parse_cert_info( (char *) buf, sizeof( buf ) - 1, " ",
ssl.session->peer_cert );
ret = x509_crt_info( (char *) buf, sizeof( buf ) - 1, " ",
ssl.session->peer_cert );
if( ret == -1 )
{
printf( " failed\n ! x509parse_cert_info returned %d\n\n", ret );
printf( " failed\n ! x509_crt_info returned %d\n\n", ret );
ssl_free( &ssl );
goto exit;
}

View file

@ -409,10 +409,10 @@ int main( int argc, char *argv[] )
printf( " . Loading the issuer certificate ..." );
fflush( stdout );
if( ( ret = x509parse_crtfile( &issuer_crt, opt.issuer_crt ) ) != 0 )
if( ( ret = x509_crt_parse_file( &issuer_crt, opt.issuer_crt ) ) != 0 )
{
error_strerror( ret, buf, 1024 );
printf( " failed\n ! x509parse_crtfile returned -0x%02x - %s\n\n", -ret, buf );
printf( " failed\n ! x509_crt_parse_file returned -0x%02x - %s\n\n", -ret, buf );
goto exit;
}
@ -441,10 +441,10 @@ int main( int argc, char *argv[] )
printf( " . Loading the certificate request ..." );
fflush( stdout );
if( ( ret = x509parse_csrfile( &csr, opt.request_file ) ) != 0 )
if( ( ret = x509_csr_parse_file( &csr, opt.request_file ) ) != 0 )
{
error_strerror( ret, buf, 1024 );
printf( " failed\n ! x509parse_csrfile returned -0x%02x - %s\n\n", -ret, buf );
printf( " failed\n ! x509_csr_parse_file returned -0x%02x - %s\n\n", -ret, buf );
goto exit;
}

View file

@ -114,11 +114,11 @@ int main( int argc, char *argv[] )
printf( "\n . Loading the CRL ..." );
fflush( stdout );
ret = x509parse_crlfile( &crl, opt.filename );
ret = x509_crl_parse_file( &crl, opt.filename );
if( ret != 0 )
{
printf( " failed\n ! x509parse_crl returned %d\n\n", ret );
printf( " failed\n ! x509_crl_parse_file returned %d\n\n", ret );
x509_crl_free( &crl );
goto exit;
}
@ -129,10 +129,10 @@ int main( int argc, char *argv[] )
* 1.2 Print the CRL
*/
printf( " . CRL information ...\n" );
ret = x509parse_crl_info( (char *) buf, sizeof( buf ) - 1, " ", &crl );
ret = x509_crl_info( (char *) buf, sizeof( buf ) - 1, " ", &crl );
if( ret == -1 )
{
printf( " failed\n ! x509parse_crl_info returned %d\n\n", ret );
printf( " failed\n ! x509_crl_info returned %d\n\n", ret );
x509_crl_free( &crl );
goto exit;
}

View file

@ -114,11 +114,11 @@ int main( int argc, char *argv[] )
printf( "\n . Loading the CSR ..." );
fflush( stdout );
ret = x509parse_csrfile( &csr, opt.filename );
ret = x509_csr_parse_file( &csr, opt.filename );
if( ret != 0 )
{
printf( " failed\n ! x509parse_csr returned %d\n\n", ret );
printf( " failed\n ! x509_csr_parse_file returned %d\n\n", ret );
x509_csr_free( &csr );
goto exit;
}
@ -129,10 +129,10 @@ int main( int argc, char *argv[] )
* 1.2 Print the CSR
*/
printf( " . CSR information ...\n" );
ret = x509parse_csr_info( (char *) buf, sizeof( buf ) - 1, " ", &csr );
ret = x509_csr_info( (char *) buf, sizeof( buf ) - 1, " ", &csr );
if( ret == -1 )
{
printf( " failed\n ! x509parse_csr_info returned %d\n\n", ret );
printf( " failed\n ! x509_csr_info returned %d\n\n", ret );
x509_csr_free( &csr );
goto exit;
}