comparison common-algo.c @ 543:e12c9225acbd

- Don't memcpy() in place with void_encrypt
author Matt Johnston <matt@ucc.asn.au>
date Tue, 09 Jun 2009 13:18:52 +0000
parents 0cdbc95bb3d2
children f9b5dc0cba61
comparison
equal deleted inserted replaced
542:c9128994a2d6 543:e12c9225acbd
29 /* This file (algo.c) organises the ciphers which can be used, and is used to 29 /* This file (algo.c) organises the ciphers which can be used, and is used to
30 * decide which ciphers/hashes/compression/signing to use during key exchange*/ 30 * decide which ciphers/hashes/compression/signing to use during key exchange*/
31 31
32 static int void_cipher(const unsigned char* in, unsigned char* out, 32 static int void_cipher(const unsigned char* in, unsigned char* out,
33 unsigned long len, void *cipher_state) { 33 unsigned long len, void *cipher_state) {
34 memcpy(out, in, len); 34 if (in != out) {
35 memmove(out, in, len);
36 }
35 return CRYPT_OK; 37 return CRYPT_OK;
36 } 38 }
37 39
38 static int void_start(int cipher, const unsigned char *IV, 40 static int void_start(int cipher, const unsigned char *IV,
39 const unsigned char *key, 41 const unsigned char *key,