diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-09-29 11:58:25 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2018-02-19 15:29:35 +0100 |
commit | e648b681a7968b49b248330d41c0958b1ecab915 (patch) | |
tree | 18e78642dbc155cc277325235966e83090f04ed9 /tests/common-cert-key-exchange.h | |
parent | 74dd40a3a60840865a324cb5cb0aaf02c76b278a (diff) | |
download | gnutls-e648b681a7968b49b248330d41c0958b1ecab915.tar.gz |
tests: added unit test for hello retry request support
Resolves #285
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'tests/common-cert-key-exchange.h')
-rw-r--r-- | tests/common-cert-key-exchange.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/common-cert-key-exchange.h b/tests/common-cert-key-exchange.h index 8054447693..4c7d6c0ca9 100644 --- a/tests/common-cert-key-exchange.h +++ b/tests/common-cert-key-exchange.h @@ -35,10 +35,25 @@ extern const char *server_priority; try_with_key(name, client_prio, client_kx, server_sign_algo, client_sign_algo, \ &server_ca3_localhost_cert, &server_ca3_key, NULL, NULL, 0) +#define try_ks(name, client_prio, client_kx, group) \ + try_with_key_ks(name, client_prio, client_kx, GNUTLS_SIGN_RSA_PSS_SHA256, GNUTLS_SIGN_UNKNOWN, \ + &server_ca3_localhost_cert, &server_ca3_key, NULL, NULL, 0, group) + #define try_cli(name, client_prio, client_kx, server_sign_algo, client_sign_algo, client_cert) \ try_with_key(name, client_prio, client_kx, server_sign_algo, client_sign_algo, \ &server_ca3_localhost_cert, &server_ca3_key, &cli_ca3_cert, &cli_ca3_key, client_cert) +void try_with_key_ks(const char *name, const char *client_prio, gnutls_kx_algorithm_t client_kx, + gnutls_sign_algorithm_t server_sign_algo, + gnutls_sign_algorithm_t client_sign_algo, + const gnutls_datum_t *serv_cert, + const gnutls_datum_t *serv_key, + const gnutls_datum_t *cli_cert, + const gnutls_datum_t *cli_key, + unsigned client_cert, + unsigned exp_group); + +inline static void try_with_key(const char *name, const char *client_prio, gnutls_kx_algorithm_t client_kx, gnutls_sign_algorithm_t server_sign_algo, gnutls_sign_algorithm_t client_sign_algo, @@ -46,7 +61,11 @@ void try_with_key(const char *name, const char *client_prio, gnutls_kx_algorithm const gnutls_datum_t *serv_key, const gnutls_datum_t *cli_cert, const gnutls_datum_t *cli_key, - unsigned client_cert); + unsigned client_cert) +{ + return try_with_key_ks(name, client_prio, client_kx, server_sign_algo, client_sign_algo, + serv_cert, serv_key, cli_cert, cli_key, client_cert, 0); +} #define dtls_try(name, client_prio, client_kx, server_sign_algo, client_sign_algo) \ dtls_try_with_key(name, client_prio, client_kx, server_sign_algo, client_sign_algo, \ |