summaryrefslogtreecommitdiff
path: root/cipher.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2014-07-21 02:24:59 +1000
committerDarren Tucker <dtucker@zip.com.au>2014-07-21 02:24:59 +1000
commit5573171352ea23df2dc6d2fe0324d023b7ba697c (patch)
tree083b7a1b3fc548ce2f440702dafcedb1391a3fe1 /cipher.c
parent74e28682711d005026c7c8f15f96aea9d3c8b5a3 (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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cipher.c b/cipher.c
index 48ef105ca..638ca2d97 100644
--- a/cipher.c
+++ b/cipher.c
@@ -49,6 +49,8 @@
49#include "ssherr.h" 49#include "ssherr.h"
50#include "digest.h" 50#include "digest.h"
51 51
52#include "openbsd-compat/openssl-compat.h"
53
52#ifdef WITH_SSH1 54#ifdef WITH_SSH1
53extern const EVP_CIPHER *evp_ssh1_bf(void); 55extern const EVP_CIPHER *evp_ssh1_bf(void);
54extern const EVP_CIPHER *evp_ssh1_3des(void); 56extern const EVP_CIPHER *evp_ssh1_3des(void);
@@ -545,6 +547,11 @@ cipher_get_keyiv(struct sshcipher_ctx *cc, u_char *iv, u_int len)
545 return SSH_ERR_LIBCRYPTO_ERROR; 547 return SSH_ERR_LIBCRYPTO_ERROR;
546 if ((u_int)evplen != len) 548 if ((u_int)evplen != len)
547 return SSH_ERR_INVALID_ARGUMENT; 549 return SSH_ERR_INVALID_ARGUMENT;
550#ifndef OPENSSL_HAVE_EVPCTR
551 if (c->evptype == evp_aes_128_ctr)
552 ssh_aes_ctr_iv(&cc->evp, 0, iv, len);
553 else
554#endif
548 if (cipher_authlen(c)) { 555 if (cipher_authlen(c)) {
549 if (!EVP_CIPHER_CTX_ctrl(&cc->evp, EVP_CTRL_GCM_IV_GEN, 556 if (!EVP_CIPHER_CTX_ctrl(&cc->evp, EVP_CTRL_GCM_IV_GEN,
550 len, iv)) 557 len, iv))