summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-10-05 11:13:24 +0200
committerDaiki Ueno <dueno@redhat.com>2018-11-11 07:03:43 +0100
commit53d28c0461465e800821f81a092e3d7e43f60fbc (patch)
tree1cc5458c5b810b104d29e5c13ac3ca2890732be9
parent907086568631afa552baf198496f364307de1220 (diff)
downloadgnutls-53d28c0461465e800821f81a092e3d7e43f60fbc.tar.gz
ext/pre_shared_key: use predefined macros for secret labels
Signed-off-by: Daiki Ueno <dueno@redhat.com>
-rw-r--r--lib/ext/pre_shared_key.c8
-rw-r--r--lib/handshake.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/ext/pre_shared_key.c b/lib/ext/pre_shared_key.c
index be18c264ff..7e4374042b 100644
--- a/lib/ext/pre_shared_key.c
+++ b/lib/ext/pre_shared_key.c
@@ -23,6 +23,7 @@
#include "gnutls_int.h"
#include "auth/psk.h"
+#include "handshake.h"
#include "secrets.h"
#include "tls13/psk_ext_parser.h"
#include "tls13/finished.h"
@@ -36,7 +37,6 @@ static int
compute_psk_from_ticket(const tls13_ticket_st *ticket, gnutls_datum_t *key)
{
int ret;
- char label[] = "resumption";
if (unlikely(ticket->prf == NULL || ticket->prf->output_size == 0))
return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
@@ -49,7 +49,7 @@ compute_psk_from_ticket(const tls13_ticket_st *ticket, gnutls_datum_t *key)
key->size = ticket->prf->output_size;
ret = _tls13_expand_secret2(ticket->prf,
- label, sizeof(label)-1,
+ RESUMPTION_LABEL, sizeof(RESUMPTION_LABEL)-1,
ticket->nonce, ticket->nonce_size,
ticket->resumption_master_secret,
key->size,
@@ -67,9 +67,9 @@ compute_binder_key(const mac_entry_st *prf,
void *out)
{
int ret;
- const char ext_label[] = "ext binder";
+ const char ext_label[] = EXT_BINDER_LABEL;
const size_t ext_label_len = sizeof(ext_label) - 1;
- const char res_label[] = "res binder";
+ const char res_label[] = RES_BINDER_LABEL;
const size_t res_label_len = sizeof(res_label) - 1;
const char *label = resuming ? res_label : ext_label;
size_t label_len = resuming ? res_label_len : ext_label_len;
diff --git a/lib/handshake.h b/lib/handshake.h
index ee5ee7a437..a82263aad1 100644
--- a/lib/handshake.h
+++ b/lib/handshake.h
@@ -159,7 +159,7 @@ int _gnutls_check_if_cert_hash_is_same(gnutls_session_t session, gnutls_certific
#define EXPORTER_MASTER_LABEL "exp master"
#define RMS_MASTER_LABEL "res master"
#define EXPORTER_LABEL "exp master"
-#define RES_LABEL "res master"
+#define RESUMPTION_LABEL "resumption"
int _gnutls_call_hook_func(gnutls_session_t session,
gnutls_handshake_description_t type,