From 55b870bc0442258199f29518a1c056569c6cff35 Mon Sep 17 00:00:00 2001 From: miod <> Date: Wed, 7 May 2014 22:05:48 +0000 Subject: Get __STRICT_ALIGNMENT from and decide upon it, rather than defining it for not (i386 and amd64 (and sometimes s390)) only. Compile-time tests remain compile-time tests, and runtime-test remain runtime-test instead of being converted to compile-time tests, per matthew@'s explicit demand (rationale: this makes sure the compiler checks your code even if you won't run it). No functional change except on s390 (which we don't run on) and vax (which we run on, but noone cares about) ok matthew@ --- src/lib/libcrypto/modes/cbc128.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/lib/libcrypto/modes/cbc128.c') diff --git a/src/lib/libcrypto/modes/cbc128.c b/src/lib/libcrypto/modes/cbc128.c index 0e54f75470..e4920a93ac 100644 --- a/src/lib/libcrypto/modes/cbc128.c +++ b/src/lib/libcrypto/modes/cbc128.c @@ -59,8 +59,11 @@ #endif #include -#ifndef STRICT_ALIGNMENT -# define STRICT_ALIGNMENT 0 +#undef STRICT_ALIGNMENT +#ifdef __STRICT_ALIGNMENT +#define STRICT_ALIGNMENT 1 +#else +#define STRICT_ALIGNMENT 0 #endif void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, @@ -136,8 +139,7 @@ void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, in += 16; out += 16; } - } - else if (16%sizeof(size_t) == 0) { /* always true */ + } else if (16%sizeof(size_t) == 0) { /* always true */ while (len>=16) { size_t *out_t=(size_t *)out, *iv_t=(size_t *)iv; @@ -166,8 +168,7 @@ void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, in += 16; out += 16; } - } - else if (16%sizeof(size_t) == 0) { /* always true */ + } else if (16%sizeof(size_t) == 0) { /* always true */ while (len>=16) { size_t c, *out_t=(size_t *)out, *ivec_t=(size_t *)ivec; const size_t *in_t=(const size_t *)in; -- cgit v1.2.3-55-g6feb