From: Alexander Aring <alex.aring@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, netdev@vger.kernel.org,
phoebe.buckheister@itwm.fraunhofer.de,
Alexander Aring <alex.aring@gmail.com>
Subject: [PATCH bluetooth-next 4/4] mac802154: add comments for llsec issues
Date: Mon, 28 Sep 2015 09:00:26 +0200 [thread overview]
Message-ID: <1443423626-3609-5-git-send-email-alex.aring@gmail.com> (raw)
In-Reply-To: <1443423626-3609-1-git-send-email-alex.aring@gmail.com>
While doing a little test with the llsec implementation I saw these
issues. We should move decryption and encruption somewhere else,
otherwise while capturing with wireshark the mac header shows secuirty
fields but the payload is plaintext.
A complete other issue is what doing with HardMAC drivers where the
payload is always plaintext. I think we need a special handling then in
userspace. We currently doesn't support any HardMAC transceivers, so we
should fix the first issue for SoftMAC transceivers.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
net/mac802154/rx.c | 4 ++++
net/mac802154/tx.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c
index d1c33c1..42e9672 100644
--- a/net/mac802154/rx.c
+++ b/net/mac802154/rx.c
@@ -87,6 +87,10 @@ ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata,
skb->dev = sdata->dev;
+ /* TODO this should be moved after netif_receive_skb call, otherwise
+ * wireshark will show a mac header with security fields and the
+ * payload is already decrypted.
+ */
rc = mac802154_llsec_decrypt(&sdata->sec, skb);
if (rc) {
pr_debug("decryption failed: %i\n", rc);
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index 5ee596e..b205bbe 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -129,6 +129,10 @@ ieee802154_subif_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int rc;
+ /* TODO we should move it to wpan_dev_hard_header and dev_hard_header
+ * functions. The reason is wireshark will show a mac header which is
+ * with security fields but the payload is not encrypted.
+ */
rc = mac802154_llsec_encrypt(&sdata->sec, skb);
if (rc) {
netdev_warn(dev, "encryption failed: %i\n", rc);
--
2.5.3
next prev parent reply other threads:[~2015-09-28 7:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 7:00 [PATCH bluetooth-next 0/4] ieee802154: add llsec support over nl802154 Alexander Aring
2015-09-28 7:00 ` [PATCH bluetooth-next 1/4] netlink: add nla_get for le32 and le64 Alexander Aring
2015-09-29 16:08 ` Marcel Holtmann
2015-09-30 4:17 ` David Miller
2015-09-28 7:00 ` [PATCH bluetooth-next 2/4] nl802154: use nla_get_le64 for get extended addr Alexander Aring
2015-09-28 7:00 ` [PATCH bluetooth-next 3/4] nl802154: add support for security layer Alexander Aring
2015-09-28 7:00 ` Alexander Aring [this message]
2015-09-30 11:25 ` [PATCH bluetooth-next 0/4] ieee802154: add llsec support over nl802154 Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443423626-3609-5-git-send-email-alex.aring@gmail.com \
--to=alex.aring@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-wpan@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=phoebe.buckheister@itwm.fraunhofer.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).