keyring.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: LGPL-2.1-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  7. *
  8. *
  9. */
  10. struct keyring_net_key {
  11. uint16_t net_idx;
  12. uint8_t phase;
  13. uint8_t old_key[16];
  14. uint8_t new_key[16];
  15. };
  16. struct keyring_app_key {
  17. uint16_t app_idx;
  18. uint16_t net_idx;
  19. uint8_t old_key[16];
  20. uint8_t new_key[16];
  21. };
  22. bool keyring_put_net_key(struct mesh_node *node, uint16_t net_idx,
  23. struct keyring_net_key *key);
  24. bool keyring_get_net_key(struct mesh_node *node, uint16_t net_idx,
  25. struct keyring_net_key *key);
  26. bool keyring_del_net_key(struct mesh_node *node, uint16_t net_idx);
  27. bool keyring_put_app_key(struct mesh_node *node, uint16_t app_idx,
  28. uint16_t net_idx, struct keyring_app_key *key);
  29. bool keyring_finalize_app_keys(struct mesh_node *node, uint16_t net_id);
  30. bool keyring_get_app_key(struct mesh_node *node, uint16_t app_idx,
  31. struct keyring_app_key *key);
  32. bool keyring_del_app_key(struct mesh_node *node, uint16_t app_idx);
  33. bool keyring_get_remote_dev_key(struct mesh_node *node, uint16_t unicast,
  34. uint8_t dev_key[16]);
  35. bool keyring_put_remote_dev_key(struct mesh_node *node, uint16_t unicast,
  36. uint8_t count, uint8_t dev_key[16]);
  37. bool keyring_del_remote_dev_key(struct mesh_node *node, uint16_t unicast,
  38. uint8_t count);
  39. bool keyring_build_export_keys_reply(struct mesh_node *node,
  40. struct l_dbus_message_builder *builder);