diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-05-31 08:55:54 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-05-31 14:50:22 +0200 |
commit | dbbbb05cbe9f09e1ac6a700761988095ee428c11 (patch) | |
tree | 69e279791460e645eaa085988c9f8239333fc64a /tests/common-key-tests.h | |
parent | 008c1cf31bca12db9b33827b93d14b1b87da7c67 (diff) | |
download | gnutls-dbbbb05cbe9f09e1ac6a700761988095ee428c11.tar.gz |
tests: combined tables of sign-verify teststmp-rsa-pss-round-two
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'tests/common-key-tests.h')
-rw-r--r-- | tests/common-key-tests.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/tests/common-key-tests.h b/tests/common-key-tests.h new file mode 100644 index 0000000000..464d73353c --- /dev/null +++ b/tests/common-key-tests.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2017 Red Hat Inc. + * + * Author: Nikos Mavrogiannopoulos + * + * This file is part of GnuTLS. + * + * GnuTLS is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * GnuTLS is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GnuTLS; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "cert-common.h" + +#include <gnutls/abstract.h> + +struct _key_tests_st { + const char *name; + gnutls_datum_t key; + gnutls_datum_t cert; + gnutls_pk_algorithm_t pk; + unsigned digest; + unsigned sigalgo; + unsigned sign_flags; +}; + +static const +struct _key_tests_st common_key_tests[] = { + { + .name = "rsa key", + .cert = {(void *) cli_ca3_cert_pem, sizeof(cli_ca3_cert_pem)-1}, + .key = {(void *) cli_ca3_key_pem, sizeof(cli_ca3_key_pem)-1}, + .pk = GNUTLS_PK_RSA, + .digest = GNUTLS_DIG_SHA256, + .sigalgo = GNUTLS_SIGN_RSA_SHA256 + }, + { + .name = "dsa key", + .key = {(void *) clidsa_ca3_key_pem, sizeof(clidsa_ca3_key_pem)-1}, + .cert = {(void *) clidsa_ca3_cert_pem, sizeof(clidsa_ca3_cert_pem)-1}, + .pk = GNUTLS_PK_DSA, + .digest = GNUTLS_DIG_SHA1, + .sigalgo = GNUTLS_SIGN_DSA_SHA1 + }, + { + .name = "ecdsa key", + .key = {(void *) server_ca3_ecc_key_pem, sizeof(server_ca3_ecc_key_pem)-1}, + .cert = {(void *) server_localhost_ca3_ecc_cert_pem, sizeof(server_localhost_ca3_ecc_cert_pem)-1}, + .pk = GNUTLS_PK_ECDSA, + .digest = GNUTLS_DIG_SHA256, + .sigalgo = GNUTLS_SIGN_ECDSA_SHA256 + }, + { + .name = "rsa pss key", + .key = {(void *) server_ca3_rsa_pss_key_pem, sizeof(server_ca3_rsa_pss_key_pem)-1}, + .cert = {(void *) server_ca3_rsa_pss_cert_pem, sizeof(server_ca3_rsa_pss_cert_pem)-1}, + .pk = GNUTLS_PK_RSA_PSS, + .digest = GNUTLS_DIG_SHA256, + .sign_flags = GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS, + .sigalgo = GNUTLS_SIGN_RSA_PSS_SHA256 + } +}; |