X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=crypt.c;h=8e1814dd3d82e5fd1d50301402faea6b0d9a9934;hp=9085f66b1ad88b316801739fef480c84ab3fb2c4;hb=32e646780461f96682d1191d31e08e4602ab125e;hpb=d7b4aa3835197ee906f13f515040e1cda6385544 diff --git a/crypt.c b/crypt.c index 9085f66b..8e1814dd 100644 --- a/crypt.c +++ b/crypt.c @@ -219,7 +219,6 @@ int pub_encrypt(struct asymmetric_key *pub, unsigned char *inbuf, return ret < 0? -E_ENCRYPT : ret; } -#define RC4_ALIGN 8 struct stream_cipher { RC4_KEY key; }; @@ -249,6 +248,13 @@ void sc_free(struct stream_cipher *sc) free(sc); } +/** + * The RC4() implementation of openssl apparently reads and writes data in + * blocks of 8 bytes. So we have to make sure our buffer sizes are a multiple + * of this. + */ +#define RC4_ALIGN 8 + /** * Encrypt and send a buffer. *