diff options
author | Matt Caswell <matt@openssl.org> | 2017-01-13 17:00:49 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-01-30 10:18:19 +0000 |
commit | ec15acb6bc554b8f87a519c3519f5bf4d367ded9 (patch) | |
tree | ca7810034fa64bb1218a04b3d4c22741bc166667 /test/tls13secretstest.c | |
parent | a2b7e65526d92123f143cc7f248b4ac017372faf (diff) |
Construct the client side psk extension for TLSv1.3
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2259)
Diffstat (limited to 'test/tls13secretstest.c')
-rw-r--r-- | test/tls13secretstest.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/tls13secretstest.c b/test/tls13secretstest.c index 68ebb9b8a7..69b85b820e 100644 --- a/test/tls13secretstest.c +++ b/test/tls13secretstest.c @@ -196,13 +196,14 @@ static int test_secret(SSL *s, unsigned char *prk, unsigned char hash[EVP_MAX_MD_SIZE]; unsigned char key[KEYLEN]; unsigned char iv[IVLEN]; + const EVP_MD *md = ssl_handshake_md(s); if (!ssl_handshake_hash(s, hash, sizeof(hash), &hashsize)) { fprintf(stderr, "Failed to get hash\n"); return 0; } - if (!tls13_hkdf_expand(s, prk, label, labellen, hash, gensecret, + if (!tls13_hkdf_expand(s, md, prk, label, labellen, hash, gensecret, hashsize)) { fprintf(stderr, "Secret generation failed\n"); return 0; @@ -253,7 +254,12 @@ static int test_handshake_secrets(void) if (s == NULL) goto err; - if (!tls13_generate_early_secret(s, NULL, 0)) { + s->session = SSL_SESSION_new(); + if (s->session == NULL) + goto err; + + if (!tls13_generate_secret(s, ssl_handshake_md(s), NULL, NULL, 0, + (unsigned char *)&s->early_secret)) { fprintf(stderr, "Early secret generation failed\n"); goto err; } |