From 5573171352ea23df2dc6d2fe0324d023b7ba697c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 21 Jul 2014 02:24:59 +1000 Subject: - (dtucker) [cipher.c openbsd-compat/openssl-compat.h] Restore the bits needed to build AES CTR mode against OpenSSL 0.9.8f and above. ok djm --- cipher.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cipher.c') diff --git a/cipher.c b/cipher.c index 48ef105c..638ca2d9 100644 --- a/cipher.c +++ b/cipher.c @@ -49,6 +49,8 @@ #include "ssherr.h" #include "digest.h" +#include "openbsd-compat/openssl-compat.h" + #ifdef WITH_SSH1 extern const EVP_CIPHER *evp_ssh1_bf(void); extern const EVP_CIPHER *evp_ssh1_3des(void); @@ -545,6 +547,11 @@ cipher_get_keyiv(struct sshcipher_ctx *cc, u_char *iv, u_int len) return SSH_ERR_LIBCRYPTO_ERROR; if ((u_int)evplen != len) return SSH_ERR_INVALID_ARGUMENT; +#ifndef OPENSSL_HAVE_EVPCTR + if (c->evptype == evp_aes_128_ctr) + ssh_aes_ctr_iv(&cc->evp, 0, iv, len); + else +#endif if (cipher_authlen(c)) { if (!EVP_CIPHER_CTX_ctrl(&cc->evp, EVP_CTRL_GCM_IV_GEN, len, iv)) -- cgit v1.2.1