diff options
author | tb <> | 2023-12-29 07:02:28 +0000 |
---|---|---|
committer | tb <> | 2023-12-29 07:02:28 +0000 |
commit | b5b01d4f751b38fce11616819ef7d485c8a4c5e9 (patch) | |
tree | 11f930780e018356363acbe02decad10821128f8 | |
parent | 9a8673163304ff42da75dd394141d665b246f1bc (diff) | |
download | openbsd-b5b01d4f751b38fce11616819ef7d485c8a4c5e9.tar.gz openbsd-b5b01d4f751b38fce11616819ef7d485c8a4c5e9.tar.bz2 openbsd-b5b01d4f751b38fce11616819ef7d485c8a4c5e9.zip |
Move init/reset next to cleanup
This way new/free aka create/destroy are next to each other. reset/cleanup
are the same thing and init will join the club after some other fixing
because two APIs that do the exact same thing aren't enough.
-rw-r--r-- | src/lib/libcrypto/evp/evp_digest.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/evp/evp_digest.c b/src/lib/libcrypto/evp/evp_digest.c index 75787d3f7d..e29081d337 100644 --- a/src/lib/libcrypto/evp/evp_digest.c +++ b/src/lib/libcrypto/evp/evp_digest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp_digest.c,v 1.3 2023/12/29 06:59:24 tb Exp $ */ | 1 | /* $OpenBSD: evp_digest.c,v 1.4 2023/12/29 07:02:28 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -234,18 +234,6 @@ EVP_MD_CTX_free(EVP_MD_CTX *ctx) | |||
234 | free(ctx); | 234 | free(ctx); |
235 | } | 235 | } |
236 | 236 | ||
237 | void | ||
238 | EVP_MD_CTX_init(EVP_MD_CTX *ctx) | ||
239 | { | ||
240 | memset(ctx, 0, sizeof(*ctx)); | ||
241 | } | ||
242 | |||
243 | int | ||
244 | EVP_MD_CTX_reset(EVP_MD_CTX *ctx) | ||
245 | { | ||
246 | return EVP_MD_CTX_cleanup(ctx); | ||
247 | } | ||
248 | |||
249 | EVP_MD_CTX * | 237 | EVP_MD_CTX * |
250 | EVP_MD_CTX_create(void) | 238 | EVP_MD_CTX_create(void) |
251 | { | 239 | { |
@@ -258,6 +246,18 @@ EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) | |||
258 | EVP_MD_CTX_free(ctx); | 246 | EVP_MD_CTX_free(ctx); |
259 | } | 247 | } |
260 | 248 | ||
249 | void | ||
250 | EVP_MD_CTX_init(EVP_MD_CTX *ctx) | ||
251 | { | ||
252 | memset(ctx, 0, sizeof(*ctx)); | ||
253 | } | ||
254 | |||
255 | int | ||
256 | EVP_MD_CTX_reset(EVP_MD_CTX *ctx) | ||
257 | { | ||
258 | return EVP_MD_CTX_cleanup(ctx); | ||
259 | } | ||
260 | |||
261 | /* This call frees resources associated with the context */ | 261 | /* This call frees resources associated with the context */ |
262 | int | 262 | int |
263 | EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) | 263 | EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) |