summaryrefslogtreecommitdiff
path: root/cipher.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-04-30 23:10:43 +0000
committerDamien Miller <djm@mindrot.org>2017-05-01 09:37:40 +1000
commit56912dea6ef63dae4eb1194e5d88973a7c6c5740 (patch)
treec0425585449d257a90a42efce5f602f7ce16779f /cipher.c
parentd4084cd230f7319056559b00db8b99296dad49d5 (diff)
upstream commit
unifdef WITH_SSH1 ok markus@ Upstream-ID: 9716e62a883ef8826c57f4d33b4a81a9cc7755c7
Diffstat (limited to 'cipher.c')
-rw-r--r--cipher.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/cipher.c b/cipher.c
index 2def333b1..2df2b84bc 100644
--- a/cipher.c
+++ b/cipher.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cipher.c,v 1.102 2016/08/03 05:41:57 djm Exp $ */ 1/* $OpenBSD: cipher.c,v 1.103 2017/04/30 23:10:43 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -51,11 +51,6 @@
51 51
52#include "openbsd-compat/openssl-compat.h" 52#include "openbsd-compat/openssl-compat.h"
53 53
54#ifdef WITH_SSH1
55extern const EVP_CIPHER *evp_ssh1_bf(void);
56extern const EVP_CIPHER *evp_ssh1_3des(void);
57extern int ssh1_3des_iv(EVP_CIPHER_CTX *, int, u_char *, int);
58#endif
59 54
60struct sshcipher_ctx { 55struct sshcipher_ctx {
61 int plaintext; 56 int plaintext;
@@ -87,13 +82,6 @@ struct sshcipher {
87}; 82};
88 83
89static const struct sshcipher ciphers[] = { 84static const struct sshcipher ciphers[] = {
90#ifdef WITH_SSH1
91 { "des", SSH_CIPHER_DES, 8, 8, 0, 0, 0, 1, EVP_des_cbc },
92 { "3des", SSH_CIPHER_3DES, 8, 16, 0, 0, 0, 1, evp_ssh1_3des },
93# ifndef OPENSSL_NO_BF
94 { "blowfish", SSH_CIPHER_BLOWFISH, 8, 32, 0, 0, 0, 1, evp_ssh1_bf },
95# endif /* OPENSSL_NO_BF */
96#endif /* WITH_SSH1 */
97#ifdef WITH_OPENSSL 85#ifdef WITH_OPENSSL
98 { "none", SSH_CIPHER_NONE, 8, 0, 0, 0, 0, 0, EVP_enc_null }, 86 { "none", SSH_CIPHER_NONE, 8, 0, 0, 0, 0, 0, EVP_enc_null },
99 { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc }, 87 { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc },
@@ -628,10 +616,6 @@ cipher_get_keyiv(struct sshcipher_ctx *cc, u_char *iv, u_int len)
628 memcpy(iv, cc->evp->iv, len); 616 memcpy(iv, cc->evp->iv, len);
629 break; 617 break;
630#endif 618#endif
631#ifdef WITH_SSH1
632 case SSH_CIPHER_3DES:
633 return ssh1_3des_iv(cc->evp, 0, iv, 24);
634#endif
635 default: 619 default:
636 return SSH_ERR_INVALID_ARGUMENT; 620 return SSH_ERR_INVALID_ARGUMENT;
637 } 621 }
@@ -674,10 +658,6 @@ cipher_set_keyiv(struct sshcipher_ctx *cc, const u_char *iv)
674 memcpy(cc->evp->iv, iv, evplen); 658 memcpy(cc->evp->iv, iv, evplen);
675 break; 659 break;
676#endif 660#endif
677#ifdef WITH_SSH1
678 case SSH_CIPHER_3DES:
679 return ssh1_3des_iv(cc->evp, 1, (u_char *)iv, 24);
680#endif
681 default: 661 default:
682 return SSH_ERR_INVALID_ARGUMENT; 662 return SSH_ERR_INVALID_ARGUMENT;
683 } 663 }