/linux/security/keys/ |
H A D | key.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* Basic authentication token and access key management 4 * Copyright (C) 2004-2008 Red Hat, Inc. All Rights Reserved. 26 unsigned int key_quota_root_maxkeys = 1000000; /* root's key count quota */ 27 unsigned int key_quota_root_maxbytes = 25000000; /* root's key space quota */ 28 unsigned int key_quota_maxkeys = 200; /* general key count quota */ 29 unsigned int key_quota_maxbytes = 20000; /* general key space quota */ 34 /* We serialise key instantiation and link */ 38 void __key_check(const struct key *key) in __key_check() argument 40 printk("__key_check: key %p {%08x} should be {%08x}\n", in __key_check() [all …]
|
H A D | request_key.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* Request a key from userspace 4 * Copyright (C) 2004-2007 Red Hat, Inc. All Rights Reserved. 7 * See Documentation/security/keys/request-key.rst 18 #include <keys/request_key_auth-type.h> 20 #define key_negative_timeout 60 /* default timeout on a negative key's existence */ 22 static struct key *check_cached_key(struct keyring_search_context *ctx) in check_cached_key() 25 struct key *key = current->cached_requested_key; in check_cached_key() local 27 if (key && in check_cached_key() 28 ctx->match_data.cmp(key, &ctx->match_data) && in check_cached_key() [all …]
|
H A D | gc.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* Key garbage collector 4 * Copyright (C) 2009-2011 Red Hat, Inc. All Rights Reserved. 10 #include <keys/keyring-type.h> 14 * Delay between key revocation/expiry in seconds 34 #define KEY_GC_KEY_EXPIRED 0 /* A key expired and needs unlinking */ 40 * Any key whose type gets unregistered will be re-typed to this if it can't be 49 * - time precision isn't particularly important 56 kenter("%lld", gc_at - now); in key_schedule_gc() 64 expires = jiffies + (gc_at - now) * HZ; in key_schedule_gc() [all …]
|
H A D | keyring.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 4 * Copyright (C) 2004-2005, 2008, 2013 Red Hat, Inc. All Rights Reserved. 17 #include <keys/keyring-type.h> 18 #include <keys/user-type.h> 25 * When plumbing the depths of the key tree, this sets a hard limit 40 static inline struct key *keyring_ptr_to_key(const struct assoc_array_ptr *x) in keyring_ptr_to_key() 43 return (struct key *)((unsigned long)object & ~KEYRING_PTR_SUBTYPE); in keyring_ptr_to_key() 45 static inline void *keyring_key_to_ptr(struct key *key) in keyring_key_to_ptr() argument 47 if (key->type == &key_type_keyring) in keyring_key_to_ptr() 48 return (void *)((unsigned long)key | KEYRING_PTR_SUBTYPE); in keyring_key_to_ptr() [all …]
|
H A D | keyctl.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* Userspace key control operations 4 * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved. 13 #include <linux/key.h> 24 #include <keys/request_key_auth-type.h> 55 return -EINVAL; in key_get_type_from_user() 57 return -EPERM; in key_get_type_from_user() 58 type[len - 1] = '\0'; in key_get_type_from_user() 63 * Extract the description of a new key from userspace and either add it as a 64 * new key to the specified keyring or update a matching key in that keyring. [all …]
|
/linux/tools/testing/selftests/bpf/ |
H A D | test_lru_map.c | 1 // SPDX-License-Identifier: GPL-2.0-only 36 if (map_fd == -1) in create_map() 42 static int bpf_map_lookup_elem_with_ref_bit(int fd, unsigned long long key, in bpf_map_lookup_elem_with_ref_bit() argument 48 BPF_LD_IMM64(BPF_REG_3, key), in bpf_map_lookup_elem_with_ref_bit() 50 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), in bpf_map_lookup_elem_with_ref_bit() 71 return -1; in bpf_map_lookup_elem_with_ref_bit() 78 return -1; in bpf_map_lookup_elem_with_ref_bit() 83 ret = -1; in bpf_map_lookup_elem_with_ref_bit() 103 printf("key:%llu not found from map. %s(%d)\n", in map_subset() 108 printf("key:%llu value0:%llu != value1:%llu\n", in map_subset() [all …]
|
/linux/fs/ubifs/ |
H A D | key.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 5 * Copyright (C) 2006-2008 Nokia Corporation. 12 * This header contains various key-related definitions and helper function. 13 * UBIFS allows several key schemes, so we access key fields only via these 14 * helpers. At the moment only one key scheme is supported. 16 * Simple key scheme 19 * Keys are 64-bits long. First 32-bits are inode number (parent inode number 20 * in case of direntry key). Next 3 bits are node type. The last 29 bits are 26 * Lot's of the key helpers require a struct ubifs_info *c as the first parameter. 28 * different c->key_format. But right now, there is only one key type, UBIFS_SIMPLE_KEY_FMT. [all …]
|
/linux/drivers/net/wireless/silabs/wfx/ |
H A D | key.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Key management related functions. 5 * Copyright (c) 2017-2020, Silicon Laboratories, Inc. 6 * Copyright (c) 2010, ST-Ericsson 11 #include "key.h" 19 idx = ffs(~wdev->key_map) - 1; in wfx_alloc_key() 21 return -1; in wfx_alloc_key() 23 wdev->key_map |= BIT(idx); in wfx_alloc_key() 29 WARN(!(wdev->key_map & BIT(idx)), "inconsistent key allocation"); in wfx_free_key() 30 wdev->key_map &= ~BIT(idx); in wfx_free_key() [all …]
|
/linux/net/mac80211/ |
H A D | key.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright 2002-2005, Instant802 Networks, Inc. 4 * Copyright 2005-2006, Devicescape Software, Inc. 5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 6 * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net> 7 * Copyright 2013-2014 Intel Mobile Communications GmbH 8 * Copyright 2015-2017 Intel Deutschland GmbH 9 * Copyright 2018-2020, 2022-2024 Intel Corporation 23 #include "driver-ops.h" 32 * DOC: Key handling basics [all …]
|
/linux/tools/testing/selftests/bpf/progs/ |
H A D | test_tunnel_kern.c | 1 // SPDX-License-Identifier: GPL-2.0 53 __type(key, __u32); 61 struct bpf_tunnel_key key; in gre_set_tunnel() local 63 __builtin_memset(&key, 0x0, sizeof(key)); in gre_set_tunnel() 64 key.remote_ipv4 = 0xac100164; /* 172.16.1.100 */ in gre_set_tunnel() 65 key.tunnel_id = 2; in gre_set_tunnel() 66 key.tunnel_tos = 0; in gre_set_tunnel() 67 key.tunnel_ttl = 64; in gre_set_tunnel() 69 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in gre_set_tunnel() 83 struct bpf_tunnel_key key; in gre_set_tunnel_no_key() local [all …]
|
/linux/Documentation/security/keys/ |
H A D | core.rst | 2 Kernel Key Retention Service 5 This service allows cryptographic keys, authentication tokens, cross-domain 9 Keyrings are permitted; these are a special type of key that can hold links to 13 The key service can be configured on by enabling: 15 "Security options"/"Enable access key retention support" (CONFIG_KEYS) 22 Key Overview 26 tokens, keyrings, etc.. These are represented in the kernel by struct key. 28 Each key has a number of attributes: 30 - A serial number. 31 - A type. [all …]
|
H A D | request-key.rst | 2 Key Request Service 5 The key request service is part of the key retention service (refer to 12 struct key *request_key(const struct key_type *type, 18 struct key *request_key_tag(const struct key_type *type, 25 struct key *request_key_with_auxdata(const struct key_type *type, 34 struct key *request_key_rcu(const struct key_type *type, 45 The main difference between the access points is that the in-kernel interface 46 does not need to link the key to a keyring to prevent it from being immediately 47 destroyed. The kernel interface returns a pointer directly to the key, and 48 it's up to the caller to destroy the key. [all …]
|
/linux/include/linux/ |
H A D | key.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* Authentication token and access key management 27 /* key handle serial number */ 30 /* key handle permissions mask */ 33 struct key; 40 #define KEY_POS_VIEW 0x01000000 /* possessor can view a key's attributes */ 41 #define KEY_POS_READ 0x02000000 /* possessor can read key payload / view keyring */ 42 #define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */ 43 #define KEY_POS_SEARCH 0x08000000 /* possessor can find a key in search / search a keyring */ 44 #define KEY_POS_LINK 0x10000000 /* possessor can create a link to a key/keyring */ [all …]
|
H A D | key-type.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* Definitions for key type implementations 11 #include <linux/key.h> 20 * Pre-parsed payload, used by key add, update and instantiate. 24 * def_datalen from the key type. Then if the preparse() op is provided by the 25 * key type, that will be called. Then the struct will be passed to the 33 char *description; /* Proposed key description (or NULL) */ 38 time64_t expiry; /* Expiry time of key */ 41 typedef int (*request_key_actor_t)(struct key *auth_key, void *aux); 48 * overridden by type->match_preparse(). Should return true if a match [all …]
|
/linux/arch/x86/crypto/ |
H A D | aesni-intel_asm.S | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 3 * Implement AES algorithm in Intel AES-NI instructions. 5 * The white paper of AES-NI instructions can be downloaded from: 6 * http://softwarecommunity.intel.com/isn/downloads/intelavx/AES-Instructions-Set_WP.pdf 32 #define KEY %xmm2 macro 147 movups (UKEYP), %xmm0 # user key (first 16 bytes) 149 lea 0x10(KEYP), TKEYP # key addr 155 movups 0x10(UKEYP), %xmm2 # other user key 186 movq 0x10(UKEYP), %xmm2 # other user key 232 lea 240-16(TKEYP), UKEYP [all …]
|
/linux/crypto/ |
H A D | rsa_helper.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * RSA key extract helper 19 struct rsa_key *key = context; in rsa_get_n() local 23 /* invalid key provided */ in rsa_get_n() 25 return -EINVAL; in rsa_get_n() 30 n_sz--; in rsa_get_n() 33 /* In FIPS mode only allow key size 2K and higher */ in rsa_get_n() 35 pr_err("RSA: key size not allowed in FIPS mode\n"); in rsa_get_n() 36 return -EINVAL; in rsa_get_n() 40 key->n = value; in rsa_get_n() [all …]
|
/linux/kernel/ |
H A D | jump_label.c | 1 // SPDX-License-Identifier: GPL-2.0-only 41 * Entrires are sorted by key. in jump_label_cmp() 44 return -1; in jump_label_cmp() 55 return -1; in jump_label_cmp() 65 long delta = (unsigned long)a - (unsigned long)b; in jump_label_swap() 70 jea->code = jeb->code - delta; in jump_label_swap() 71 jea->target = jeb->target - delta; in jump_label_swap() 72 jea->key = jeb->key - delta; in jump_label_swap() 74 jeb->code = tmp.code + delta; in jump_label_swap() 75 jeb->target = tmp.target + delta; in jump_label_swap() [all …]
|
/linux/include/linux/platform_data/ |
H A D | keyboard-spear.h | 20 KEY(0, 0, KEY_ESC), \ 21 KEY(0, 1, KEY_1), \ 22 KEY(0, 2, KEY_2), \ 23 KEY(0, 3, KEY_3), \ 24 KEY(0, 4, KEY_4), \ 25 KEY(0, 5, KEY_5), \ 26 KEY(0, 6, KEY_6), \ 27 KEY(0, 7, KEY_7), \ 28 KEY(0, 8, KEY_8), \ 29 KEY(1, 0, KEY_9), \ [all …]
|
/linux/arch/s390/include/uapi/asm/ |
H A D | pkey.h | 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 23 #define SECKEYBLOBSIZE 64 /* secure key blob size is always 64 bytes */ 24 #define PROTKEYBLOBSIZE 80 /* protected key blob size is always 80 bytes */ 25 #define MAXPROTKEYSIZE 64 /* a protected key blob may be up to 64 bytes */ 26 #define MAXCLRKEYSIZE 32 /* a clear key value may be up to 32 bytes */ 28 #define MINEP11AESKEYBLOBSIZE 256 /* min EP11 AES key blob size */ 29 #define MAXEP11AESKEYBLOBSIZE 336 /* max EP11 AES key blob size */ 31 /* Minimum size of a key blob */ 60 /* the newer ioctls use a pkey_key_size enum for key size information */ 88 /* Struct to hold a CCA AES secure key blob */ [all …]
|
/linux/net/openvswitch/ |
H A D | flow.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2007-2014 Nicira, Inc. 52 idle_ms = jiffies_to_msecs(jiffies - flow_jiffies); in ovs_flow_used_time() 56 return cur_ms - idle_ms; in ovs_flow_used_time() 66 int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0); in ovs_flow_stats_update() 68 stats = rcu_dereference(flow->stats[cpu]); in ovs_flow_stats_update() 70 /* Check if already have CPU-specific stats. */ in ovs_flow_stats_update() 72 spin_lock(&stats->lock); in ovs_flow_stats_update() 73 /* Mark if we write on the pre-allocated stats. */ in ovs_flow_stats_update() 74 if (cpu == 0 && unlikely(flow->stats_last_writer != cpu)) in ovs_flow_stats_update() [all …]
|
/linux/Documentation/crypto/ |
H A D | asymmetric-keys.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 Asymmetric / Public-key Cryptography Key Type 9 - Overview. 10 - Key identification. 11 - Accessing asymmetric keys. 12 - Signature verification. 13 - Asymmetric key subtypes. 14 - Instantiation data parsers. 15 - Keyring link restrictions. 21 The "asymmetric" key type is designed to be a container for the keys used in [all …]
|
/linux/drivers/nvdimm/ |
H A D | security.c | 1 // SPDX-License-Identifier: GPL-2.0 11 #include <linux/key.h> 12 #include <linux/key-type.h> 13 #include <keys/user-type.h> 14 #include <keys/encrypted-type.h> 15 #include "nd-core.h" 23 MODULE_PARM_DESC(key_revalidate, "Require key validation at init."); 27 static void *key_data(struct key *key) in key_data() argument 29 struct encrypted_key_payload *epayload = dereference_key_locked(key); in key_data() 31 lockdep_assert_held_read(&key->sem); in key_data() [all …]
|
/linux/drivers/s390/crypto/ |
H A D | zcrypt_cca_key.h | 1 /* SPDX-License-Identifier: GPL-2.0+ */ 21 * mapping for the cca private ME key token. 25 * mapping for the cca key token header 40 * In a private key, the modulus doesn't appear in the public 51 unsigned short modulus_byte_len; /* In a private key, this is 0 */ 55 * mapping for the cca private CRT key 'token' 92 * Set up private key fields of a type6 MEX message. 95 * @p: pointer to memory area for the key 97 * Returns the size of the key area or negative errno value. 112 } __packed *key = p; in zcrypt_type6_mex_key_en() local [all …]
|
/linux/net/ceph/ |
H A D | crypto.c | 1 // SPDX-License-Identifier: GPL-2.0 11 #include <linux/key-type.h> 14 #include <keys/ceph-type.h> 15 #include <keys/user-type.h> 20 * Set ->key and ->tfm. The rest of the key should be filled in before 23 static int set_secret(struct ceph_crypto_key *key, void *buf) in set_secret() argument 28 key->key = NULL; in set_secret() 29 key->tfm = NULL; in set_secret() 31 switch (key->type) { in set_secret() 37 return -ENOTSUPP; in set_secret() [all …]
|
/linux/fs/nilfs2/ |
H A D | direct.c | 1 // SPDX-License-Identifier: GPL-2.0+ 5 * Copyright (C) 2006-2008 Nippon Telegraph and Telephone Corporation. 20 ((struct nilfs_direct_node *)direct->b_u.u_data + 1); in nilfs_direct_dptrs() 24 nilfs_direct_get_ptr(const struct nilfs_bmap *direct, __u64 key) in nilfs_direct_get_ptr() argument 26 return le64_to_cpu(*(nilfs_direct_dptrs(direct) + key)); in nilfs_direct_get_ptr() 30 __u64 key, __u64 ptr) in nilfs_direct_set_ptr() argument 32 *(nilfs_direct_dptrs(direct) + key) = cpu_to_le64(ptr); in nilfs_direct_set_ptr() 36 __u64 key, int level, __u64 *ptrp) in nilfs_direct_lookup() argument 40 if (key > NILFS_DIRECT_KEY_MAX || level != 1) in nilfs_direct_lookup() 41 return -ENOENT; in nilfs_direct_lookup() [all …]
|