Commit 1dd087d0 authored by Niels Möller's avatar Niels Möller
Browse files

(CBC_ENCRYPT): Avoid using NULL; we don't ensure that it

is defined.
(CBC_DECRYPT): Likewise.

Rev: nettle/cbc.h:1.3
parent 53f5da92
...@@ -54,15 +54,16 @@ cbc_decrypt(void *ctx, nettle_crypt_func f, ...@@ -54,15 +54,16 @@ cbc_decrypt(void *ctx, nettle_crypt_func f,
#define CBC_SET_IV(ctx, data) \ #define CBC_SET_IV(ctx, data) \
memcpy((ctx)->iv, (data), sizeof((ctx)->iv)) memcpy((ctx)->iv, (data), sizeof((ctx)->iv))
/* NOTE: Avoid using NULL, as we don't include anything defining it. */
#define CBC_ENCRYPT(self, f, length, dst, src) \ #define CBC_ENCRYPT(self, f, length, dst, src) \
(0 ? ((f)(&(self)->ctx, 0, NULL, NULL)) \ (0 ? ((f)(&(self)->ctx, 0, (void *)0, (void *)0)) \
: cbc_encrypt((void *) &(self)->ctx, \ : cbc_encrypt((void *) &(self)->ctx, \
(nettle_crypt_func *) (f), \ (nettle_crypt_func *) (f), \
sizeof((self)->iv), (self)->iv, \ sizeof((self)->iv), (self)->iv, \
(length), (dst), (src))) (length), (dst), (src)))
#define CBC_DECRYPT(self, f, length, dst, src) \ #define CBC_DECRYPT(self, f, length, dst, src) \
(0 ? ((f)(&(self)->ctx, 0, NULL, NULL)) \ (0 ? ((f)(&(self)->ctx, 0, (void *)0, (void *)0)) \
: cbc_decrypt((void *) &(self)->ctx, \ : cbc_decrypt((void *) &(self)->ctx, \
(nettle_crypt_func *) (f), \ (nettle_crypt_func *) (f), \
sizeof((self)->iv), (self)->iv, \ sizeof((self)->iv), (self)->iv, \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment