aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@sonymobile.com>2015-04-24 07:19:53 (GMT)
committerJouni Malinen <j@w1.fi>2015-04-25 14:33:06 (GMT)
commit8b423edbd3bb7b5b90cf3d82103d44bedab63e5c (patch)
tree12eb22ee298692ca04144fa97818aa1f8e93c0ab /wlantest
parentfd4fb28179a0b750dff4d38a72a7bf89a2c49813 (diff)
downloadhostap-8b423edbd3bb7b5b90cf3d82103d44bedab63e5c.zip
hostap-8b423edbd3bb7b5b90cf3d82103d44bedab63e5c.tar.gz
hostap-8b423edbd3bb7b5b90cf3d82103d44bedab63e5c.tar.bz2
Declare all read only data structures as const
By analysing objdump output some read only structures were found in .data section. To help compiler further optimize code declare these as const. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
Diffstat (limited to 'wlantest')
-rw-r--r--wlantest/gcmp.c6
-rw-r--r--wlantest/test_vectors.c4
-rw-r--r--wlantest/wlantest.h6
3 files changed, 8 insertions, 8 deletions
diff --git a/wlantest/gcmp.c b/wlantest/gcmp.c
index 161b8a7..d92f4ed 100644
--- a/wlantest/gcmp.c
+++ b/wlantest/gcmp.c
@@ -112,9 +112,9 @@ u8 * gcmp_decrypt(const u8 *tk, size_t tk_len, const struct ieee80211_hdr *hdr,
}
-u8 * gcmp_encrypt(const u8 *tk, size_t tk_len, u8 *frame, size_t len,
- size_t hdrlen, u8 *qos,
- u8 *pn, int keyid, size_t *encrypted_len)
+u8 * gcmp_encrypt(const u8 *tk, size_t tk_len, const u8 *frame, size_t len,
+ size_t hdrlen, const u8 *qos,
+ const u8 *pn, int keyid, size_t *encrypted_len)
{
u8 aad[30], nonce[12], *crypt, *pos;
size_t aad_len, plen;
diff --git a/wlantest/test_vectors.c b/wlantest/test_vectors.c
index 321d930..36f2f5d 100644
--- a/wlantest/test_vectors.c
+++ b/wlantest/test_vectors.c
@@ -232,7 +232,7 @@ struct gcmp_test {
u8 encr[300];
};
-static struct gcmp_test gcmp_vectors[] =
+static const struct gcmp_test gcmp_vectors[] =
{
{
.tk = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
@@ -348,7 +348,7 @@ static struct gcmp_test gcmp_vectors[] =
};
-static int run_gcmp(int idx, struct gcmp_test *vector)
+static int run_gcmp(int idx, const struct gcmp_test *vector)
{
u8 *enc, *plain;
size_t enc_len, plain_len;
diff --git a/wlantest/wlantest.h b/wlantest/wlantest.h
index 1d8088f..29bcab5 100644
--- a/wlantest/wlantest.h
+++ b/wlantest/wlantest.h
@@ -291,9 +291,9 @@ u8 * bip_gmac_protect(const u8 *igtk, size_t igtk_len, u8 *frame, size_t len,
u8 * gcmp_decrypt(const u8 *tk, size_t tk_len, const struct ieee80211_hdr *hdr,
const u8 *data, size_t data_len, size_t *decrypted_len);
-u8 * gcmp_encrypt(const u8 *tk, size_t tk_len, u8 *frame, size_t len,
- size_t hdrlen, u8 *qos,
- u8 *pn, int keyid, size_t *encrypted_len);
+u8 * gcmp_encrypt(const u8 *tk, size_t tk_len, const u8 *frame, size_t len,
+ size_t hdrlen, const u8 *qos,
+ const u8 *pn, int keyid, size_t *encrypted_len);
int ctrl_init(struct wlantest *wt);
void ctrl_deinit(struct wlantest *wt);