summaryrefslogtreecommitdiff
path: root/cipher.c
diff options
context:
space:
mode:
Diffstat (limited to 'cipher.c')
-rw-r--r--cipher.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/cipher.c b/cipher.c
index c55c7dcbd..bf1518ded 100644
--- a/cipher.c
+++ b/cipher.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$Id: cipher.c,v 1.13 2000/03/09 10:27:50 damien Exp $"); 15RCSID("$Id: cipher.c,v 1.14 2000/03/26 03:04:52 damien Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "cipher.h" 18#include "cipher.h"
@@ -110,18 +110,6 @@ swap_bytes(const unsigned char *src, unsigned char *dst_, int n)
110 } 110 }
111} 111}
112 112
113void (*cipher_attack_detected) (const char *fmt,...) = fatal;
114
115static inline void
116detect_cbc_attack(const unsigned char *src,
117 unsigned int len)
118{
119 return;
120
121 log("CRC-32 CBC insertion attack detected");
122 cipher_attack_detected("CRC-32 CBC insertion attack detected");
123}
124
125/* 113/*
126 * Names of all encryption algorithms. 114 * Names of all encryption algorithms.
127 * These must match the numbers defined in cipher.h. 115 * These must match the numbers defined in cipher.h.
@@ -304,7 +292,6 @@ cipher_decrypt(CipherContext *context, unsigned char *dest,
304 break; 292 break;
305 293
306 case SSH_CIPHER_3DES: 294 case SSH_CIPHER_3DES:
307 /* CRC-32 attack? */
308 SSH_3CBC_DECRYPT(context->u.des3.key1, 295 SSH_3CBC_DECRYPT(context->u.des3.key1,
309 context->u.des3.key2, &context->u.des3.iv2, 296 context->u.des3.key2, &context->u.des3.iv2,
310 context->u.des3.key3, &context->u.des3.iv3, 297 context->u.des3.key3, &context->u.des3.iv3,
@@ -312,7 +299,6 @@ cipher_decrypt(CipherContext *context, unsigned char *dest,
312 break; 299 break;
313 300
314 case SSH_CIPHER_BLOWFISH: 301 case SSH_CIPHER_BLOWFISH:
315 detect_cbc_attack(src, len);
316 swap_bytes(src, dest, len); 302 swap_bytes(src, dest, len);
317 BF_cbc_encrypt((void *) dest, dest, len, 303 BF_cbc_encrypt((void *) dest, dest, len,
318 &context->u.bf.key, context->u.bf.iv, 304 &context->u.bf.key, context->u.bf.iv,