]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OpenSSL: Silence sparse warnings in fips186_2_prf()
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 23 Jun 2016 22:53:27 +0000 (01:53 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 24 Jun 2016 16:02:58 +0000 (19:02 +0300)
Use WPA_PUT_BE32() instead of inplace conversion with host_to_be32() to
avoid sparse warnings.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/crypto/fips_prf_openssl.c

index 9d094b822a66e5529b5c326269ae6312f03a3ab4..4697e041093a8e94098c5cde7e3a1fb52fdcfc01 100644 (file)
@@ -76,12 +76,11 @@ int fips186_2_prf(const u8 *seed, size_t seed_len, u8 *x, size_t xlen)
                        /* w_i = G(t, XVAL) */
                        os_memcpy(_t, t, 20);
                        sha1_transform(_t, xkey);
-                       _t[0] = host_to_be32(_t[0]);
-                       _t[1] = host_to_be32(_t[1]);
-                       _t[2] = host_to_be32(_t[2]);
-                       _t[3] = host_to_be32(_t[3]);
-                       _t[4] = host_to_be32(_t[4]);
-                       os_memcpy(xpos, _t, 20);
+                       WPA_PUT_BE32(xpos, _t[0]);
+                       WPA_PUT_BE32(xpos + 4, _t[1]);
+                       WPA_PUT_BE32(xpos + 8, _t[2]);
+                       WPA_PUT_BE32(xpos + 12, _t[3]);
+                       WPA_PUT_BE32(xpos + 16, _t[4]);
 
                        /* XKEY = (1 + XKEY + w_i) mod 2^b */
                        carry = 1;