Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net80211 Style, no functional change.



details:   https://anonhg.NetBSD.org/src/rev/053a91e7a191
branches:  trunk
changeset: 829139:053a91e7a191
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Jan 19 07:53:46 2018 +0000

description:
Style, no functional change.

diffstat:

 sys/net80211/ieee80211_crypto_ccmp.c |  29 +++++++++++++++++++----------
 sys/net80211/ieee80211_crypto_none.c |  10 ++++++----
 2 files changed, 25 insertions(+), 14 deletions(-)

diffs (170 lines):

diff -r 7bd327e6e625 -r 053a91e7a191 sys/net80211/ieee80211_crypto_ccmp.c
--- a/sys/net80211/ieee80211_crypto_ccmp.c      Fri Jan 19 07:53:01 2018 +0000
+++ b/sys/net80211/ieee80211_crypto_ccmp.c      Fri Jan 19 07:53:46 2018 +0000
@@ -1,4 +1,6 @@
-/*-
+/*     $NetBSD: ieee80211_crypto_ccmp.c,v 1.13 2018/01/19 07:54:34 maxv Exp $  */
+
+/*
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
  * All rights reserved.
  *
@@ -34,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto_ccmp.c,v 1.7 2005/07/11 03:06:23 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_ccmp.c,v 1.12 2018/01/17 17:41:38 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_ccmp.c,v 1.13 2018/01/19 07:54:34 maxv Exp $");
 #endif
 
 /*
@@ -46,7 +48,7 @@
  */
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/mbuf.h> 
+#include <sys/mbuf.h>
 #include <sys/malloc.h>
 #include <sys/kernel.h>
 
@@ -64,7 +66,7 @@
 
 struct ccmp_ctx {
        struct ieee80211com *cc_ic;     /* for diagnostics */
-       rijndael_ctx         cc_aes;
+       rijndael_ctx cc_aes;
 };
 
 static void *ccmp_attach(struct ieee80211com *, struct ieee80211_key *);
@@ -102,8 +104,7 @@
 {
        struct ccmp_ctx *ctx;
 
-       ctx = malloc(sizeof(struct ccmp_ctx),
-               M_DEVBUF, M_NOWAIT | M_ZERO);
+       ctx = malloc(sizeof(struct ccmp_ctx), M_DEVBUF, M_NOWAIT | M_ZERO);
        if (ctx == NULL) {
                ic->ic_stats.is_crypto_nomem++;
                return NULL;
@@ -258,8 +259,7 @@
  * Verify and strip MIC from the frame.
  */
 static int
-ccmp_demic(struct ieee80211_key *k, struct mbuf *m,
-    int force)
+ccmp_demic(struct ieee80211_key *k, struct mbuf *m, int force)
 {
        return 1;
 }
@@ -419,6 +419,7 @@
        for (;;) {
                if (space > data_len)
                        space = data_len;
+
                /*
                 * Do full blocks.
                 */
@@ -430,6 +431,7 @@
                }
                if (data_len <= 0)              /* no more data */
                        break;
+
                m = m->m_next;
                if (m == NULL) {                /* last buffer */
                        if (space != 0) {
@@ -472,7 +474,7 @@
                                }
                                /*
                                 * This mbuf's contents are insufficient,
-                                * take 'em all and prepare to advance to
+                                * take them all and prepare to advance to
                                 * the next mbuf.
                                 */
                                xor_block(b+sp, pos_next, n->m_len);
@@ -501,6 +503,7 @@
                                if (m == NULL)
                                        goto done;
                        }
+
                        /*
                         * Do bookkeeping.  m now points to the last mbuf
                         * we grabbed data from.  We know we consumed a
@@ -521,6 +524,7 @@
                        space = m->m_len;
                }
        }
+
 done:
        /* tack on MIC */
        xor_block(b, s0, ccmp.ic_trailer);
@@ -540,7 +544,8 @@
 } while (0)
 
 static int
-ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen)
+ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m,
+    int hdrlen)
 {
        struct ccmp_ctx *ctx = key->wk_private;
        struct ieee80211_frame *wh;
@@ -574,12 +579,14 @@
                }
                if (data_len <= 0)              /* no more data */
                        break;
+
                m = m->m_next;
                if (m == NULL) {                /* last buffer */
                        if (space != 0)         /* short last block */
                                CCMP_DECRYPT(i, b, b0, pos, a, space);
                        break;
                }
+
                if (space != 0) {
                        uint8_t *pos_next;
                        u_int space_next;
@@ -614,6 +621,7 @@
                        space = m->m_len;
                }
        }
+
        if (memcmp(mic, a, ccmp.ic_trailer) != 0) {
                IEEE80211_DPRINTF(ctx->cc_ic, IEEE80211_MSG_CRYPTO,
                        "[%s] AES-CCM decrypt failed; MIC mismatch\n",
@@ -621,6 +629,7 @@
                ctx->cc_ic->ic_stats.is_rx_ccmpmic++;
                return 0;
        }
+
        return 1;
 }
 #undef CCMP_DECRYPT
diff -r 7bd327e6e625 -r 053a91e7a191 sys/net80211/ieee80211_crypto_none.c
--- a/sys/net80211/ieee80211_crypto_none.c      Fri Jan 19 07:53:01 2018 +0000
+++ b/sys/net80211/ieee80211_crypto_none.c      Fri Jan 19 07:53:46 2018 +0000
@@ -1,4 +1,6 @@
-/*-
+/*     $NetBSD: ieee80211_crypto_none.c,v 1.8 2018/01/19 07:53:46 maxv Exp $   */
+
+/*
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
  * All rights reserved.
  *
@@ -34,15 +36,15 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto_none.c,v 1.5 2005/06/10 16:11:24 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_none.c,v 1.7 2006/11/16 01:33:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_none.c,v 1.8 2018/01/19 07:53:46 maxv Exp $");
 #endif
 
 /*
  * IEEE 802.11 NULL crypto support.
  */
 #include <sys/param.h>
-#include <sys/systm.h> 
-#include <sys/mbuf.h>   
+#include <sys/systm.h>
+#include <sys/mbuf.h>
 
 #include <sys/socket.h>
 



Home | Main Index | Thread Index | Old Index