Commit 3fb5ec06 authored by David S. Miller's avatar David S. Miller

Merge branch 'ieee802154-for-davem-2017-09-20' of...

Merge branch 'ieee802154-for-davem-2017-09-20' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next

Stefan Schmidt says:

====================
pull-request: ieee802154 2017-09-20

Here comes a pull request for ieee802154 changes I have queued up for
this merge window.

Normally these have been coming through the bluetooth tree but as this
three have been falling through the cracks so far and I have to review
and ack all of them anyway I think it makes sense if I save the
bluetooth people some work and handle them directly.

Its the first pull request I send to you so please let me know if I did
something wrong or if you prefer a different format.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents cddd9523 d5dd29e4
This diff is collapsed.
......@@ -50,6 +50,14 @@ enum atusb_requests {
ATUSB_EUI64_READ,
};
enum {
ATUSB_HW_TYPE_100813, /* 2010-08-13 */
ATUSB_HW_TYPE_101216, /* 2010-12-16 */
ATUSB_HW_TYPE_110131, /* 2011-01-31, ATmega32U2-based */
ATUSB_HW_TYPE_RZUSB, /* Atmel Raven USB dongle with at86rf230 */
ATUSB_HW_TYPE_HULUSB, /* Busware HUL USB dongle with at86rf212 */
};
/*
* Direction bRequest wValue wIndex wLength
*
......
......@@ -623,13 +623,18 @@ llsec_do_encrypt_unauth(struct sk_buff *skb, const struct mac802154_llsec *sec,
u8 iv[16];
struct scatterlist src;
SKCIPHER_REQUEST_ON_STACK(req, key->tfm0);
int err;
int err, datalen;
unsigned char *data;
llsec_geniv(iv, sec->params.hwaddr, &hdr->sec);
sg_init_one(&src, skb->data, skb->len);
/* Compute data payload offset and data length */
data = skb_mac_header(skb) + skb->mac_len;
datalen = skb_tail_pointer(skb) - data;
sg_init_one(&src, data, datalen);
skcipher_request_set_tfm(req, key->tfm0);
skcipher_request_set_callback(req, 0, NULL, NULL);
skcipher_request_set_crypt(req, &src, &src, skb->len, iv);
skcipher_request_set_crypt(req, &src, &src, datalen, iv);
err = crypto_skcipher_encrypt(req);
skcipher_request_zero(req);
return err;
......@@ -713,7 +718,8 @@ int mac802154_llsec_encrypt(struct mac802154_llsec *sec, struct sk_buff *skb)
if (hlen < 0 || hdr.fc.type != IEEE802154_FC_TYPE_DATA)
return -EINVAL;
if (!hdr.fc.security_enabled || hdr.sec.level == 0) {
if (!hdr.fc.security_enabled ||
(hdr.sec.level == IEEE802154_SCF_SECLEVEL_NONE)) {
skb_push(skb, hlen);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment