-/* $OpenBSD: d1_both.c,v 1.54 2018/08/30 16:56:16 jsing Exp $ */
+/* $OpenBSD: d1_both.c,v 1.55 2018/09/05 16:58:59 jsing Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
if (frag->msg_header.is_ccs) {
EVP_CIPHER_CTX_free(
frag->msg_header.saved_retransmit_state.enc_write_ctx);
- EVP_MD_CTX_destroy(
+ EVP_MD_CTX_free(
frag->msg_header.saved_retransmit_state.write_hash);
}
free(frag->fragment);
-/* $OpenBSD: ssl_clnt.c,v 1.33 2018/08/24 17:30:32 jsing Exp $ */
+/* $OpenBSD: ssl_clnt.c,v 1.34 2018/09/05 16:58:59 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
/*
* Compute shared IV and store it in algorithm-specific context data.
*/
- ukm_hash = EVP_MD_CTX_create();
+ ukm_hash = EVP_MD_CTX_new();
if (ukm_hash == NULL) {
SSLerror(s, ERR_R_MALLOC_FAILURE);
goto err;
EVP_DigestUpdate(ukm_hash, s->s3->client_random, SSL3_RANDOM_SIZE);
EVP_DigestUpdate(ukm_hash, s->s3->server_random, SSL3_RANDOM_SIZE);
EVP_DigestFinal_ex(ukm_hash, shared_ukm, &md_len);
- EVP_MD_CTX_destroy(ukm_hash);
+ EVP_MD_CTX_free(ukm_hash);
if (EVP_PKEY_CTX_ctrl(pkey_ctx, -1, EVP_PKEY_OP_ENCRYPT,
EVP_PKEY_CTRL_SET_IV, 8, shared_ukm) < 0) {
SSLerror(s, SSL_R_LIBRARY_BUG);
-/* $OpenBSD: ssl_lib.c,v 1.188 2018/09/05 16:48:11 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.189 2018/09/05 16:58:59 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
EVP_CIPHER_CTX_free(s->enc_read_ctx);
s->enc_read_ctx = NULL;
- EVP_MD_CTX_destroy(s->read_hash);
+ EVP_MD_CTX_free(s->read_hash);
s->read_hash = NULL;
if (s->internal->aead_read_ctx != NULL) {
{
EVP_CIPHER_CTX_free(s->internal->enc_write_ctx);
s->internal->enc_write_ctx = NULL;
- EVP_MD_CTX_destroy(s->internal->write_hash);
+ EVP_MD_CTX_free(s->internal->write_hash);
s->internal->write_hash = NULL;
if (s->internal->aead_write_ctx != NULL) {
-/* $OpenBSD: t1_enc.c,v 1.111 2018/09/05 16:48:11 jsing Exp $ */
+/* $OpenBSD: t1_enc.c,v 1.112 2018/09/05 16:58:59 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if ((cipher_ctx = EVP_CIPHER_CTX_new()) == NULL)
goto err;
s->enc_read_ctx = cipher_ctx;
- if ((mac_ctx = EVP_MD_CTX_create()) == NULL)
+ if ((mac_ctx = EVP_MD_CTX_new()) == NULL)
goto err;
s->read_hash = mac_ctx;
} else {
if ((cipher_ctx = EVP_CIPHER_CTX_new()) == NULL)
goto err;
s->internal->enc_write_ctx = cipher_ctx;
- if ((mac_ctx = EVP_MD_CTX_create()) == NULL)
+ if ((mac_ctx = EVP_MD_CTX_new()) == NULL)
goto err;
s->internal->write_hash = mac_ctx;
}
-/* $OpenBSD: t1_hash.c,v 1.2 2017/05/06 16:18:36 jsing Exp $ */
+/* $OpenBSD: t1_hash.c,v 1.3 2018/09/05 16:58:59 jsing Exp $ */
/*
* Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
*
goto err;
}
- if ((S3I(s)->handshake_hash = EVP_MD_CTX_create()) == NULL) {
+ if ((S3I(s)->handshake_hash = EVP_MD_CTX_new()) == NULL) {
SSLerror(s, ERR_R_MALLOC_FAILURE);
goto err;
}
if (EVP_MD_CTX_size(S3I(s)->handshake_hash) > len)
goto err;
- if ((mdctx = EVP_MD_CTX_create()) == NULL) {
+ if ((mdctx = EVP_MD_CTX_new()) == NULL) {
SSLerror(s, ERR_R_MALLOC_FAILURE);
goto err;
}
ret = 1;
err:
- EVP_MD_CTX_destroy(mdctx);
+ EVP_MD_CTX_free(mdctx);
return (ret);
}
void
tls1_handshake_hash_free(SSL *s)
{
- EVP_MD_CTX_destroy(S3I(s)->handshake_hash);
+ EVP_MD_CTX_free(S3I(s)->handshake_hash);
S3I(s)->handshake_hash = NULL;
}