Lines Matching refs:hinfo
48 const struct seg6_hmac_info *hinfo = obj; in seg6_hmac_cmpfn() local
50 return (hinfo->hmackeyid != *(__u32 *)arg->key); in seg6_hmac_cmpfn()
53 static inline void seg6_hinfo_release(struct seg6_hmac_info *hinfo) in seg6_hinfo_release() argument
55 kfree_rcu(hinfo, rcu); in seg6_hinfo_release()
60 struct seg6_hmac_info *hinfo = (struct seg6_hmac_info *)ptr; in seg6_free_hi() local
62 if (hinfo) in seg6_free_hi()
63 seg6_hinfo_release(hinfo); in seg6_free_hi()
119 static int __do_hmac(struct seg6_hmac_info *hinfo, const char *text, u8 psize, in __do_hmac() argument
127 algo = __hmac_get_algo(hinfo->alg_id); in __do_hmac()
140 ret = crypto_shash_setkey(tfm, hinfo->secret, hinfo->slen); in __do_hmac()
161 int seg6_hmac_compute(struct seg6_hmac_info *hinfo, struct ipv6_sr_hdr *hdr, in seg6_hmac_compute() argument
164 __be32 hmackeyid = cpu_to_be32(hinfo->hmackeyid); in seg6_hmac_compute()
214 dgsize = __do_hmac(hinfo, ring, plen, tmp_out, in seg6_hmac_compute()
241 struct seg6_hmac_info *hinfo; in seg6_hmac_validate_skb() local
266 hinfo = seg6_hmac_info_lookup(net, be32_to_cpu(tlv->hmackeyid)); in seg6_hmac_validate_skb()
267 if (!hinfo) in seg6_hmac_validate_skb()
270 if (seg6_hmac_compute(hinfo, srh, &ipv6_hdr(skb)->saddr, hmac_output)) in seg6_hmac_validate_skb()
284 struct seg6_hmac_info *hinfo; in seg6_hmac_info_lookup() local
286 hinfo = rhashtable_lookup_fast(&sdata->hmac_infos, &key, rht_params); in seg6_hmac_info_lookup()
288 return hinfo; in seg6_hmac_info_lookup()
292 int seg6_hmac_info_add(struct net *net, u32 key, struct seg6_hmac_info *hinfo) in seg6_hmac_info_add() argument
297 err = rhashtable_lookup_insert_fast(&sdata->hmac_infos, &hinfo->node, in seg6_hmac_info_add()
307 struct seg6_hmac_info *hinfo; in seg6_hmac_info_del() local
310 hinfo = rhashtable_lookup_fast(&sdata->hmac_infos, &key, rht_params); in seg6_hmac_info_del()
311 if (!hinfo) in seg6_hmac_info_del()
314 err = rhashtable_remove_fast(&sdata->hmac_infos, &hinfo->node, in seg6_hmac_info_del()
319 seg6_hinfo_release(hinfo); in seg6_hmac_info_del()
329 struct seg6_hmac_info *hinfo; in seg6_push_hmac() local
339 hinfo = seg6_hmac_info_lookup(net, be32_to_cpu(tlv->hmackeyid)); in seg6_push_hmac()
340 if (!hinfo) in seg6_push_hmac()
344 err = seg6_hmac_compute(hinfo, srh, saddr, tlv->hmac); in seg6_push_hmac()