If the AES crypto context is not available we cannot generate new RPAs.
We should therefore cleanly return an error from the function
responsible for updating the random address.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
!bacmp(&hdev->random_addr, &hdev->rpa))
return 0;
+ if (!hdev->tfm_aes) {
+ BT_ERR("%s crypto not available to generate RPA",
+ hdev->name);
+ return -EOPNOTSUPP;
+ }
+
err = smp_generate_rpa(hdev->tfm_aes, hdev->irk, &hdev->rpa);
if (err < 0) {
BT_ERR("%s failed to generate new RPA", hdev->name);