1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Generic netlink HANDSHAKE service.
5 * Author: Chuck Lever <chuck.lever@oracle.com>
7 * Copyright (c) 2023, Oracle and/or its affiliates.
10 #ifndef _NET_HANDSHAKE_H
11 #define _NET_HANDSHAKE_H
20 typedef void (*tls_done_func_t)(void *data, int status,
23 struct tls_handshake_args {
24 struct socket *ta_sock;
25 tls_done_func_t ta_done;
27 unsigned int ta_timeout_ms;
28 key_serial_t ta_keyring;
29 key_serial_t ta_my_cert;
30 key_serial_t ta_my_privkey;
31 unsigned int ta_num_peerids;
32 key_serial_t ta_my_peerids[5];
35 int tls_client_hello_anon(const struct tls_handshake_args *args, gfp_t flags);
36 int tls_client_hello_x509(const struct tls_handshake_args *args, gfp_t flags);
37 int tls_client_hello_psk(const struct tls_handshake_args *args, gfp_t flags);
38 int tls_server_hello_x509(const struct tls_handshake_args *args, gfp_t flags);
39 int tls_server_hello_psk(const struct tls_handshake_args *args, gfp_t flags);
41 bool tls_handshake_cancel(struct sock *sk);
43 #endif /* _NET_HANDSHAKE_H */