diff --git a/src/libcrypto-compat.c b/src/libcrypto-compat.c index 12051c85..8700a9b5 100644 --- a/src/libcrypto-compat.c +++ b/src/libcrypto-compat.c @@ -236,12 +236,6 @@ void EVP_MD_CTX_free(EVP_MD_CTX *ctx) OPENSSL_free(ctx); } -int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) -{ - EVP_CIPHER_CTX_init(ctx); - return 1; -} - #ifndef HAVE_OPENSSL_EVP_CIPHER_CTX_NEW EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void) { diff --git a/src/libcrypto-compat.h b/src/libcrypto-compat.h index c584ed25..437b0534 100644 --- a/src/libcrypto-compat.h +++ b/src/libcrypto-compat.h @@ -33,8 +33,6 @@ int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s); EVP_MD_CTX *EVP_MD_CTX_new(void); void EVP_MD_CTX_free(EVP_MD_CTX *ctx); -int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx); - void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g); int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g); diff --git a/src/libcrypto.c b/src/libcrypto.c index a9fecbe4..b2d5fc93 100644 --- a/src/libcrypto.c +++ b/src/libcrypto.c @@ -482,6 +482,8 @@ static void evp_cipher_init(struct ssh_cipher_struct *cipher) { if (cipher->ctx == NULL) { cipher->ctx = EVP_CIPHER_CTX_new(); + } else { + EVP_CIPHER_CTX_init(cipher->ctx); } switch(cipher->ciphertype){ @@ -548,7 +550,6 @@ static int evp_cipher_set_encrypt_key(struct ssh_cipher_struct *cipher, int rc; evp_cipher_init(cipher); - EVP_CIPHER_CTX_reset(cipher->ctx); rc = EVP_EncryptInit_ex(cipher->ctx, cipher->cipher, NULL, key, IV); if (rc != 1){ @@ -581,7 +582,6 @@ static int evp_cipher_set_decrypt_key(struct ssh_cipher_struct *cipher, int rc; evp_cipher_init(cipher); - EVP_CIPHER_CTX_reset(cipher->ctx); rc = EVP_DecryptInit_ex(cipher->ctx, cipher->cipher, NULL, key, IV); if (rc != 1){