/openbmc/linux/security/keys/ |
H A D | key.c | 39 void __key_check(const struct key *key) in __key_check() argument 42 key, key->magic, KEY_DEBUG_MAGIC); in __key_check() 134 static inline void key_alloc_serial(struct key *key) in key_alloc_serial() argument 137 struct key *xkey; in key_alloc_serial() 142 get_random_bytes(&key->serial, sizeof(key->serial)); in key_alloc_serial() 144 key->serial >>= 1; /* negative numbers are not permitted */ in key_alloc_serial() 145 } while (key->serial < 3); in key_alloc_serial() 155 xkey = rb_entry(parent, struct key, serial_node); in key_alloc_serial() 157 if (key->serial < xkey->serial) in key_alloc_serial() 159 else if (key->serial > xkey->serial) in key_alloc_serial() [all …]
|
H A D | request_key.c | 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() 29 !(key->flags & ((1 << KEY_FLAG_INVALIDATED) | in check_cached_key() 31 return key_get(key); in check_cached_key() 36 static void cache_requested_key(struct key *key) in cache_requested_key() argument 44 t->cached_requested_key = key_get(key); in cache_requested_key() 59 void complete_request_key(struct key *authkey, int error) in complete_request_key() 62 struct key *key = rka->target_key; in complete_request_key() local [all …]
|
H A D | gc.c | 72 void key_set_expiry(struct key *key, time64_t expiry) in key_set_expiry() argument 74 key->expiry = expiry; in key_set_expiry() 76 if (!(key->type->flags & KEY_TYPE_INSTANT_REAP)) in key_set_expiry() 138 struct key *key = in key_gc_unused_keys() local 139 list_entry(keys->next, struct key, graveyard_link); in key_gc_unused_keys() 140 short state = key->state; in key_gc_unused_keys() 142 list_del(&key->graveyard_link); in key_gc_unused_keys() 144 kdebug("- %u", key->serial); in key_gc_unused_keys() 145 key_check(key); in key_gc_unused_keys() 148 remove_watch_list(key->watchers, key->serial); in key_gc_unused_keys() [all …]
|
/openbmc/linux/tools/testing/selftests/bpf/progs/ |
H A D | test_tunnel_kern.c | 73 __type(key, __u32); 81 struct bpf_tunnel_key key; in gre_set_tunnel() local 83 __builtin_memset(&key, 0x0, sizeof(key)); in gre_set_tunnel() 84 key.remote_ipv4 = 0xac100164; /* 172.16.1.100 */ in gre_set_tunnel() 85 key.tunnel_id = 2; in gre_set_tunnel() 86 key.tunnel_tos = 0; in gre_set_tunnel() 87 key.tunnel_ttl = 64; in gre_set_tunnel() 89 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in gre_set_tunnel() 103 struct bpf_tunnel_key key; in gre_set_tunnel_no_key() local 105 __builtin_memset(&key, 0x0, sizeof(key)); in gre_set_tunnel_no_key() [all …]
|
/openbmc/qemu/hw/usb/ |
H A D | u2f-emulated.c | 104 static void u2f_emulated_reset(U2FEmulatedState *key) in u2f_emulated_reset() argument 106 key->pending_out_start = 0; in u2f_emulated_reset() 107 key->pending_out_end = 0; in u2f_emulated_reset() 108 key->pending_out_num = 0; in u2f_emulated_reset() 111 static void u2f_pending_out_add(U2FEmulatedState *key, in u2f_pending_out_add() argument 116 if (key->pending_out_num >= PENDING_OUT_NUM) { in u2f_pending_out_add() 120 index = key->pending_out_end; in u2f_pending_out_add() 121 key->pending_out_end = (index + 1) % PENDING_OUT_NUM; in u2f_pending_out_add() 122 ++key->pending_out_num; in u2f_pending_out_add() 124 memcpy(&key->pending_out[index], packet, U2FHID_PACKET_SIZE); in u2f_pending_out_add() [all …]
|
H A D | u2f-passthru.c | 118 static void u2f_passthru_reset(U2FPassthruState *key) in u2f_passthru_reset() argument 120 timer_del(&key->timer); in u2f_passthru_reset() 121 qemu_set_fd_handler(key->hidraw_fd, NULL, NULL, key); in u2f_passthru_reset() 122 key->last_transaction_time = 0; in u2f_passthru_reset() 123 key->current_transactions_start = 0; in u2f_passthru_reset() 124 key->current_transactions_end = 0; in u2f_passthru_reset() 125 key->current_transactions_num = 0; in u2f_passthru_reset() 130 U2FPassthruState *key = opaque; in u2f_timeout_check() local 133 if (time > key->last_transaction_time + TRANSACTION_TIMEOUT) { in u2f_timeout_check() 134 u2f_passthru_reset(key); in u2f_timeout_check() [all …]
|
/openbmc/linux/crypto/ |
H A D | testmgr.h | 39 const char *key; member 67 const char *key; member 108 const char *key; member 125 const char *key; member 152 const unsigned char *key; member 187 .key = 230 .key = 297 .key = 405 .key = 449 .key = [all …]
|
H A D | rsa_helper.c | 19 struct rsa_key *key = context; in rsa_get_n() local 40 key->n = value; in rsa_get_n() 41 key->n_sz = vlen; in rsa_get_n() 49 struct rsa_key *key = context; in rsa_get_e() local 52 if (!value || !key->n_sz || !vlen || vlen > key->n_sz) in rsa_get_e() 55 key->e = value; in rsa_get_e() 56 key->e_sz = vlen; in rsa_get_e() 64 struct rsa_key *key = context; in rsa_get_d() local 67 if (!value || !key->n_sz || !vlen || vlen > key->n_sz) in rsa_get_d() 70 key->d = value; in rsa_get_d() [all …]
|
/openbmc/linux/tools/testing/selftests/bpf/ |
H A D | test_lru_map.c | 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() 151 unsigned long long key, value[nr_cpus]; in test_lru_sanity0() local 173 key = 1; in test_lru_sanity0() 174 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0() 175 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0() 179 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity0() 182 assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -EINVAL); in test_lru_sanity0() 187 key = 2; in test_lru_sanity0() 188 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0() [all …]
|
/openbmc/linux/kernel/ |
H A D | jump_label.c | 72 jea->key = jeb->key - delta; in jump_label_swap() 76 jeb->key = tmp.key + delta; in jump_label_swap() 93 static void jump_label_update(struct static_key *key); 104 int static_key_count(struct static_key *key) in static_key_count() argument 110 int n = atomic_read(&key->enabled); in static_key_count() 127 bool static_key_fast_inc_not_disabled(struct static_key *key) in static_key_fast_inc_not_disabled() argument 131 STATIC_KEY_CHECK_USE(key); in static_key_fast_inc_not_disabled() 138 v = atomic_read(&key->enabled); in static_key_fast_inc_not_disabled() 142 } while (!likely(atomic_try_cmpxchg(&key->enabled, &v, v + 1))); in static_key_fast_inc_not_disabled() 148 bool static_key_slow_inc_cpuslocked(struct static_key *key) in static_key_slow_inc_cpuslocked() argument [all …]
|
/openbmc/linux/drivers/net/wireless/silabs/wfx/ |
H A D | key.c | 34 struct ieee80211_key_conf *key, u8 *peer_addr) in fill_wep_pair() argument 36 WARN(key->keylen > sizeof(msg->key_data), "inconsistent data"); in fill_wep_pair() 37 msg->key_length = key->keylen; in fill_wep_pair() 38 memcpy(msg->key_data, key->key, key->keylen); in fill_wep_pair() 44 struct ieee80211_key_conf *key) in fill_wep_group() argument 46 WARN(key->keylen > sizeof(msg->key_data), "inconsistent data"); in fill_wep_group() 47 msg->key_id = key->keyidx; in fill_wep_group() 48 msg->key_length = key->keylen; in fill_wep_group() 49 memcpy(msg->key_data, key->key, key->keylen); in fill_wep_group() 54 struct ieee80211_key_conf *key, u8 *peer_addr) in fill_tkip_pair() argument [all …]
|
/openbmc/u-boot/lib/rsa/ |
H A D | rsa-mod-exp.c | 36 static void subtract_modulus(const struct rsa_public_key *key, uint32_t num[]) in subtract_modulus() argument 41 for (i = 0; i < key->len; i++) { in subtract_modulus() 42 acc += (uint64_t)num[i] - key->modulus[i]; in subtract_modulus() 55 static int greater_equal_modulus(const struct rsa_public_key *key, in greater_equal_modulus() argument 60 for (i = (int)key->len - 1; i >= 0; i--) { in greater_equal_modulus() 61 if (num[i] < key->modulus[i]) in greater_equal_modulus() 63 if (num[i] > key->modulus[i]) in greater_equal_modulus() 80 static void montgomery_mul_add_step(const struct rsa_public_key *key, in montgomery_mul_add_step() argument 88 d0 = (uint32_t)acc_a * key->n0inv; in montgomery_mul_add_step() 89 acc_b = (uint64_t)d0 * key->modulus[0] + (uint32_t)acc_a; in montgomery_mul_add_step() [all …]
|
/openbmc/linux/net/mac80211/ |
H A D | key.c | 125 static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key) in ieee80211_key_enable_hw_accel() argument 127 struct ieee80211_sub_if_data *sdata = key->sdata; in ieee80211_key_enable_hw_accel() 133 if (key->flags & KEY_FLAG_TAINTED) { in ieee80211_key_enable_hw_accel() 141 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE && in ieee80211_key_enable_hw_accel() 142 !(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC | in ieee80211_key_enable_hw_accel() 147 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; in ieee80211_key_enable_hw_accel() 151 if (!key->local->ops->set_key) in ieee80211_key_enable_hw_accel() 154 assert_key_lock(key->local); in ieee80211_key_enable_hw_accel() 156 sta = key->sta; in ieee80211_key_enable_hw_accel() 162 if (sta && !(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE) && in ieee80211_key_enable_hw_accel() [all …]
|
/openbmc/linux/include/linux/ |
H A D | key.h | 33 struct key; 155 static inline key_ref_t make_key_ref(const struct key *key, in make_key_ref() argument 158 return (key_ref_t) ((unsigned long) key | possession); in make_key_ref() 161 static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) in key_ref_to_ptr() 163 return (struct key *) ((unsigned long) key_ref & ~1UL); in key_ref_to_ptr() 171 typedef int (*key_restrict_link_func_t)(struct key *dest_keyring, 174 struct key *restriction_key); 178 struct key *key; member 195 struct key { struct 283 extern struct key *key_alloc(struct key_type *type, [all …]
|
H A D | jump_label.h | 81 #define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \ argument 83 __func__, (key)) 120 long key; // key may be far away from the core kernel under KASLR member 135 long offset = entry->key & ~3L; in jump_entry_key() 137 return (struct static_key *)((unsigned long)&entry->key + offset); in jump_entry_key() 154 return (struct static_key *)((unsigned long)entry->key & ~3UL); in jump_entry_key() 161 return (unsigned long)entry->key & 1UL; in jump_entry_is_branch() 166 return (unsigned long)entry->key & 2UL; in jump_entry_is_init() 172 entry->key |= 2; in jump_entry_set_init() 174 entry->key &= ~2; in jump_entry_set_init() [all …]
|
H A D | key-type.h | 41 typedef int (*request_key_actor_t)(struct key *auth_key, void *aux); 51 bool (*cmp)(const struct key *key, 95 int (*instantiate)(struct key *key, struct key_preparsed_payload *prep); 102 int (*update)(struct key *key, struct key_preparsed_payload *prep); 117 void (*revoke)(struct key *key); 120 void (*destroy)(struct key *key); 123 void (*describe)(const struct key *key, struct seq_file *p); 132 long (*read)(const struct key *key, char *buffer, size_t buflen); 170 extern int key_payload_reserve(struct key *key, size_t datalen); 171 extern int key_instantiate_and_link(struct key *key, [all …]
|
/openbmc/linux/net/openvswitch/ |
H A D | flow.c | 385 static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key) in parse_ipv6hdr() argument 400 get_ipv6_ext_hdrs(skb, nh, &key->ipv6.exthdrs); in parse_ipv6hdr() 402 key->ip.proto = NEXTHDR_NONE; in parse_ipv6hdr() 403 key->ip.tos = ipv6_get_dsfield(nh); in parse_ipv6hdr() 404 key->ip.ttl = nh->hop_limit; in parse_ipv6hdr() 405 key->ipv6.label = *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL); in parse_ipv6hdr() 406 key->ipv6.addr.src = nh->saddr; in parse_ipv6hdr() 407 key->ipv6.addr.dst = nh->daddr; in parse_ipv6hdr() 412 key->ip.frag = OVS_FRAG_TYPE_LATER; in parse_ipv6hdr() 413 key->ip.proto = NEXTHDR_FRAGMENT; in parse_ipv6hdr() [all …]
|
/openbmc/linux/security/selinux/ss/ |
H A D | avtab.c | 71 const struct avtab_key *key, const struct avtab_datum *datum) in avtab_insert_node() argument 78 newnode->key = *key; in avtab_insert_node() 80 if (key->specified & AVTAB_XPERMS) { in avtab_insert_node() 106 static int avtab_insert(struct avtab *h, const struct avtab_key *key, in avtab_insert() argument 111 u16 specified = key->specified & ~(AVTAB_ENABLED|AVTAB_ENABLED_OLD); in avtab_insert() 116 hvalue = avtab_hash(key, h->mask); in avtab_insert() 120 if (key->source_type == cur->key.source_type && in avtab_insert() 121 key->target_type == cur->key.target_type && in avtab_insert() 122 key->target_class == cur->key.target_class && in avtab_insert() 123 (specified & cur->key.specified)) { in avtab_insert() [all …]
|
/openbmc/linux/drivers/s390/crypto/ |
H A D | zcrypt_cca_key.h | 112 } __packed *key = p; in zcrypt_type6_mex_key_en() local 124 memset(key, 0, sizeof(*key)); in zcrypt_type6_mex_key_en() 126 key->pubhdr = static_pub_hdr; in zcrypt_type6_mex_key_en() 127 key->pubsec = static_pub_sec; in zcrypt_type6_mex_key_en() 130 ptr = key->exponent; in zcrypt_type6_mex_key_en() 138 key->pubsec.modulus_bit_len = 8 * mex->inputdatalength; in zcrypt_type6_mex_key_en() 139 key->pubsec.modulus_byte_len = mex->inputdatalength; in zcrypt_type6_mex_key_en() 140 key->pubsec.exponent_len = mex->inputdatalength; in zcrypt_type6_mex_key_en() 141 key->pubsec.section_length = sizeof(key->pubsec) + in zcrypt_type6_mex_key_en() 143 key->pubhdr.token_length = in zcrypt_type6_mex_key_en() [all …]
|
/openbmc/linux/lib/ |
H A D | test_static_keys.c | 37 struct static_key *key; member 41 #define test_key_func(key, branch) \ argument 42 static bool key ## _ ## branch(void) \ 44 return branch(&key); \ 47 static void invert_key(struct static_key *key) in invert_key() argument 49 if (static_key_enabled(key)) in invert_key() 50 static_key_disable(key); in invert_key() 52 static_key_enable(key); in invert_key() 61 if (previous != keys[i].key) { in invert_keys() 62 invert_key(keys[i].key); in invert_keys() [all …]
|
/openbmc/linux/net/ceph/ |
H A D | crypto.c | 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() 40 if (!key->len) in set_secret() 43 key->key = kmemdup(buf, key->len, GFP_NOIO); in set_secret() 44 if (!key->key) { in set_secret() 51 key->tfm = crypto_alloc_sync_skcipher("cbc(aes)", 0, 0); in set_secret() 53 if (IS_ERR(key->tfm)) { in set_secret() 54 ret = PTR_ERR(key->tfm); in set_secret() [all …]
|
/openbmc/u-boot/lib/libavb/ |
H A D | avb_rsa.c | 25 IAvbKey* key = NULL; in iavb_parse_key_data() local 55 key = (IAvbKey*)(avb_malloc(sizeof(IAvbKey) + 2 * h.key_num_bits / 8)); in iavb_parse_key_data() 56 if (key == NULL) { in iavb_parse_key_data() 60 key->len = h.key_num_bits / 32; in iavb_parse_key_data() 61 key->n0inv = h.n0inv; in iavb_parse_key_data() 62 key->n = (uint32_t*)(key + 1); /* Skip ahead sizeof(IAvbKey) bytes. */ in iavb_parse_key_data() 63 key->rr = key->n + key->len; in iavb_parse_key_data() 69 for (i = 0; i < key->len; i++) { in iavb_parse_key_data() 70 key->n[i] = avb_be32toh(((uint32_t*)n)[key->len - i - 1]); in iavb_parse_key_data() 71 key->rr[i] = avb_be32toh(((uint32_t*)rr)[key->len - i - 1]); in iavb_parse_key_data() [all …]
|
/openbmc/u-boot/fs/ubifs/ |
H A D | key.h | 85 union ubifs_key *key, ino_t inum) in ino_key_init() argument 87 key->u32[0] = inum; in ino_key_init() 88 key->u32[1] = UBIFS_INO_KEY << UBIFS_S_KEY_BLOCK_BITS; in ino_key_init() 100 union ubifs_key *key = k; in ino_key_init_flash() local 102 key->j32[0] = cpu_to_le32(inum); in ino_key_init_flash() 103 key->j32[1] = cpu_to_le32(UBIFS_INO_KEY << UBIFS_S_KEY_BLOCK_BITS); in ino_key_init_flash() 114 union ubifs_key *key, ino_t inum) in lowest_ino_key() argument 116 key->u32[0] = inum; in lowest_ino_key() 117 key->u32[1] = 0; in lowest_ino_key() 127 union ubifs_key *key, ino_t inum) in highest_ino_key() argument [all …]
|
/openbmc/linux/fs/ubifs/ |
H A D | key.h | 91 union ubifs_key *key, ino_t inum) in ino_key_init() argument 93 key->u32[0] = inum; in ino_key_init() 94 key->u32[1] = UBIFS_INO_KEY << UBIFS_S_KEY_BLOCK_BITS; in ino_key_init() 106 union ubifs_key *key = k; in ino_key_init_flash() local 108 key->j32[0] = cpu_to_le32(inum); in ino_key_init_flash() 109 key->j32[1] = cpu_to_le32(UBIFS_INO_KEY << UBIFS_S_KEY_BLOCK_BITS); in ino_key_init_flash() 120 union ubifs_key *key, ino_t inum) in lowest_ino_key() argument 122 key->u32[0] = inum; in lowest_ino_key() 123 key->u32[1] = 0; in lowest_ino_key() 133 union ubifs_key *key, ino_t inum) in highest_ino_key() argument [all …]
|
/openbmc/linux/fs/nilfs2/ |
H A D | direct.c | 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() 42 ptr = nilfs_direct_get_ptr(direct, key); in nilfs_direct_lookup() 51 __u64 key, __u64 *ptrp, in nilfs_direct_lookup_contig() argument 59 if (key > NILFS_DIRECT_KEY_MAX) in nilfs_direct_lookup_contig() 61 ptr = nilfs_direct_get_ptr(direct, key); in nilfs_direct_lookup_contig() [all …]
|