summaryrefslogtreecommitdiff
path: root/cipher.c
diff options
context:
space:
mode:
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))