Commit ba4878aa authored by Manuel Pégourié-Gonnard's avatar Manuel Pégourié-Gonnard
Browse files

Rename x509parse_key & co with _rsa suffix

parent c8dc295e
......@@ -11,8 +11,8 @@
* \c x509parse_crtfile()).
* - X.509 certificate revocation list (CRL) reading (see \c x509parse_crl()
* and\c x509parse_crlfile()).
* - X.509 (RSA) private key reading (see \c x509parse_key() and
* \c x509parse_keyfile()).
* - X.509 (RSA) private key reading (see \c x509parse_key_rsa() and
* \c x509parse_keyfile_rsa()).
* - X.509 certificate signature verification (see \c x509parse_verify())
*
* This module can be used to build a certificate authority (CA) chain and
......
......@@ -427,9 +427,9 @@ int x509parse_crlfile( x509_crl *chain, const char *path );
*
* \return 0 if successful, or a specific X509 or PEM error code
*/
int x509parse_key( rsa_context *rsa,
const unsigned char *key, size_t keylen,
const unsigned char *pwd, size_t pwdlen );
int x509parse_key_rsa( rsa_context *rsa,
const unsigned char *key, size_t keylen,
const unsigned char *pwd, size_t pwdlen );
/** \ingroup x509_module */
/**
......@@ -441,8 +441,8 @@ int x509parse_key( rsa_context *rsa,
*
* \return 0 if successful, or a specific X509 or PEM error code
*/
int x509parse_keyfile( rsa_context *rsa, const char *path,
const char *password );
int x509parse_keyfile_rsa( rsa_context *rsa, const char *path,
const char *password );
/** \ingroup x509_module */
/**
......@@ -454,8 +454,8 @@ int x509parse_keyfile( rsa_context *rsa, const char *path,
*
* \return 0 if successful, or a specific X509 or PEM error code
*/
int x509parse_public_key( rsa_context *rsa,
const unsigned char *key, size_t keylen );
int x509parse_public_key_rsa( rsa_context *rsa,
const unsigned char *key, size_t keylen );
/** \ingroup x509_module */
/**
......@@ -466,7 +466,7 @@ int x509parse_public_key( rsa_context *rsa,
*
* \return 0 if successful, or a specific X509 or PEM error code
*/
int x509parse_public_keyfile( rsa_context *rsa, const char *path );
int x509parse_public_keyfile_rsa( rsa_context *rsa, const char *path );
/** \ingroup x509_module */
/**
......
......@@ -1945,7 +1945,7 @@ int x509parse_crlfile( x509_crl *chain, const char *path )
/*
* Load and parse a private RSA key
*/
int x509parse_keyfile( rsa_context *rsa, const char *path, const char *pwd )
int x509parse_keyfile_rsa( rsa_context *rsa, const char *path, const char *pwd )
{
int ret;
size_t n;
......@@ -1955,9 +1955,9 @@ int x509parse_keyfile( rsa_context *rsa, const char *path, const char *pwd )
return( ret );
if( pwd == NULL )
ret = x509parse_key( rsa, buf, n, NULL, 0 );
ret = x509parse_key_rsa( rsa, buf, n, NULL, 0 );
else
ret = x509parse_key( rsa, buf, n,
ret = x509parse_key_rsa( rsa, buf, n,
(const unsigned char *) pwd, strlen( pwd ) );
memset( buf, 0, n + 1 );
......@@ -1969,7 +1969,7 @@ int x509parse_keyfile( rsa_context *rsa, const char *path, const char *pwd )
/*
* Load and parse a public RSA key
*/
int x509parse_public_keyfile( rsa_context *rsa, const char *path )
int x509parse_public_keyfile_rsa( rsa_context *rsa, const char *path )
{
int ret;
size_t n;
......@@ -1978,7 +1978,7 @@ int x509parse_public_keyfile( rsa_context *rsa, const char *path )
if ( (ret = load_file( path, &buf, &n ) ) != 0 )
return( ret );
ret = x509parse_public_key( rsa, buf, n );
ret = x509parse_public_key_rsa( rsa, buf, n );
memset( buf, 0, n + 1 );
polarssl_free( buf );
......@@ -2258,8 +2258,9 @@ static int x509parse_key_pkcs8_encrypted_der(
/*
* Parse a private RSA key
*/
int x509parse_key( rsa_context *rsa, const unsigned char *key, size_t keylen,
const unsigned char *pwd, size_t pwdlen )
int x509parse_key_rsa( rsa_context *rsa,
const unsigned char *key, size_t keylen,
const unsigned char *pwd, size_t pwdlen )
{
int ret;
......@@ -2365,7 +2366,8 @@ int x509parse_key( rsa_context *rsa, const unsigned char *key, size_t keylen,
/*
* Parse a public RSA key
*/
int x509parse_public_key( rsa_context *rsa, const unsigned char *key, size_t keylen )
int x509parse_public_key_rsa( rsa_context *rsa,
const unsigned char *key, size_t keylen )
{
int ret;
size_t len;
......@@ -3562,7 +3564,7 @@ int x509_self_test( int verbose )
rsa_init( &rsa, RSA_PKCS_V15, 0 );
if( ( ret = x509parse_key( &rsa,
if( ( ret = x509parse_key_rsa( &rsa,
(const unsigned char *) test_ca_key, i,
(const unsigned char *) test_ca_pwd, j ) ) != 0 )
{
......
......@@ -164,14 +164,14 @@ int main( int argc, char *argv[] )
printf( "\n . Loading the private key ..." );
fflush( stdout );
ret = x509parse_keyfile( &rsa, opt.filename, opt.password );
ret = x509parse_keyfile_rsa( &rsa, opt.filename, opt.password );
if( ret != 0 )
{
#ifdef POLARSSL_ERROR_C
polarssl_strerror( ret, buf, 1024 );
#endif
printf( " failed\n ! x509parse_key returned %d - %s\n\n", ret, buf );
printf( " failed\n ! x509parse_key_rsa returned %d - %s\n\n", ret, buf );
rsa_free( &rsa );
goto exit;
}
......@@ -199,14 +199,14 @@ int main( int argc, char *argv[] )
printf( "\n . Loading the public key ..." );
fflush( stdout );
ret = x509parse_public_keyfile( &rsa, opt.filename );
ret = x509parse_public_keyfile_rsa( &rsa, opt.filename );
if( ret != 0 )
{
#ifdef POLARSSL_ERROR_C
polarssl_strerror( ret, buf, 1024 );
#endif
printf( " failed\n ! x509parse_public_key returned %d - %s\n\n", ret, buf );
printf( " failed\n ! x509parse_public_key_rsa returned %d - %s\n\n", ret, buf );
rsa_free( &rsa );
goto exit;
}
......
......@@ -238,14 +238,14 @@ int main( int argc, char *argv[] )
printf( "\n . Loading the private key ..." );
fflush( stdout );
ret = x509parse_keyfile( &rsa, opt.filename, NULL );
ret = x509parse_keyfile_rsa( &rsa, opt.filename, NULL );
if( ret != 0 )
{
#ifdef POLARSSL_ERROR_C
polarssl_strerror( ret, buf, 1024 );
#endif
printf( " failed\n ! x509parse_key returned %d - %s\n\n", ret, buf );
printf( " failed\n ! x509parse_key_rsa returned %d - %s\n\n", ret, buf );
rsa_free( &rsa );
goto exit;
}
......@@ -274,14 +274,14 @@ int main( int argc, char *argv[] )
printf( "\n . Loading the public key ..." );
fflush( stdout );
ret = x509parse_public_keyfile( &rsa, opt.filename );
ret = x509parse_public_keyfile_rsa( &rsa, opt.filename );
if( ret != 0 )
{
#ifdef POLARSSL_ERROR_C
polarssl_strerror( ret, buf, 1024 );
#endif
printf( " failed\n ! x509parse_public_key returned %d - %s\n\n", ret, buf );
printf( " failed\n ! x509parse_public_key_rsa returned %d - %s\n\n", ret, buf );
rsa_free( &rsa );
goto exit;
}
......
......@@ -101,7 +101,7 @@ int main( int argc, char *argv[] )
rsa_init( &rsa, RSA_PKCS_V21, POLARSSL_MD_SHA1 );
if( ( ret = x509parse_keyfile( &rsa, argv[1], "" ) ) != 0 )
if( ( ret = x509parse_keyfile_rsa( &rsa, argv[1], "" ) ) != 0 )
{
ret = 1;
printf( " failed\n ! Could not open '%s'\n", argv[1] );
......
......@@ -83,9 +83,9 @@ int main( int argc, char *argv[] )
rsa_init( &rsa, RSA_PKCS_V21, POLARSSL_MD_SHA1 );
if( ( ret = x509parse_public_keyfile( &rsa, argv[1] ) ) != 0 )
if( ( ret = x509parse_public_keyfile_rsa( &rsa, argv[1] ) ) != 0 )
{
printf( " failed\n ! x509parse_public_key returned %d\n\n", ret );
printf( " failed\n ! x509parse_public_key_rsa returned %d\n\n", ret );
goto exit;
}
......
......@@ -533,11 +533,11 @@ int main( int argc, char *argv[] )
#if defined(POLARSSL_FS_IO)
if( strlen( opt.key_file ) )
ret = x509parse_keyfile( &rsa, opt.key_file, "" );
ret = x509parse_keyfile_rsa( &rsa, opt.key_file, "" );
else
#endif
#if defined(POLARSSL_CERTS_C)
ret = x509parse_key( &rsa, (const unsigned char *) test_cli_key,
ret = x509parse_key_rsa( &rsa, (const unsigned char *) test_cli_key,
strlen( test_cli_key ), NULL, 0 );
#else
{
......@@ -547,7 +547,7 @@ int main( int argc, char *argv[] )
#endif
if( ret != 0 )
{
printf( " failed\n ! x509parse_key returned -0x%x\n\n", -ret );
printf( " failed\n ! x509parse_key_rsa returned -0x%x\n\n", -ret );
goto exit;
}
......
......@@ -139,7 +139,7 @@ int main( int argc, char *argv[] )
/*
* This demonstration program uses embedded test certificates.
* Instead, you may want to use x509parse_crtfile() to read the
* server and CA certificates, as well as x509parse_keyfile().
* server and CA certificates, as well as x509parse_keyfile_rsa().
*/
ret = x509parse_crt( &srvcert, (const unsigned char *) test_srv_crt,
strlen( test_srv_crt ) );
......@@ -158,11 +158,11 @@ int main( int argc, char *argv[] )
}
rsa_init( &rsa, RSA_PKCS_V15, 0 );
ret = x509parse_key( &rsa, (const unsigned char *) test_srv_key,
ret = x509parse_key_rsa( &rsa, (const unsigned char *) test_srv_key,
strlen( test_srv_key ), NULL, 0 );
if( ret != 0 )
{
printf( " failed\n ! x509parse_key returned %d\n\n", ret );
printf( " failed\n ! x509parse_key_rsa returned %d\n\n", ret );
goto exit;
}
......
......@@ -532,11 +532,11 @@ int main( int argc, char *argv[] )
#if defined(POLARSSL_FS_IO)
if( strlen( opt.key_file ) )
ret = x509parse_keyfile( &rsa, opt.key_file, "" );
ret = x509parse_keyfile_rsa( &rsa, opt.key_file, "" );
else
#endif
#if defined(POLARSSL_CERTS_C)
ret = x509parse_key( &rsa, (const unsigned char *) test_cli_key,
ret = x509parse_key_rsa( &rsa, (const unsigned char *) test_cli_key,
strlen( test_cli_key ), NULL, 0 );
#else
{
......@@ -546,7 +546,7 @@ int main( int argc, char *argv[] )
#endif
if( ret != 0 )
{
printf( " failed\n ! x509parse_key returned %d\n\n", ret );
printf( " failed\n ! x509parse_key_rsa returned %d\n\n", ret );
goto exit;
}
......
......@@ -117,7 +117,7 @@ int main( int argc, char *argv[] )
/*
* This demonstration program uses embedded test certificates.
* Instead, you may want to use x509parse_crtfile() to read the
* server and CA certificates, as well as x509parse_keyfile().
* server and CA certificates, as well as x509parse_keyfile_rsa().
*/
ret = x509parse_crt( &srvcert, (const unsigned char *) test_srv_crt,
strlen( test_srv_crt ) );
......@@ -136,11 +136,11 @@ int main( int argc, char *argv[] )
}
rsa_init( &rsa, RSA_PKCS_V15, 0 );
ret = x509parse_key( &rsa, (const unsigned char *) test_srv_key,
ret = x509parse_key_rsa( &rsa, (const unsigned char *) test_srv_key,
strlen( test_srv_key ), NULL, 0 );
if( ret != 0 )
{
printf( " failed\n ! x509parse_key returned %d\n\n", ret );
printf( " failed\n ! x509parse_key_rsa returned %d\n\n", ret );
goto exit;
}
......
......@@ -501,11 +501,11 @@ int main( int argc, char *argv[] )
#if defined(POLARSSL_FS_IO)
if( strlen( opt.key_file ) )
ret = x509parse_keyfile( &rsa, opt.key_file, "" );
ret = x509parse_keyfile_rsa( &rsa, opt.key_file, "" );
else
#endif
#if defined(POLARSSL_CERTS_C)
ret = x509parse_key( &rsa, (const unsigned char *) test_srv_key,
ret = x509parse_key_rsa( &rsa, (const unsigned char *) test_srv_key,
strlen( test_srv_key ), NULL, 0 );
#else
{
......@@ -515,7 +515,7 @@ int main( int argc, char *argv[] )
#endif
if( ret != 0 )
{
printf( " failed\n ! x509parse_key returned -0x%x\n\n", -ret );
printf( " failed\n ! x509parse_key_rsa returned -0x%x\n\n", -ret );
goto exit;
}
......
......@@ -104,7 +104,7 @@ int main( int argc, char *argv[] )
fflush( stdout );
rsa_init( &p_rsa, RSA_PKCS_V15, 0 );
if( x509parse_keyfile( &p_rsa, argv[1], NULL ) != 0 )
if( x509parse_keyfile_rsa( &p_rsa, argv[1], NULL ) != 0 )
{
ret = 1;
printf( " failed\n ! Could not load key.\n\n" );
......
......@@ -196,10 +196,10 @@ int main( int argc, char *argv[] )
printf( " . Loading the client private key %s...", name );
fflush( stdout );
ret = x509parse_keyfile( &rsa, name, NULL );
ret = x509parse_keyfile_rsa( &rsa, name, NULL );
if( ret != 0 )
{
printf( " failed\n ! x509parse_key returned %d\n\n", ret );
printf( " failed\n ! x509parse_key_rsa returned %d\n\n", ret );
goto exit;
}
......
......@@ -229,11 +229,11 @@ static int ssl_test( struct options *opt )
goto exit;
}
ret = x509parse_key( &rsa, (const unsigned char *) test_srv_key,
ret = x509parse_key_rsa( &rsa, (const unsigned char *) test_srv_key,
strlen( test_srv_key ), NULL, 0 );
if( ret != 0 )
{
printf( " ! x509parse_key returned %d\n\n", ret );
printf( " ! x509parse_key_rsa returned %d\n\n", ret );
goto exit;
}
#endif
......
......@@ -267,14 +267,14 @@ int main( int argc, char *argv[] )
printf( "\n . Loading the private key ..." );
fflush( stdout );
ret = x509parse_keyfile( &rsa, opt.filename, NULL );
ret = x509parse_keyfile_rsa( &rsa, opt.filename, NULL );
if( ret != 0 )
{
#ifdef POLARSSL_ERROR_C
error_strerror( ret, buf, 1024 );
#endif
printf( " failed\n ! x509parse_key returned %d - %s\n\n", ret, buf );
printf( " failed\n ! x509parse_key_rsa returned %d - %s\n\n", ret, buf );
rsa_free( &rsa );
goto exit;
}
......
......@@ -78,113 +78,113 @@ X509 CRL Information SHA512 Digest
depends_on:POLARSSL_PEM_C:POLARSSL_FS_IO
x509_crl_info:"data_files/crl_sha512.pem":"CRL version \: 1\nissuer name \: C=NL, O=PolarSSL, CN=PolarSSL Test CA\nthis update \: 2011-02-12 14\:44\:07\nnext update \: 2011-04-13 14\:44\:07\nRevoked certificates\:\nserial number\: 01 revocation date\: 2011-02-12 14\:44\:07\nserial number\: 03 revocation date\: 2011-02-12 14\:44\:07\nsigned using \: RSA with SHA-512\n"
X509 Parse Key #1 (No password when required)
X509 Parse RSA Key #1 (No password when required)
depends_on:POLARSSL_MD5_C:POLARSSL_PEM_C:POLARSSL_FS_IO
x509parse_keyfile:"data_files/test-ca.key":NULL:POLARSSL_ERR_X509_PASSWORD_REQUIRED
x509parse_keyfile_rsa:"data_files/test-ca.key":NULL:POLARSSL_ERR_X509_PASSWORD_REQUIRED
X509 Parse Key #2 (Correct password)
X509 Parse RSA Key #2 (Correct password)
depends_on:POLARSSL_MD5_C:POLARSSL_PEM_C:POLARSSL_FS_IO
x509parse_keyfile:"data_files/test-ca.key":"PolarSSLTest":0
x509parse_keyfile_rsa:"data_files/test-ca.key":"PolarSSLTest":0
X509 Parse Key #3 (Wrong password)
X509 Parse RSA Key #3 (Wrong password)
depends_on:POLARSSL_MD5_C:POLARSSL_PEM_C:POLARSSL_FS_IO
x509parse_keyfile:"data_files/test-ca.key":"PolarSSLWRONG":POLARSSL_ERR_X509_PASSWORD_MISMATCH
x509parse_keyfile_rsa:"data_files/test-ca.key":"PolarSSLWRONG":POLARSSL_ERR_X509_PASSWORD_MISMATCH
X509 Parse Key #4 (DES Encrypted)
X509 Parse RSA Key #4 (DES Encrypted)
depends_on:POLARSSL_MD5_C:POLARSSL_DES_C:POLARSSL_PEM_C:POLARSSL_FS_IO
x509parse_keyfile:"data_files/keyfile.des":"testkey":0
x509parse_keyfile_rsa:"data_files/keyfile.des":"testkey":0
X509 Parse Key #5 (3DES Encrypted)
X509 Parse RSA Key #5 (3DES Encrypted)
depends_on:POLARSSL_MD5_C:POLARSSL_DES_C:POLARSSL_PEM_C:POLARSSL_FS_IO
x509parse_keyfile:"data_files/keyfile.3des":"testkey":0
x509parse_keyfile_rsa:"data_files/keyfile.3des":"testkey":0
X509 Parse Key #6 (AES-128 Encrypted)
X509 Parse RSA Key #6 (AES-128 Encrypted)
depends_on:POLARSSL_MD5_C:POLARSSL_AES_C:POLARSSL_PEM_C:POLARSSL_FS_IO
x509parse_keyfile:"data_files/keyfile.aes128":"testkey":0
x509parse_keyfile_rsa:"data_files/keyfile.aes128":"testkey":0
X509 Parse Key #7 (AES-192 Encrypted)
X509 Parse RSA Key #7 (AES-192 Encrypted)
depends_on:POLARSSL_MD5_C:POLARSSL_AES_C:POLARSSL_PEM_C:POLARSSL_FS_IO
x509parse_keyfile:"data_files/keyfile.aes192":"testkey":0
x509parse_keyfile_rsa:"data_files/keyfile.aes192":"testkey":0
X509 Parse Key #8 (AES-256 Encrypted)
X509 Parse RSA Key #8 (AES-256 Encrypted)
depends_on:POLARSSL_MD5_C:POLARSSL_AES_C:POLARSSL_PEM_C:POLARSSL_FS_IO
x509parse_keyfile:"data_files/keyfile.aes256":"testkey":0
x509parse_keyfile_rsa:"data_files/keyfile.aes256":"testkey":0
X509 Parse Key #9 (PKCS#8 wrapped)
X509 Parse RSA Key #9 (PKCS#8 wrapped)
depends_on:POLARSSL_MD5_C:POLARSSL_PEM_C:POLARSSL_FS_IO
x509parse_keyfile:"data_files/format_gen.key":"":0
x509parse_keyfile_rsa:"data_files/format_gen.key":"":0
X509 Parse Key #10 (PKCS#8 encrypted SHA1-3DES)
X509 Parse RSA Key #10 (PKCS#8 encrypted SHA1-3DES)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS12_C
x509parse_keyfile:"data_files/pkcs8_pbe_sha1_3des.key":"PolarSSLTest":0
x509parse_keyfile_rsa:"data_files/pkcs8_pbe_sha1_3des.key":"PolarSSLTest":0
X509 Parse Key #10.1 (PKCS#8 encrypted SHA1-3DES, wrong PW)
X509 Parse RSA Key #10.1 (PKCS#8 encrypted SHA1-3DES, wrong PW)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS12_C
x509parse_keyfile:"data_files/pkcs8_pbe_sha1_3des.key":"PolarSSLTes":POLARSSL_ERR_X509_PASSWORD_MISMATCH
x509parse_keyfile_rsa:"data_files/pkcs8_pbe_sha1_3des.key":"PolarSSLTes":POLARSSL_ERR_X509_PASSWORD_MISMATCH
X509 Parse Key #10.2 (PKCS#8 encrypted SHA1-3DES, no PW)
X509 Parse RSA Key #10.2 (PKCS#8 encrypted SHA1-3DES, no PW)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS12_C
x509parse_keyfile:"data_files/pkcs8_pbe_sha1_3des.key":"":POLARSSL_ERR_X509_PASSWORD_REQUIRED
x509parse_keyfile_rsa:"data_files/pkcs8_pbe_sha1_3des.key":"":POLARSSL_ERR_X509_PASSWORD_REQUIRED
X509 Parse Key #11 (PKCS#8 encrypted SHA1-3DES DER)
X509 Parse RSA Key #11 (PKCS#8 encrypted SHA1-3DES DER)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_FS_IO:POLARSSL_PKCS12_C
x509parse_keyfile:"data_files/pkcs8_pbe_sha1_3des.der":"PolarSSLTest":0
x509parse_keyfile_rsa:"data_files/pkcs8_pbe_sha1_3des.der":"PolarSSLTest":0
X509 Parse Key #12 (PKCS#8 encrypted SHA1-2DES)
X509 Parse RSA Key #12 (PKCS#8 encrypted SHA1-2DES)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS12_C
x509parse_keyfile:"data_files/pkcs8_pbe_sha1_2des.key":"PolarSSLTest":0
x509parse_keyfile_rsa:"data_files/pkcs8_pbe_sha1_2des.key":"PolarSSLTest":0
X509 Parse Key #12.1 (PKCS#8 encrypted SHA1-2DES, wrong PW)
X509 Parse RSA Key #12.1 (PKCS#8 encrypted SHA1-2DES, wrong PW)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS12_C
x509parse_keyfile:"data_files/pkcs8_pbe_sha1_2des.key":"PolarSLTest":POLARSSL_ERR_X509_PASSWORD_MISMATCH
x509parse_keyfile_rsa:"data_files/pkcs8_pbe_sha1_2des.key":"PolarSLTest":POLARSSL_ERR_X509_PASSWORD_MISMATCH
X509 Parse Key #12.2 (PKCS#8 encrypted SHA1-2DES, no PW)
X509 Parse RSA Key #12.2 (PKCS#8 encrypted SHA1-2DES, no PW)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS12_C
x509parse_keyfile:"data_files/pkcs8_pbe_sha1_2des.key":"":POLARSSL_ERR_X509_PASSWORD_REQUIRED
x509parse_keyfile_rsa:"data_files/pkcs8_pbe_sha1_2des.key":"":POLARSSL_ERR_X509_PASSWORD_REQUIRED
X509 Parse Key #13 (PKCS#8 encrypted SHA1-RC4-128)
X509 Parse RSA Key #13 (PKCS#8 encrypted SHA1-RC4-128)
depends_on:POLARSSL_ARC4_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS12_C
x509parse_keyfile:"data_files/pkcs8_pbe_sha1_rc4_128.key":"PolarSSLTest":0
x509parse_keyfile_rsa:"data_files/pkcs8_pbe_sha1_rc4_128.key":"PolarSSLTest":0
X509 Parse Key #13.1 (PKCS#8 encrypted SHA1-RC4-128, wrong PW)
X509 Parse RSA Key #13.1 (PKCS#8 encrypted SHA1-RC4-128, wrong PW)
depends_on:POLARSSL_ARC4_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS12_C
x509parse_keyfile:"data_files/pkcs8_pbe_sha1_rc4_128.key":"PolarSSLTe":POLARSSL_ERR_X509_PASSWORD_MISMATCH
x509parse_keyfile_rsa:"data_files/pkcs8_pbe_sha1_rc4_128.key":"PolarSSLTe":POLARSSL_ERR_X509_PASSWORD_MISMATCH
X509 Parse Key #13.2 (PKCS#8 encrypted SHA1-RC4-128, no PW)
X509 Parse RSA Key #13.2 (PKCS#8 encrypted SHA1-RC4-128, no PW)
depends_on:POLARSSL_ARC4_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS12_C
x509parse_keyfile:"data_files/pkcs8_pbe_sha1_rc4_128.key":"":POLARSSL_ERR_X509_PASSWORD_REQUIRED
x509parse_keyfile_rsa:"data_files/pkcs8_pbe_sha1_rc4_128.key":"":POLARSSL_ERR_X509_PASSWORD_REQUIRED
X509 Parse Key #14 (PKCS#8 encrypted v2 PBDFK2 3DES)
X509 Parse RSA Key #14 (PKCS#8 encrypted v2 PBDFK2 3DES)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS5_C
x509parse_keyfile:"data_files/pkcs8_pbes2_pbkdf2_3des.key":"PolarSSLTest":0
x509parse_keyfile_rsa:"data_files/pkcs8_pbes2_pbkdf2_3des.key":"PolarSSLTest":0
X509 Parse Key #15 (PKCS#8 encrypted v2 PBDFK2 3DES, wrong PW)
X509 Parse RSA Key #15 (PKCS#8 encrypted v2 PBDFK2 3DES, wrong PW)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS5_C
x509parse_keyfile:"data_files/pkcs8_pbes2_pbkdf2_3des.key":"PolarSSLTes":POLARSSL_ERR_X509_PASSWORD_MISMATCH
x509parse_keyfile_rsa:"data_files/pkcs8_pbes2_pbkdf2_3des.key":"PolarSSLTes":POLARSSL_ERR_X509_PASSWORD_MISMATCH
X509 Parse Key #16 (PKCS#8 encrypted v2 PBDFK2 3DES, no PW)
X509 Parse RSA Key #16 (PKCS#8 encrypted v2 PBDFK2 3DES, no PW)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS5_C
x509parse_keyfile:"data_files/pkcs8_pbes2_pbkdf2_3des.key":"":POLARSSL_ERR_X509_PASSWORD_REQUIRED
x509parse_keyfile_rsa:"data_files/pkcs8_pbes2_pbkdf2_3des.key":"":POLARSSL_ERR_X509_PASSWORD_REQUIRED
X509 Parse Key #17 (PKCS#8 encrypted v2 PBDFK2 3DES DER)
X509 Parse RSA Key #17 (PKCS#8 encrypted v2 PBDFK2 3DES DER)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_FS_IO:POLARSSL_PKCS5_C
x509parse_keyfile:"data_files/pkcs8_pbes2_pbkdf2_3des.der":"PolarSSLTest":0
x509parse_keyfile_rsa:"data_files/pkcs8_pbes2_pbkdf2_3des.der":"PolarSSLTest":0
X509 Parse Key #18 (PKCS#8 encrypted v2 PBDFK2 3DES DER, wrong PW)
X509 Parse RSA Key #18 (PKCS#8 encrypted v2 PBDFK2 3DES DER, wrong PW)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_FS_IO:POLARSSL_PKCS5_C
x509parse_keyfile:"data_files/pkcs8_pbes2_pbkdf2_3des.der":"PolarSSLTes":POLARSSL_ERR_X509_PASSWORD_MISMATCH
x509parse_keyfile_rsa:"data_files/pkcs8_pbes2_pbkdf2_3des.der":"PolarSSLTes":POLARSSL_ERR_X509_PASSWORD_MISMATCH
X509 Parse Key #19 (PKCS#8 encrypted v2 PBDFK2 3DES DER, no PW)
X509 Parse RSA Key #19 (PKCS#8 encrypted v2 PBDFK2 3DES DER, no PW)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_FS_IO:POLARSSL_PKCS5_C
x509parse_keyfile:"data_files/pkcs8_pbes2_pbkdf2_3des.der":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
x509parse_keyfile_rsa:"data_files/pkcs8_pbes2_pbkdf2_3des.der":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
X509 Parse Key #20 (PKCS#8 encrypted v2 PBDFK2 DES)
X509 Parse RSA Key #20 (PKCS#8 encrypted v2 PBDFK2 DES)
depends_on:POLARSSL_DES_C:POLARSSL_SHA1_C:POLARSSL_PEM_C:POLARSSL_FS_IO:POLARSSL_PKCS5_C
x509parse_keyfile:"data_files/pkcs8_pbes2_pbkdf2_des.key":"PolarSSLTest":0
x509parse_keyfile_rsa:"data_files/pkcs8_pbes2_pbkdf2_des.key":"PolarSSLTest":0
X509 Parse Public Key #1 (PKCS#8 wrapped)
X509 Parse Public RSA Key #1 (PKCS#8 wrapped)
depends_on:POLARSSL_MD5_C:POLARSSL_PEM_C:POLARSSL_FS_IO
x509parse_public_keyfile:"data_files/format_gen.pub":0
x509parse_public_keyfile_rsa:"data_files/format_gen.pub":0
X509 Get Distinguished Name #1
depends_on:POLARSSL_PEM_C:POLARSSL_FS_IO
......@@ -652,22 +652,22 @@ X509 CRL ASN1 (TBSCertList, no entries)
x509parse_crl:"30463031020100300d06092a864886f70d01010e0500300f310d300b0603550403130441424344170c303930313031303030303030300d06092a864886f70d01010e050003020001":"CRL version \: 1\nissuer name \: CN=ABCD\nthis update \: 2009-01-01 00\:00\:00\nnext update \: 0000-00-00 00\:00\:00\nRevoked certificates\:\nsigned using \: RSA with SHA-224\n":0
X509 Key ASN1 (Incorrect first tag)
x509parse_key:"":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
x509parse_key_rsa:"":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
X509 Key ASN1 (RSAPrivateKey, incorrect version tag)
x509parse_key:"300100":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
x509parse_key_rsa:"300100":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
X509 Key ASN1 (RSAPrivateKey, version tag missing)
x509parse_key:"3000":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
x509parse_key_rsa:"3000":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
X509 Key ASN1 (RSAPrivateKey, invalid version)
x509parse_key:"3003020101":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
x509parse_key_rsa:"3003020101":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
X509 Key ASN1 (RSAPrivateKey, correct version, incorrect tag)
x509parse_key:"300402010000":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
x509parse_key_rsa:"300402010000":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
X509 Key ASN1 (RSAPrivateKey, values present, length mismatch)
x509parse_key:"301c02010002010102010102010102010102010102010102010102010100":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
x509parse_key_rsa:"301c02010002010102010102010102010102010102010102010102010100":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
X509 Key ASN1 (RSAPrivateKey, values present, check_privkey fails)
x509parse_key:"301b020100020101020101020101020101020101020101020101020101":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
x509parse_key_rsa:"301b020100020101020101020101020101020101020101020101020101":"":POLARSSL_ERR_X509_KEY_INVALID_FORMAT
......@@ -138,14 +138,14 @@ x509_time_expired:crt_file:entity:result
END_CASE
BEGIN_CASE
x509parse_keyfile:key_file:password:result
x509parse_keyfile_rsa:key_file:password:result
{
rsa_context rsa;
int res;
memset( &rsa, 0, sizeof( rsa_context ) );
res = x509parse_keyfile( &rsa, {key_file}, {password} );
res = x509parse_keyfile_rsa( &rsa, {key_file}, {password} );
TEST_ASSERT( res == {result} );
......@@ -159,14 +159,14 @@ x509parse_keyfile:key_file:password:result
END_CASE
BEGIN_CASE
x509parse_public_keyfile:key_file:result
x509parse_public_keyfile_rsa:key_file:result
{
rsa_context rsa;
int res;
memset( &rsa, 0, sizeof( rsa_context ) );