提交 04ff1260 编写于 作者: H Herbert Xu

[IPSEC]: Add compatibility algorithm name support

This patch adds a compatibility name field for each IPsec algorithm.  This
is needed when parameterised algorithms are used.  For example, "md5" will
become "hmac(md5)", and "aes" will become "cbc(aes)".
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 d1806f6a
...@@ -854,6 +854,7 @@ struct xfrm_algo_comp_info { ...@@ -854,6 +854,7 @@ struct xfrm_algo_comp_info {
struct xfrm_algo_desc { struct xfrm_algo_desc {
char *name; char *name;
char *compat;
u8 available:1; u8 available:1;
union { union {
struct xfrm_algo_auth_info auth; struct xfrm_algo_auth_info auth;
......
...@@ -359,7 +359,8 @@ static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list, ...@@ -359,7 +359,8 @@ static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list,
return NULL; return NULL;
for (i = 0; i < entries; i++) { for (i = 0; i < entries; i++) {
if (strcmp(name, list[i].name)) if (strcmp(name, list[i].name) &&
(!list[i].compat || strcmp(name, list[i].compat)))
continue; continue;
if (list[i].available) if (list[i].available)
......
...@@ -213,6 +213,7 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props, ...@@ -213,6 +213,7 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props,
return -ENOMEM; return -ENOMEM;
memcpy(p, ualg, len); memcpy(p, ualg, len);
strcpy(p->alg_name, algo->name);
*algpp = p; *algpp = p;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册