mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 06:29:23 +01:00
handshake: Add cleanup function for handshake_state
To allow _auto_(handshake_state_free) variables to be used.
This commit is contained in:
parent
52e6a7c2ee
commit
78a39e926f
@ -105,7 +105,12 @@ void __handshake_set_install_ext_tk_func(handshake_install_ext_tk_func_t func)
|
|||||||
|
|
||||||
void handshake_state_free(struct handshake_state *s)
|
void handshake_state_free(struct handshake_state *s)
|
||||||
{
|
{
|
||||||
__typeof__(s->free) destroy = s->free;
|
__typeof__(s->free) destroy;
|
||||||
|
|
||||||
|
if (!s)
|
||||||
|
return;
|
||||||
|
|
||||||
|
destroy = s->free;
|
||||||
|
|
||||||
if (s->in_event) {
|
if (s->in_event) {
|
||||||
s->in_event = false;
|
s->in_event = false;
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <asm/byteorder.h>
|
#include <asm/byteorder.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
#include <ell/cleanup.h>
|
||||||
|
|
||||||
struct handshake_state;
|
struct handshake_state;
|
||||||
enum crypto_cipher;
|
enum crypto_cipher;
|
||||||
@ -298,3 +299,5 @@ const uint8_t *handshake_util_find_pmkid_kde(const uint8_t *data,
|
|||||||
size_t data_len);
|
size_t data_len);
|
||||||
void handshake_util_build_gtk_kde(enum crypto_cipher cipher, const uint8_t *key,
|
void handshake_util_build_gtk_kde(enum crypto_cipher cipher, const uint8_t *key,
|
||||||
unsigned int key_index, uint8_t *to);
|
unsigned int key_index, uint8_t *to);
|
||||||
|
|
||||||
|
DEFINE_CLEANUP_FUNC(handshake_state_free);
|
||||||
|
Loading…
Reference in New Issue
Block a user