[PATCH RFC] remove custom Michael MIC implementation

From: Tobin C. Harding
Date: Fri Mar 31 2017 - 00:48:09 EST


This RFC can be applied on op on Linus' tree 89970a0

Configuration options needed to build are

CONFIG_STAGING=y
CONFIG_KS7010=m

The ks7010 driver currently uses a custom implementation of the
Michael MIC algorithm. The kernel has an implementation of this
algorithm already. This patch is an attempt to replace the custom
implementation with the in-tree implementation via the kernel
cryptography API.

I am not an expert on the Michael Message Integrity Check or on
cryptography in general. Actually, I'm not even an expert on kernel
development.

I believe I have mirrored the behavior of the custom implementation. I
do not know if I have done this completely correctly or, for that
matter, if I have gone about it correctly. The only in-tree driver I
could find that does the MIC check in software was the Orinoco driver
(net/wireless/intersil/orinoco). I based this code off of the Orinoco
code and the current implementation.

The whole thing is in one patch since there was no way to keep the
driver in a sane state during the implementation replacement.

The steps I took were as follows;

1. Remove the custom implementation, michael_mic.[ch]

2. Implement helper functions that call the kernel crypto API, this is
the code that is based of Orinoco, mic.[ch]

3. Replace driver calls to the custom implementation with calls to the
newly defined helper functions.


The code is untested, I have hardware in the mail.

If any one is interested and has any comments I would really like to
hear them. I am open to all suggestions (even down to trivial coding
style issues).

Thank you for taking the time to read this and for any tips you may be
able to give me.

thanks,
Tobin.

Tobin C. Harding (1):
staging: ks7010: remove custom Michael MIC implementation

drivers/staging/ks7010/Makefile | 2 +-
drivers/staging/ks7010/ks_hostif.c | 48 +++++++-----
drivers/staging/ks7010/ks_wlan.h | 3 +
drivers/staging/ks7010/mic.c | 131 +++++++++++++++++++++++++++++++
drivers/staging/ks7010/mic.h | 22 ++++++
drivers/staging/ks7010/michael_mic.c | 148 -----------------------------------
drivers/staging/ks7010/michael_mic.h | 25 ------
7 files changed, 186 insertions(+), 193 deletions(-)
create mode 100644 drivers/staging/ks7010/mic.c
create mode 100644 drivers/staging/ks7010/mic.h
delete mode 100644 drivers/staging/ks7010/michael_mic.c
delete mode 100644 drivers/staging/ks7010/michael_mic.h

--
2.7.4