summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_hash.c
diff options
context:
space:
mode:
authorjsing <>2019-02-09 15:26:15 +0000
committerjsing <>2019-02-09 15:26:15 +0000
commit6535bd837c4df935c9b8881180e8dd93a83530dc (patch)
treeccde70d521f0e94dd1570fd0a07f27a5b4ca631e /src/lib/libssl/t1_hash.c
parent420e1203852fc99e786ceb80cff5559b6be38fbf (diff)
downloadopenbsd-6535bd837c4df935c9b8881180e8dd93a83530dc.tar.gz
openbsd-6535bd837c4df935c9b8881180e8dd93a83530dc.tar.bz2
openbsd-6535bd837c4df935c9b8881180e8dd93a83530dc.zip
Rename tls1_handshake_hash*() to tls1_transcript_hash*().
While handshake hash is correct (in as far as it is a hash of handshake messages), using tls1_transcript_hash*() aligns them with the naming of the tls1_transcript*() functions. Additionally, the TLSv1.3 specification uses Transcript-Hash and "transcript hash", which this matches. ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/t1_hash.c')
-rw-r--r--src/lib/libssl/t1_hash.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libssl/t1_hash.c b/src/lib/libssl/t1_hash.c
index 50e0ad3ca0..12d66d4def 100644
--- a/src/lib/libssl/t1_hash.c
+++ b/src/lib/libssl/t1_hash.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t1_hash.c,v 1.5 2018/11/21 15:13:29 jsing Exp $ */ 1/* $OpenBSD: t1_hash.c,v 1.6 2019/02/09 15:26:15 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -20,13 +20,13 @@
20#include <openssl/ssl.h> 20#include <openssl/ssl.h>
21 21
22int 22int
23tls1_handshake_hash_init(SSL *s) 23tls1_transcript_hash_init(SSL *s)
24{ 24{
25 const unsigned char *data; 25 const unsigned char *data;
26 const EVP_MD *md; 26 const EVP_MD *md;
27 size_t len; 27 size_t len;
28 28
29 tls1_handshake_hash_free(s); 29 tls1_transcript_hash_free(s);
30 30
31 if (!ssl_get_handshake_evp_md(s, &md)) { 31 if (!ssl_get_handshake_evp_md(s, &md)) {
32 SSLerrorx(ERR_R_INTERNAL_ERROR); 32 SSLerrorx(ERR_R_INTERNAL_ERROR);
@@ -46,7 +46,7 @@ tls1_handshake_hash_init(SSL *s)
46 SSLerror(s, SSL_R_BAD_HANDSHAKE_LENGTH); 46 SSLerror(s, SSL_R_BAD_HANDSHAKE_LENGTH);
47 goto err; 47 goto err;
48 } 48 }
49 if (!tls1_handshake_hash_update(s, data, len)) { 49 if (!tls1_transcript_hash_update(s, data, len)) {
50 SSLerror(s, ERR_R_EVP_LIB); 50 SSLerror(s, ERR_R_EVP_LIB);
51 goto err; 51 goto err;
52 } 52 }
@@ -54,13 +54,13 @@ tls1_handshake_hash_init(SSL *s)
54 return 1; 54 return 1;
55 55
56 err: 56 err:
57 tls1_handshake_hash_free(s); 57 tls1_transcript_hash_free(s);
58 58
59 return 0; 59 return 0;
60} 60}
61 61
62int 62int
63tls1_handshake_hash_update(SSL *s, const unsigned char *buf, size_t len) 63tls1_transcript_hash_update(SSL *s, const unsigned char *buf, size_t len)
64{ 64{
65 if (S3I(s)->handshake_hash == NULL) 65 if (S3I(s)->handshake_hash == NULL)
66 return 1; 66 return 1;
@@ -69,7 +69,7 @@ tls1_handshake_hash_update(SSL *s, const unsigned char *buf, size_t len)
69} 69}
70 70
71int 71int
72tls1_handshake_hash_value(SSL *s, const unsigned char *out, size_t len, 72tls1_transcript_hash_value(SSL *s, const unsigned char *out, size_t len,
73 size_t *outlen) 73 size_t *outlen)
74{ 74{
75 EVP_MD_CTX *mdctx = NULL; 75 EVP_MD_CTX *mdctx = NULL;
@@ -103,7 +103,7 @@ tls1_handshake_hash_value(SSL *s, const unsigned char *out, size_t len,
103} 103}
104 104
105void 105void
106tls1_handshake_hash_free(SSL *s) 106tls1_transcript_hash_free(SSL *s)
107{ 107{
108 EVP_MD_CTX_free(S3I(s)->handshake_hash); 108 EVP_MD_CTX_free(S3I(s)->handshake_hash);
109 S3I(s)->handshake_hash = NULL; 109 S3I(s)->handshake_hash = NULL;
@@ -191,7 +191,7 @@ tls1_transcript_freeze(SSL *s)
191int 191int
192tls1_transcript_record(SSL *s, const unsigned char *buf, size_t len) 192tls1_transcript_record(SSL *s, const unsigned char *buf, size_t len)
193{ 193{
194 if (!tls1_handshake_hash_update(s, buf, len)) 194 if (!tls1_transcript_hash_update(s, buf, len))
195 return 0; 195 return 0;
196 196
197 if (!tls1_transcript_append(s, buf, len)) 197 if (!tls1_transcript_append(s, buf, len))