X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fipv4%2Fesp4.c;h=49d3cee6ded7744319ff3f6072cd3596dff0127c;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=27d8f808bad45bfdfd1d00df09b832aa26887550;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 27d8f808b..49d3cee6d 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -392,7 +392,7 @@ static int esp_init_state(struct xfrm_state *x, void *args) goto error; esp->auth.icv = esp_hmac_digest; - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != @@ -427,7 +427,8 @@ static int esp_init_state(struct xfrm_state *x, void *args) goto error; get_random_bytes(esp->conf.ivec, esp->conf.ivlen); } - crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len); + if (crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len)) + goto error; x->props.header_len = sizeof(struct ip_esp_hdr) + esp->conf.ivlen; if (x->props.mode) x->props.header_len += sizeof(struct iphdr);