summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTimo Schulz <twoaday@gnutls.org>2002-11-03 12:30:04 +0000
committerTimo Schulz <twoaday@gnutls.org>2002-11-03 12:30:04 +0000
commitd3b3fe228981b9f3efe677ae27aa91c3f5d4e22c (patch)
tree47f0b0cf309efc17d96dd45023dcfe8792a49816 /tests
parentc4ecc40b02de33a21da4e1ba81e118a5c24852a2 (diff)
downloadgnutls-d3b3fe228981b9f3efe677ae27aa91c3f5d4e22c.tar.gz
Bug fix for the OpenPGP secret key order.
Diffstat (limited to 'tests')
-rw-r--r--tests/openpgp_test.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/openpgp_test.c b/tests/openpgp_test.c
index 83a8cc1ab0..b61a6a7348 100644
--- a/tests/openpgp_test.c
+++ b/tests/openpgp_test.c
@@ -45,6 +45,7 @@ main( int argc, char ** argv )
gnutls_datum dat, xml, pk;
gnutls_openpgp_name uid;
gnutls_private_key * pkey;
+ gnutls_cert * cert;
unsigned char fpr[20], keyid[8];
char *s, *t;
size_t fprlen = 0;
@@ -90,7 +91,17 @@ main( int argc, char ** argv )
assert( rc == 0 );
for( i = 0; i < 8; i++ )
printf( "%02X", keyid[i] );
- printf( "\n" );
+ printf( "\n\n" );
+
+ printf( "Check MPIs\n" );
+ cert = ctx->cert_list[0];
+ printf( "number of certs %d\n", *ctx->cert_list_length );
+ assert( *ctx->cert_list_length == 1 );
+ printf( "number of items %d\n", cert->params_size );
+ for( i = 0; i < cert->params_size; i++ ) {
+ nbits = gcry_mpi_get_nbits( cert->params[i] );
+ printf( "mpi %d %d bits\n", i, nbits );
+ }
printf( "\nCheck key\n" );
rc = gnutls_openpgp_verify_key( NULL, &ctx->keyring, &dat, 1 );
@@ -102,8 +113,9 @@ main( int argc, char ** argv )
assert( pkey->params_size );
nbits = gcry_mpi_get_nbits( pkey->params[0] );
rc = pkey->pk_algorithm;
- printf ("pk-algorithm %s %d bits\n", get_pkalgo( rc ), nbits );
- for( i = 1; i < pkey->params_size; i++ ) {
+ printf( "pk-algorithm %s %d bits\n", get_pkalgo( rc ), nbits );
+ printf( "number of items %d\n", pkey->params_size );
+ for( i = 0; i < pkey->params_size; i++ ) {
nbits = gcry_mpi_get_nbits( pkey->params[i] );
printf( "mpi %d %d bits\n", i, nbits );
}