diff options
author | jsing <> | 2018-09-05 16:58:59 +0000 |
---|---|---|
committer | jsing <> | 2018-09-05 16:58:59 +0000 |
commit | de40edcfdbe61b35779d4d9d364860a212cf755a (patch) | |
tree | 3bf8afe97ce6a4beefaa158520450f94016312bf /src/lib/libssl/t1_hash.c | |
parent | 3dd336e6ff4073ca34d5f248d90afd65c6e3f27f (diff) | |
download | openbsd-de40edcfdbe61b35779d4d9d364860a212cf755a.tar.gz openbsd-de40edcfdbe61b35779d4d9d364860a212cf755a.tar.bz2 openbsd-de40edcfdbe61b35779d4d9d364860a212cf755a.zip |
Use the newer/more sensible names for EVP_MD_CTX_* functions.
EVP_MD_CTX_create -> EVP_MD_CTX_new
EVP_MD_CTX_destroy -> EVP_MD_CTX_free
This should make the intent more obvious and reduce head scratching during
code reviews.
Raised by tb@
Diffstat (limited to 'src/lib/libssl/t1_hash.c')
-rw-r--r-- | src/lib/libssl/t1_hash.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libssl/t1_hash.c b/src/lib/libssl/t1_hash.c index aef6e65729..a7e46601e8 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.2 2017/05/06 16:18:36 jsing Exp $ */ | 1 | /* $OpenBSD: t1_hash.c,v 1.3 2018/09/05 16:58:59 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -33,7 +33,7 @@ tls1_handshake_hash_init(SSL *s) | |||
33 | goto err; | 33 | goto err; |
34 | } | 34 | } |
35 | 35 | ||
36 | if ((S3I(s)->handshake_hash = EVP_MD_CTX_create()) == NULL) { | 36 | if ((S3I(s)->handshake_hash = EVP_MD_CTX_new()) == NULL) { |
37 | SSLerror(s, ERR_R_MALLOC_FAILURE); | 37 | SSLerror(s, ERR_R_MALLOC_FAILURE); |
38 | goto err; | 38 | goto err; |
39 | } | 39 | } |
@@ -80,7 +80,7 @@ tls1_handshake_hash_value(SSL *s, const unsigned char *out, size_t len, | |||
80 | if (EVP_MD_CTX_size(S3I(s)->handshake_hash) > len) | 80 | if (EVP_MD_CTX_size(S3I(s)->handshake_hash) > len) |
81 | goto err; | 81 | goto err; |
82 | 82 | ||
83 | if ((mdctx = EVP_MD_CTX_create()) == NULL) { | 83 | if ((mdctx = EVP_MD_CTX_new()) == NULL) { |
84 | SSLerror(s, ERR_R_MALLOC_FAILURE); | 84 | SSLerror(s, ERR_R_MALLOC_FAILURE); |
85 | goto err; | 85 | goto err; |
86 | } | 86 | } |
@@ -98,7 +98,7 @@ tls1_handshake_hash_value(SSL *s, const unsigned char *out, size_t len, | |||
98 | ret = 1; | 98 | ret = 1; |
99 | 99 | ||
100 | err: | 100 | err: |
101 | EVP_MD_CTX_destroy(mdctx); | 101 | EVP_MD_CTX_free(mdctx); |
102 | 102 | ||
103 | return (ret); | 103 | return (ret); |
104 | } | 104 | } |
@@ -106,6 +106,6 @@ tls1_handshake_hash_value(SSL *s, const unsigned char *out, size_t len, | |||
106 | void | 106 | void |
107 | tls1_handshake_hash_free(SSL *s) | 107 | tls1_handshake_hash_free(SSL *s) |
108 | { | 108 | { |
109 | EVP_MD_CTX_destroy(S3I(s)->handshake_hash); | 109 | EVP_MD_CTX_free(S3I(s)->handshake_hash); |
110 | S3I(s)->handshake_hash = NULL; | 110 | S3I(s)->handshake_hash = NULL; |
111 | } | 111 | } |