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.c | |
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.c')
-rw-r--r-- | tests/common-cert-key-exchange.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/common-cert-key-exchange.c b/tests/common-cert-key-exchange.c index 586477ab29..ed79973bfe 100644 --- a/tests/common-cert-key-exchange.c +++ b/tests/common-cert-key-exchange.c @@ -49,14 +49,15 @@ static void tls_log_func(int level, const char *str) #define MSG "hello there ppl" -void try_with_key(const char *name, const char *client_prio, gnutls_kx_algorithm_t client_kx, +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 *client_cert, const gnutls_datum_t *client_key, - unsigned cert_flags) + unsigned cert_flags, + unsigned exp_group) { int ret; char buffer[256]; @@ -192,6 +193,18 @@ void try_with_key(const char *name, const char *client_prio, gnutls_kx_algorithm } } + if (exp_group != 0) { + ret = gnutls_group_get(server); + if (ret != (int)exp_group) { + fail("%s: got unexpected server group: %d/%s\n", name, ret, gnutls_group_get_name(ret)); + } + + ret = gnutls_group_get(client); + if (ret != (int)exp_group) { + fail("%s: got unexpected client group: %d/%s\n", name, ret, gnutls_group_get_name(ret)); + } + } + gnutls_record_send(server, MSG, strlen(MSG)); ret = gnutls_record_recv(client, buffer, sizeof(buffer)); |