treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36
[sfrench/cifs-2.6.git] / include / keys / request_key_auth-type.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* request_key authorisation token key type
3  *
4  * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.
5  * Written by David Howells (dhowells@redhat.com)
6  */
7
8 #ifndef _KEYS_REQUEST_KEY_AUTH_TYPE_H
9 #define _KEYS_REQUEST_KEY_AUTH_TYPE_H
10
11 #include <linux/key.h>
12
13 /*
14  * Authorisation record for request_key().
15  */
16 struct request_key_auth {
17         struct key              *target_key;
18         struct key              *dest_keyring;
19         const struct cred       *cred;
20         void                    *callout_info;
21         size_t                  callout_len;
22         pid_t                   pid;
23         char                    op[8];
24 } __randomize_layout;
25
26 static inline struct request_key_auth *get_request_key_auth(const struct key *key)
27 {
28         return key->payload.data[0];
29 }
30
31
32 #endif /* _KEYS_REQUEST_KEY_AUTH_TYPE_H */