]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Mark md4/md5/sha1/sha2 code with ATTR_UNSIGNED_WRAPS
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 18 Nov 2016 23:57:40 +0000 (01:57 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 25 Nov 2016 13:28:43 +0000 (15:28 +0200)
src/lib/md4.c
src/lib/md5.c
src/lib/sha1.c
src/lib/sha2.c

index de59b38c81fd7df5bafb093181fb0708b0ddfa1e..72e2ff85d537014f01b60ee144e6b7f49bf1f97e 100644 (file)
@@ -65,7 +65,7 @@
  * This processes one or more 64-byte data blocks, but does NOT update
  * the bit counters.  There're no alignment requirements.
  */
-static const void * ATTR_NOWARN_UNUSED_RESULT
+static const void * ATTR_NOWARN_UNUSED_RESULT ATTR_UNSIGNED_WRAPS
 body(struct md4_context *ctx, const void *data, size_t size)
 {
        const unsigned char *ptr;
index 4c34dd6ece2219073587961ea35a7c27e3e2742b..70cf171c67da01195204a657eca195b49fe4636c 100644 (file)
@@ -66,7 +66,7 @@
  * This processes one or more 64-byte data blocks, but does NOT update
  * the bit counters.  There're no alignment requirements.
  */
-static const void * ATTR_NOWARN_UNUSED_RESULT
+static const void * ATTR_NOWARN_UNUSED_RESULT ATTR_UNSIGNED_WRAPS
 body(struct md5_context *ctx, const void *data, size_t size)
 {
        const unsigned char *ptr;
@@ -186,7 +186,8 @@ void md5_init(struct md5_context *ctx)
        memset(ctx->block, 0, sizeof(ctx->block));
 }
 
-void md5_update(struct md5_context *ctx, const void *data, size_t size)
+void ATTR_UNSIGNED_WRAPS
+md5_update(struct md5_context *ctx, const void *data, size_t size)
 {
        /* @UNSAFE */
        uint_fast32_t saved_lo;
@@ -221,7 +222,8 @@ void md5_update(struct md5_context *ctx, const void *data, size_t size)
        memcpy(ctx->buffer, data, size);
 }
 
-void md5_final(struct md5_context *ctx, unsigned char result[STATIC_ARRAY MD5_RESULTLEN])
+void ATTR_UNSIGNED_WRAPS
+md5_final(struct md5_context *ctx, unsigned char result[STATIC_ARRAY MD5_RESULTLEN])
 {
        /* @UNSAFE */
        unsigned long used, free;
index edb1735e7fb30081a507a2d0693b9df97a91cf81..ddbecf2867ddfa128309237833c9dd534733f33d 100644 (file)
@@ -73,7 +73,7 @@ static uint32_t SHA1_K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 };
 
 static void sha1_step(struct sha1_ctxt *);
 
-static void
+static void ATTR_UNSIGNED_WRAPS
 sha1_step(struct sha1_ctxt *ctxt)
 {
        uint32_t        a, b, c, d, e;
index c3aa91dee548f96cbd35cfec70a47d17a121af4a..cf058c5be71fa7f5915b0e3bda851c8ab65821f1 100644 (file)
@@ -175,8 +175,9 @@ static const uint64_t sha512_k[80] =
 
 /* SHA-256 functions */
 
-static void sha256_transf(struct sha256_ctx *ctx, const unsigned char *data,
-                         size_t block_nb)
+static void ATTR_UNSIGNED_WRAPS
+sha256_transf(struct sha256_ctx *ctx, const unsigned char *data,
+             size_t block_nb)
 {
        uint32_t w[64];
        uint32_t wv[8];
@@ -301,8 +302,9 @@ void sha256_get_digest(const void *data, size_t size,
 
 /* SHA-512 functions */
 
-static void sha512_transf(struct sha512_ctx *ctx, const unsigned char *data,
-                         size_t block_nb)
+static void ATTR_UNSIGNED_WRAPS
+sha512_transf(struct sha512_ctx *ctx, const unsigned char *data,
+             size_t block_nb)
 {
        uint64_t w[80];
        uint64_t wv[8];