net/mlx4_en: Fix mixed PFC and Global pause user control requests
[pandora-kernel.git] / crypto / aead.c
index 701556f..479b7d1 100644 (file)
@@ -111,14 +111,14 @@ static int crypto_init_aead_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
        return 0;
 }
 
+#ifdef CONFIG_NET
 static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg)
 {
        struct crypto_report_aead raead;
        struct aead_alg *aead = &alg->cra_aead;
 
-       snprintf(raead.type, CRYPTO_MAX_ALG_NAME, "%s", "aead");
-       snprintf(raead.geniv, CRYPTO_MAX_ALG_NAME, "%s",
-                aead->geniv ?: "<built-in>");
+       strncpy(raead.type, "aead", sizeof(raead.type));
+       strncpy(raead.geniv, aead->geniv ?: "<built-in>", sizeof(raead.geniv));
 
        raead.blocksize = alg->cra_blocksize;
        raead.maxauthsize = aead->maxauthsize;
@@ -132,6 +132,12 @@ static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg)
 nla_put_failure:
        return -EMSGSIZE;
 }
+#else
+static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg)
+{
+       return -ENOSYS;
+}
+#endif
 
 static void crypto_aead_show(struct seq_file *m, struct crypto_alg *alg)
        __attribute__ ((unused));
@@ -190,13 +196,14 @@ static int crypto_init_nivaead_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
        return 0;
 }
 
+#ifdef CONFIG_NET
 static int crypto_nivaead_report(struct sk_buff *skb, struct crypto_alg *alg)
 {
        struct crypto_report_aead raead;
        struct aead_alg *aead = &alg->cra_aead;
 
-       snprintf(raead.type, CRYPTO_MAX_ALG_NAME, "%s", "nivaead");
-       snprintf(raead.geniv, CRYPTO_MAX_ALG_NAME, "%s", aead->geniv);
+       strncpy(raead.type, "nivaead", sizeof(raead.type));
+       strncpy(raead.geniv, aead->geniv, sizeof(raead.geniv));
 
        raead.blocksize = alg->cra_blocksize;
        raead.maxauthsize = aead->maxauthsize;
@@ -210,6 +217,12 @@ static int crypto_nivaead_report(struct sk_buff *skb, struct crypto_alg *alg)
 nla_put_failure:
        return -EMSGSIZE;
 }
+#else
+static int crypto_nivaead_report(struct sk_buff *skb, struct crypto_alg *alg)
+{
+       return -ENOSYS;
+}
+#endif
 
 
 static void crypto_nivaead_show(struct seq_file *m, struct crypto_alg *alg)