Lines Matching refs:hinfo
53 const struct seg6_hmac_info *hinfo = obj; in seg6_hmac_cmpfn() local
55 return (hinfo->hmackeyid != *(__u32 *)arg->key); in seg6_hmac_cmpfn()
58 static inline void seg6_hinfo_release(struct seg6_hmac_info *hinfo) in seg6_hinfo_release() argument
60 kfree_rcu(hinfo, rcu); in seg6_hinfo_release()
65 struct seg6_hmac_info *hinfo = (struct seg6_hmac_info *)ptr; in seg6_free_hi() local
67 if (hinfo) in seg6_free_hi()
68 seg6_hinfo_release(hinfo); in seg6_free_hi()
124 static int __do_hmac(struct seg6_hmac_info *hinfo, const char *text, u8 psize, in __do_hmac() argument
132 algo = __hmac_get_algo(hinfo->alg_id); in __do_hmac()
145 ret = crypto_shash_setkey(tfm, hinfo->secret, hinfo->slen); in __do_hmac()
166 int seg6_hmac_compute(struct seg6_hmac_info *hinfo, struct ipv6_sr_hdr *hdr, in seg6_hmac_compute() argument
169 __be32 hmackeyid = cpu_to_be32(hinfo->hmackeyid); in seg6_hmac_compute()
219 dgsize = __do_hmac(hinfo, ring, plen, tmp_out, in seg6_hmac_compute()
246 struct seg6_hmac_info *hinfo; in seg6_hmac_validate_skb() local
271 hinfo = seg6_hmac_info_lookup(net, be32_to_cpu(tlv->hmackeyid)); in seg6_hmac_validate_skb()
272 if (!hinfo) in seg6_hmac_validate_skb()
275 if (seg6_hmac_compute(hinfo, srh, &ipv6_hdr(skb)->saddr, hmac_output)) in seg6_hmac_validate_skb()
289 struct seg6_hmac_info *hinfo; in seg6_hmac_info_lookup() local
291 hinfo = rhashtable_lookup_fast(&sdata->hmac_infos, &key, rht_params); in seg6_hmac_info_lookup()
293 return hinfo; in seg6_hmac_info_lookup()
297 int seg6_hmac_info_add(struct net *net, u32 key, struct seg6_hmac_info *hinfo) in seg6_hmac_info_add() argument
302 err = rhashtable_lookup_insert_fast(&sdata->hmac_infos, &hinfo->node, in seg6_hmac_info_add()
312 struct seg6_hmac_info *hinfo; in seg6_hmac_info_del() local
315 hinfo = rhashtable_lookup_fast(&sdata->hmac_infos, &key, rht_params); in seg6_hmac_info_del()
316 if (!hinfo) in seg6_hmac_info_del()
319 err = rhashtable_remove_fast(&sdata->hmac_infos, &hinfo->node, in seg6_hmac_info_del()
324 seg6_hinfo_release(hinfo); in seg6_hmac_info_del()
334 struct seg6_hmac_info *hinfo; in seg6_push_hmac() local
344 hinfo = seg6_hmac_info_lookup(net, be32_to_cpu(tlv->hmackeyid)); in seg6_push_hmac()
345 if (!hinfo) in seg6_push_hmac()
349 err = seg6_hmac_compute(hinfo, srh, saddr, tlv->hmac); in seg6_push_hmac()