X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=crypto%2Faead.c;h=479b7d134f246f3ef009753fe8950e8ce25114fc;hp=701556ffaaef0e6ca21256b52a8b594904852f9e;hb=8fa23b093b442c8fc5fc8d0090eeb7b120d97a6a;hpb=cdaeb578aca9e017deb0f55f1af8a94a4d63efb3 diff --git a/crypto/aead.c b/crypto/aead.c index 701556ffaaef..479b7d134f24 100644 --- a/crypto/aead.c +++ b/crypto/aead.c @@ -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 ?: ""); + strncpy(raead.type, "aead", sizeof(raead.type)); + strncpy(raead.geniv, aead->geniv ?: "", 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)