aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/contrib
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-06-06 00:05:47 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-06 00:05:58 +0200
commitd90e49599b485ccf5bd8575a05d51b09211576b9 (patch)
treea43412ced6b938b855fa023ae0f9074a9cf32a7b /contrib
parentwg-quick: android: change name of intent (diff)
downloadwireguard-tools-d90e49599b485ccf5bd8575a05d51b09211576b9.tar.xz
wireguard-tools-d90e49599b485ccf5bd8575a05d51b09211576b9.zip
wg: encoding: add missing static array constraints
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/embeddable-wg-library/wireguard.c4
-rw-r--r--contrib/keygen-html/src/curve25519_generate.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/contrib/embeddable-wg-library/wireguard.c b/contrib/embeddable-wg-library/wireguard.c
index 560d7ab..c052355 100644
--- a/contrib/embeddable-wg-library/wireguard.c
+++ b/contrib/embeddable-wg-library/wireguard.c
@@ -1514,7 +1514,7 @@ void wg_free_device(wg_device *dev)
free(dev);
}
-static void encode_base64(char dest[4], const uint8_t src[3])
+static void encode_base64(char dest[static 4], const uint8_t src[static 3])
{
const uint8_t input[] = { (src[0] >> 2) & 63, ((src[0] << 4) | (src[1] >> 4)) & 63, ((src[1] << 2) | (src[2] >> 6)) & 63, src[2] & 63 };
unsigned int i;
@@ -1539,7 +1539,7 @@ void wg_key_to_base64(wg_key_b64_string base64, const wg_key key)
base64[sizeof(wg_key_b64_string) - 1] = '\0';
}
-static int decode_base64(const char src[4])
+static int decode_base64(const char src[static 4])
{
int val = 0;
unsigned int i;
diff --git a/contrib/keygen-html/src/curve25519_generate.c b/contrib/keygen-html/src/curve25519_generate.c
index fc47575..3b560a5 100644
--- a/contrib/keygen-html/src/curve25519_generate.c
+++ b/contrib/keygen-html/src/curve25519_generate.c
@@ -72,7 +72,7 @@ EMSCRIPTEN_KEEPALIVE void curve25519_generate_private(u8 private[static 32])
normalize_secret(private);
}
-static inline void encode_base64(char dest[4], const u8 src[3])
+static inline void encode_base64(char dest[static 4], const u8 src[static 3])
{
const u8 input[] = { (src[0] >> 2) & 63, ((src[0] << 4) | (src[1] >> 4)) & 63, ((src[1] << 2) | (src[2] >> 6)) & 63, src[2] & 63 };