diff options
author | Daiki Ueno <dueno@redhat.com> | 2020-02-17 16:13:35 +0100 |
---|---|---|
committer | Daiki Ueno <dueno@redhat.com> | 2020-02-17 17:51:43 +0100 |
commit | d5f0a8662e843bd3070f4d8653326a40ae9b7932 (patch) | |
tree | 60a2cb98e21c9c852c9ea71aeecf83487b61ab3b /tests/secret-hook.c | |
parent | 8ab75b3cf7130ad7594b68c6ecba79b6e0c082d9 (diff) | |
download | gnutls-d5f0a8662e843bd3070f4d8653326a40ae9b7932.tar.gz |
gnutls_session_set_secret_function: rename from gnutls_handshake_*tmp-rename-secret-hook
As some of the secrets can be used after the handshake is completed,
the gnutls_session_ namespace is more appropriate for the function.
The names of enum/callback are also shortened.
Signed-off-by: Daiki Ueno <dueno@redhat.com>
Diffstat (limited to 'tests/secret-hook.c')
-rw-r--r-- | tests/secret-hook.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/secret-hook.c b/tests/secret-hook.c index f4523a6a46..09da66ccda 100644 --- a/tests/secret-hook.c +++ b/tests/secret-hook.c @@ -73,7 +73,7 @@ static pid_t child; #define MSG "Hello TLS" static const char * -secret_type_to_str(gnutls_handshake_secret_type_t type) +secret_type_to_str(gnutls_secret_type_t type) { switch (type) { case GNUTLS_SECRET_CLIENT_RANDOM: @@ -99,11 +99,11 @@ secret_type_to_str(gnutls_handshake_secret_type_t type) static int secret_hook_func(gnutls_session_t session, - gnutls_handshake_secret_type_t type, + gnutls_secret_type_t type, const gnutls_datum_t *secret) { unsigned int *call_count = gnutls_session_get_ptr(session); - static const gnutls_handshake_secret_type_t exp_types[] = { + static const gnutls_secret_type_t exp_types[] = { GNUTLS_SECRET_CLIENT_HANDSHAKE_TRAFFIC_SECRET, GNUTLS_SECRET_SERVER_HANDSHAKE_TRAFFIC_SECRET, GNUTLS_SECRET_EXPORTER_SECRET, @@ -168,7 +168,7 @@ static void client(int fd, const char *prio, unsigned int exp_call_count) gnutls_transport_set_int(session, fd); - gnutls_handshake_set_secret_function(session, secret_hook_func); + gnutls_session_set_secret_function(session, secret_hook_func); /* Perform the TLS handshake */ @@ -279,7 +279,7 @@ static void server(int fd, const char *prio, unsigned int exp_call_count) gnutls_transport_set_int(session, fd); - gnutls_handshake_set_secret_function(session, secret_hook_func); + gnutls_session_set_secret_function(session, secret_hook_func); do { ret = gnutls_handshake(session); |