crypto: hash - Make setkey optional
[pandora-kernel.git] / crypto / shash.c
index 50d69a4..c9df367 100644 (file)
@@ -55,6 +55,9 @@ int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
        struct shash_alg *shash = crypto_shash_alg(tfm);
        unsigned long alignmask = crypto_shash_alignmask(tfm);
 
+       if (!shash->setkey)
+               return -ENOSYS;
+
        if ((unsigned long)key & alignmask)
                return shash_setkey_unaligned(tfm, key, keylen);