]> err.no Git - linux-2.6/blobdiff - drivers/net/ppp_mppe.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-2.6] / drivers / net / ppp_mppe.c
index e7a0eb4fca6031bdffd8e279935cadee395f9183..f79cf87a2bff555aef80eba31da6c17eb340d65c 100644 (file)
@@ -200,11 +200,10 @@ static void *mppe_alloc(unsigned char *options, int optlen)
            || options[0] != CI_MPPE || options[1] != CILEN_MPPE)
                goto out;
 
-       state = (struct ppp_mppe_state *) kmalloc(sizeof(*state), GFP_KERNEL);
+       state = kzalloc(sizeof(*state), GFP_KERNEL);
        if (state == NULL)
                goto out;
 
-       memset(state, 0, sizeof(*state));
 
        state->arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
        if (IS_ERR(state->arc4)) {
@@ -710,8 +709,8 @@ static struct compressor ppp_mppe = {
 static int __init ppp_mppe_init(void)
 {
        int answer;
-       if (!(crypto_alg_available("ecb(arc4)", 0) &&
-             crypto_alg_available("sha1", 0)))
+       if (!(crypto_has_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC) &&
+             crypto_has_hash("sha1", 0, CRYPTO_ALG_ASYNC)))
                return -ENODEV;
 
        sha_pad = kmalloc(sizeof(struct sha_pad), GFP_KERNEL);