diff options
author | Darren Tucker <dtucker@zip.com.au> | 2014-07-21 02:24:59 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2014-07-21 02:24:59 +1000 |
commit | 5573171352ea23df2dc6d2fe0324d023b7ba697c (patch) | |
tree | 083b7a1b3fc548ce2f440702dafcedb1391a3fe1 /cipher.c | |
parent | 74e28682711d005026c7c8f15f96aea9d3c8b5a3 (diff) |
- (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
Diffstat (limited to 'cipher.c')
-rw-r--r-- | cipher.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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)) |