mesh: Fixed handling of IVI flag in app layer
authorMichał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Thu, 27 Jun 2019 07:40:42 +0000 (09:40 +0200)
committerAnupam Roy <anupam.r@samsung.com>
Tue, 17 Dec 2019 15:12:20 +0000 (20:42 +0530)
commitc05d700debc68a6892e03c63a748f0943f22d16a
treeb65c129ddee48fa4fa27c09c1a28d5809d4ca10a
parentad89377f8b95b5b1b82214a742cf35edb4408851
mesh: Fixed handling of IVI flag in app layer

Since IV Index is used in application nonces, we need to honor IVI flag
not only in network layer crypto, but also in application layer.

This means that if IVI field of incoming packet is different than in
current IV Index, try to decode *both* net and app layers using IV Index
decreased by one.

Change-Id: Ieaacc703dac4aa8b9a58ea6bf01a92b1893e9b7b
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
mesh/net-keys.c
mesh/net.c