diff options
| author | jsing <> | 2019-02-09 15:26:15 +0000 |
|---|---|---|
| committer | jsing <> | 2019-02-09 15:26:15 +0000 |
| commit | bf3fc1487ab4d49b366d075e6f48ee4eef2d29a4 (patch) | |
| tree | ccde70d521f0e94dd1570fd0a07f27a5b4ca631e /src/lib/libssl/t1_hash.c | |
| parent | 697813b6701818d308182e24502b82a16067be78 (diff) | |
| download | openbsd-bf3fc1487ab4d49b366d075e6f48ee4eef2d29a4.tar.gz openbsd-bf3fc1487ab4d49b366d075e6f48ee4eef2d29a4.tar.bz2 openbsd-bf3fc1487ab4d49b366d075e6f48ee4eef2d29a4.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.c | 18 |
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 | ||
| 22 | int | 22 | int |
| 23 | tls1_handshake_hash_init(SSL *s) | 23 | tls1_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 | ||
| 62 | int | 62 | int |
| 63 | tls1_handshake_hash_update(SSL *s, const unsigned char *buf, size_t len) | 63 | tls1_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 | ||
| 71 | int | 71 | int |
| 72 | tls1_handshake_hash_value(SSL *s, const unsigned char *out, size_t len, | 72 | tls1_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 | ||
| 105 | void | 105 | void |
| 106 | tls1_handshake_hash_free(SSL *s) | 106 | tls1_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) | |||
| 191 | int | 191 | int |
| 192 | tls1_transcript_record(SSL *s, const unsigned char *buf, size_t len) | 192 | tls1_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)) |
