Skip to content

Commit 1b16375

Browse files
committed
also clean up memory
1 parent 20a6819 commit 1b16375

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

crypto/s2n_evp.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ struct s2n_evp_digest {
2626
EVP_MD_CTX *ctx;
2727
};
2828

29-
struct s2n_evp_hmac_state {
30-
struct s2n_evp_digest evp_digest;
31-
union {
32-
HMAC_CTX *hmac_ctx;
33-
EVP_PKEY *evp_pkey;
34-
} ctx;
35-
};
36-
3729
/* Define API's that change based on the OpenSSL Major Version. */
3830
#if S2N_OPENSSL_VERSION_AT_LEAST(1, 1, 0) && !defined(LIBRESSL_VERSION_NUMBER)
3931
#define S2N_EVP_MD_CTX_NEW() (EVP_MD_CTX_new())

tests/cbmc/sources/make_common_datastructures.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -244,24 +244,6 @@ struct s2n_evp_digest* cbmc_allocate_s2n_evp_digest()
244244
return evp_digest;
245245
}
246246

247-
void cbmc_populate_s2n_evp_hmac_state(struct s2n_evp_hmac_state *evp_hmac_state)
248-
{
249-
CBMC_ENSURE_REF(evp_hmac_state);
250-
cbmc_populate_s2n_evp_digest(&(evp_hmac_state->evp_digest));
251-
if (s2n_libcrypto_is_awslc() || s2n_libcrypto_is_boringssl()) {
252-
evp_hmac_state->ctx.hmac_ctx = malloc(sizeof(*(evp_hmac_state->ctx.hmac_ctx)));
253-
} else {
254-
evp_hmac_state->ctx.evp_pkey = malloc(sizeof(*(evp_hmac_state->ctx.evp_pkey)));
255-
}
256-
}
257-
258-
struct s2n_evp_hmac_state *cbmc_allocate_s2n_evp_hmac_state()
259-
{
260-
struct s2n_evp_hmac_state *evp_hmac_state = malloc(sizeof(*evp_hmac_state));
261-
cbmc_populate_s2n_evp_hmac_state(evp_hmac_state);
262-
return evp_hmac_state;
263-
}
264-
265247
void cbmc_populate_s2n_hash_state(struct s2n_hash_state* state)
266248
{
267249
CBMC_ENSURE_REF(state);
@@ -716,7 +698,6 @@ void cbmc_populate_s2n_prf_working_space(struct s2n_prf_working_space *s2n_prf_w
716698
* If required, this initialization should be done in the validation function.
717699
*/
718700
cbmc_populate_s2n_hmac_state(&(s2n_prf_working_space->p_hash.s2n_hmac));
719-
cbmc_populate_s2n_evp_hmac_state(&(s2n_prf_working_space->p_hash.evp_hmac));
720701
}
721702

722703
struct s2n_prf_working_space* cbmc_allocate_s2n_prf_working_space()

0 commit comments

Comments
 (0)