From 3a22e5d30f49090d95ebff0e157b19522a38be35 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Thu, 26 May 2016 19:29:29 +0000 Subject: crypto routines: Hint minimum buffer sizes to the compiler Use the C99 'static' keyword to hint to the compiler IVs and output digest sizes. The keyword informs the compiler of the minimum valid size for a given array. Obviously not every pointer can be validated (i.e., the compiler can produce false negative but not false positive reports). No functional change. No ABI change. Sponsored by: EMC / Isilon Storage Division --- cpukit/include/sha256.h | 2 +- cpukit/include/sha384.h | 2 +- cpukit/include/sha512.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'cpukit/include') diff --git a/cpukit/include/sha256.h b/cpukit/include/sha256.h index 9deed91255..4fe35935c0 100644 --- a/cpukit/include/sha256.h +++ b/cpukit/include/sha256.h @@ -47,7 +47,7 @@ __BEGIN_DECLS void SHA256_Init(SHA256_CTX *); void SHA256_Update(SHA256_CTX *, const void *, size_t); -void SHA256_Final(unsigned char [SHA256_DIGEST_LENGTH], SHA256_CTX *); +void SHA256_Final(unsigned char [static SHA256_DIGEST_LENGTH], SHA256_CTX *); #ifndef _KERNEL char *SHA256_End(SHA256_CTX *, char *); char *SHA256_Data(const void *, unsigned int, char *); diff --git a/cpukit/include/sha384.h b/cpukit/include/sha384.h index 2035d6ff54..52f69efc95 100644 --- a/cpukit/include/sha384.h +++ b/cpukit/include/sha384.h @@ -47,7 +47,7 @@ __BEGIN_DECLS void SHA384_Init(SHA384_CTX *); void SHA384_Update(SHA384_CTX *, const void *, size_t); -void SHA384_Final(unsigned char [SHA384_DIGEST_LENGTH], SHA384_CTX *); +void SHA384_Final(unsigned char [static SHA384_DIGEST_LENGTH], SHA384_CTX *); #ifndef _KERNEL char *SHA384_End(SHA384_CTX *, char *); char *SHA384_Data(const void *, unsigned int, char *); diff --git a/cpukit/include/sha512.h b/cpukit/include/sha512.h index 1964562160..de7d19abb3 100644 --- a/cpukit/include/sha512.h +++ b/cpukit/include/sha512.h @@ -47,7 +47,7 @@ __BEGIN_DECLS void SHA512_Init(SHA512_CTX *); void SHA512_Update(SHA512_CTX *, const void *, size_t); -void SHA512_Final(unsigned char [SHA512_DIGEST_LENGTH], SHA512_CTX *); +void SHA512_Final(unsigned char [static SHA512_DIGEST_LENGTH], SHA512_CTX *); #ifndef _KERNEL char *SHA512_End(SHA512_CTX *, char *); char *SHA512_Data(const void *, unsigned int, char *); -- cgit v1.2.3