summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoshua Oreman2009-07-01 06:55:10 +0200
committerMarty Connor2010-01-05 15:02:59 +0100
commitff4d61de962a11517fd9958d0a40fbd8bcbd92ec (patch)
tree058b8866f896278092b02e5a3bcda94482c1386d /src
parent[digest] Add HMAC-SHA1 based pseudorandom function and PBKDF2 (diff)
downloadipxe-ff4d61de962a11517fd9958d0a40fbd8bcbd92ec.tar.gz
ipxe-ff4d61de962a11517fd9958d0a40fbd8bcbd92ec.tar.xz
ipxe-ff4d61de962a11517fd9958d0a40fbd8bcbd92ec.zip
[crypto] Add parentheses around len argument in blocksize assert
This fixes an issue where passing a length as a compound expression (e.g. using `hdrlen + datalen') would trigger compiler warnings and potentially precedence-related errors. Signed-off-by: Marty Connor <mdc@etherboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/include/gpxe/crypto.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/gpxe/crypto.h b/src/include/gpxe/crypto.h
index 3831b79c..751ca05b 100644
--- a/src/include/gpxe/crypto.h
+++ b/src/include/gpxe/crypto.h
@@ -129,7 +129,7 @@ static inline void cipher_encrypt ( struct cipher_algorithm *cipher,
cipher->encrypt ( ctx, src, dst, len );
}
#define cipher_encrypt( cipher, ctx, src, dst, len ) do { \
- assert ( ( len & ( (cipher)->blocksize - 1 ) ) == 0 ); \
+ assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \
cipher_encrypt ( (cipher), (ctx), (src), (dst), (len) ); \
} while ( 0 )
@@ -139,7 +139,7 @@ static inline void cipher_decrypt ( struct cipher_algorithm *cipher,
cipher->decrypt ( ctx, src, dst, len );
}
#define cipher_decrypt( cipher, ctx, src, dst, len ) do { \
- assert ( ( len & ( (cipher)->blocksize - 1 ) ) == 0 ); \
+ assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \
cipher_decrypt ( (cipher), (ctx), (src), (dst), (len) ); \
} while ( 0 )