diff options
| author | tb <> | 2023-12-29 07:02:28 +0000 | 
|---|---|---|
| committer | tb <> | 2023-12-29 07:02:28 +0000 | 
| commit | a6f259b0f5b713adb255a98bb5b3e3076f9c67cb (patch) | |
| tree | 11f930780e018356363acbe02decad10821128f8 /src/lib/libc | |
| parent | 38d2a0336d53815938ce0b126bb01bc109c07ffc (diff) | |
| download | openbsd-a6f259b0f5b713adb255a98bb5b3e3076f9c67cb.tar.gz openbsd-a6f259b0f5b713adb255a98bb5b3e3076f9c67cb.tar.bz2 openbsd-a6f259b0f5b713adb255a98bb5b3e3076f9c67cb.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.
Diffstat (limited to '')
| -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) | 
