aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-10-25 13:21:06 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-10-25 13:21:06 +0100
commit81cf65ff6fa1af7199001a61ce126e57b64ce98a (patch)
tree71cce1dd8b8fd1e68ff8786dafd58fd2bec0b804 /include
parent02352a56e21d0f215000c4cbb474c2cac5309661 (diff)
downloadkernel_samsung_smdk4412-81cf65ff6fa1af7199001a61ce126e57b64ce98a.zip
kernel_samsung_smdk4412-81cf65ff6fa1af7199001a61ce126e57b64ce98a.tar.gz
kernel_samsung_smdk4412-81cf65ff6fa1af7199001a61ce126e57b64ce98a.tar.bz2
crypto merged
Diffstat (limited to 'include')
-rw-r--r--include/crypto/aead.h21
-rw-r--r--include/crypto/algapi.h1
-rw-r--r--include/crypto/compress.h40
-rw-r--r--include/crypto/hash.h34
-rw-r--r--include/crypto/rng.h5
-rw-r--r--include/crypto/skcipher.h18
-rw-r--r--include/linux/crypto.h121
l---------include/net/bluetooth/hci_mon.h1
8 files changed, 19 insertions, 222 deletions
diff --git a/include/crypto/aead.h b/include/crypto/aead.h
index 2281408..0edf949 100644
--- a/include/crypto/aead.h
+++ b/include/crypto/aead.h
@@ -1,11 +1,11 @@
/*
* AEAD: Authenticated Encryption with Associated Data
- *
+ *
* Copyright (c) 2007 Herbert Xu <herbert@gondor.apana.org.au>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
+ * Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
*/
@@ -39,24 +39,12 @@ static inline struct crypto_aead *aead_givcrypt_reqtfm(
static inline int crypto_aead_givencrypt(struct aead_givcrypt_request *req)
{
struct aead_tfm *crt = crypto_aead_crt(aead_givcrypt_reqtfm(req));
-
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crt->givencrypt(req);
};
static inline int crypto_aead_givdecrypt(struct aead_givcrypt_request *req)
{
struct aead_tfm *crt = crypto_aead_crt(aead_givcrypt_reqtfm(req));
-
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crt->givdecrypt(req);
};
@@ -71,11 +59,6 @@ static inline struct aead_givcrypt_request *aead_givcrypt_alloc(
{
struct aead_givcrypt_request *req;
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return NULL;
-#endif
-
req = kmalloc(sizeof(struct aead_givcrypt_request) +
crypto_aead_reqsize(tfm), gfp);
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index 1f40265..59c3e5b 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -304,7 +304,6 @@ static inline void blkcipher_walk_init(struct blkcipher_walk *walk,
walk->in.sg = src;
walk->out.sg = dst;
walk->total = nbytes;
- walk->flags = 0;
}
static inline void ablkcipher_walk_init(struct ablkcipher_walk *walk,
diff --git a/include/crypto/compress.h b/include/crypto/compress.h
index 607ba7d..86163ef 100644
--- a/include/crypto/compress.h
+++ b/include/crypto/compress.h
@@ -99,86 +99,46 @@ static inline struct pcomp_alg *crypto_pcomp_alg(struct crypto_pcomp *tfm)
static inline int crypto_compress_setup(struct crypto_pcomp *tfm,
void *params, unsigned int len)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_pcomp_alg(tfm)->compress_setup(tfm, params, len);
}
static inline int crypto_compress_init(struct crypto_pcomp *tfm)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_pcomp_alg(tfm)->compress_init(tfm);
}
static inline int crypto_compress_update(struct crypto_pcomp *tfm,
struct comp_request *req)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_pcomp_alg(tfm)->compress_update(tfm, req);
}
static inline int crypto_compress_final(struct crypto_pcomp *tfm,
struct comp_request *req)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_pcomp_alg(tfm)->compress_final(tfm, req);
}
static inline int crypto_decompress_setup(struct crypto_pcomp *tfm,
void *params, unsigned int len)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_pcomp_alg(tfm)->decompress_setup(tfm, params, len);
}
static inline int crypto_decompress_init(struct crypto_pcomp *tfm)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_pcomp_alg(tfm)->decompress_init(tfm);
}
static inline int crypto_decompress_update(struct crypto_pcomp *tfm,
struct comp_request *req)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_pcomp_alg(tfm)->decompress_update(tfm, req);
}
static inline int crypto_decompress_final(struct crypto_pcomp *tfm,
struct comp_request *req)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_pcomp_alg(tfm)->decompress_final(tfm, req);
}
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index 7029716..26cb1eb 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -1,11 +1,11 @@
/*
* Hash: Hash algorithms under the crypto API
- *
+ *
* Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
+ * Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
*/
@@ -197,21 +197,11 @@ static inline int crypto_ahash_import(struct ahash_request *req, const void *in)
static inline int crypto_ahash_init(struct ahash_request *req)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_ahash_reqtfm(req)->init(req);
}
static inline int crypto_ahash_update(struct ahash_request *req)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_ahash_reqtfm(req)->update(req);
}
@@ -226,11 +216,6 @@ static inline struct ahash_request *ahash_request_alloc(
{
struct ahash_request *req;
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return NULL;
-#endif
-
req = kmalloc(sizeof(struct ahash_request) +
crypto_ahash_reqsize(tfm), gfp);
@@ -346,31 +331,16 @@ int crypto_shash_digest(struct shash_desc *desc, const u8 *data,
static inline int crypto_shash_export(struct shash_desc *desc, void *out)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_shash_alg(desc->tfm)->export(desc, out);
}
static inline int crypto_shash_import(struct shash_desc *desc, const void *in)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_shash_alg(desc->tfm)->import(desc, in);
}
static inline int crypto_shash_init(struct shash_desc *desc)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_shash_alg(desc->tfm)->init(desc);
}
diff --git a/include/crypto/rng.h b/include/crypto/rng.h
index 74db6da..c93f9b9 100644
--- a/include/crypto/rng.h
+++ b/include/crypto/rng.h
@@ -58,11 +58,6 @@ static inline void crypto_free_rng(struct crypto_rng *tfm)
static inline int crypto_rng_get_bytes(struct crypto_rng *tfm,
u8 *rdata, unsigned int dlen)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_rng_crt(tfm)->rng_gen_random(tfm, rdata, dlen);
}
diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h
index c893e78..25fd612 100644
--- a/include/crypto/skcipher.h
+++ b/include/crypto/skcipher.h
@@ -1,11 +1,11 @@
/*
* Symmetric key ciphers.
- *
+ *
* Copyright (c) 2007 Herbert Xu <herbert@gondor.apana.org.au>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
+ * Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
*/
@@ -41,10 +41,6 @@ static inline int crypto_skcipher_givencrypt(
{
struct ablkcipher_tfm *crt =
crypto_ablkcipher_crt(skcipher_givcrypt_reqtfm(req));
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
return crt->givencrypt(req);
};
@@ -53,10 +49,6 @@ static inline int crypto_skcipher_givdecrypt(
{
struct ablkcipher_tfm *crt =
crypto_ablkcipher_crt(skcipher_givcrypt_reqtfm(req));
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
return crt->givdecrypt(req);
};
@@ -78,11 +70,6 @@ static inline struct skcipher_givcrypt_request *skcipher_givcrypt_alloc(
{
struct skcipher_givcrypt_request *req;
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return NULL;
-#endif
-
req = kmalloc(sizeof(struct skcipher_givcrypt_request) +
crypto_ablkcipher_reqsize(tfm), gfp);
@@ -120,3 +107,4 @@ static inline void skcipher_givcrypt_set_giv(
}
#endif /* _CRYPTO_SKCIPHER_H */
+
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 408bcb4..a6a7a1c 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -7,10 +7,10 @@
*
* Portions derived from Cryptoapi, by Alexander Kjeldaas <astor@fast.no>
* and Nettle, by Niels Möller.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
+ * Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
*/
@@ -25,9 +25,6 @@
#include <linux/string.h>
#include <linux/uaccess.h>
-#ifdef CONFIG_CRYPTO_FIPS
-#include <linux/err.h>
-#endif
/*
* Algorithm masks and types.
*/
@@ -84,10 +81,10 @@
#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200
#define CRYPTO_TFM_REQ_MAY_BACKLOG 0x00000400
#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000
-#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000
-#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000
-#define CRYPTO_TFM_RES_BAD_BLOCK_LEN 0x00800000
-#define CRYPTO_TFM_RES_BAD_FLAGS 0x01000000
+#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000
+#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000
+#define CRYPTO_TFM_RES_BAD_BLOCK_LEN 0x00800000
+#define CRYPTO_TFM_RES_BAD_FLAGS 0x01000000
/*
* Miscellaneous stuff.
@@ -106,10 +103,6 @@
#define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN)))
-#ifdef CONFIG_CRYPTO_FIPS
-bool in_fips_err(void);
-#endif
-
struct scatterlist;
struct crypto_ablkcipher;
struct crypto_async_request;
@@ -303,7 +296,7 @@ struct crypto_alg {
int (*cra_init)(struct crypto_tfm *tfm);
void (*cra_exit)(struct crypto_tfm *tfm);
void (*cra_destroy)(struct crypto_alg *alg);
-
+
struct module *cra_module;
};
@@ -408,7 +401,7 @@ struct rng_tfm {
struct crypto_tfm {
u32 crt_flags;
-
+
union {
struct ablkcipher_tfm ablkcipher;
struct aead_tfm aead;
@@ -420,7 +413,7 @@ struct crypto_tfm {
} crt_u;
void (*exit)(struct crypto_tfm *tfm);
-
+
struct crypto_alg *__crt_alg;
void *__crt_ctx[] CRYPTO_MINALIGN_ATTR;
@@ -480,10 +473,10 @@ struct crypto_attr_u32 {
u32 num;
};
-/*
+/*
* Transform user interface.
*/
-
+
struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask);
void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm);
@@ -661,11 +654,6 @@ static inline int crypto_ablkcipher_encrypt(struct ablkcipher_request *req)
{
struct ablkcipher_tfm *crt =
crypto_ablkcipher_crt(crypto_ablkcipher_reqtfm(req));
-
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
return crt->encrypt(req);
}
@@ -673,12 +661,6 @@ static inline int crypto_ablkcipher_decrypt(struct ablkcipher_request *req)
{
struct ablkcipher_tfm *crt =
crypto_ablkcipher_crt(crypto_ablkcipher_reqtfm(req));
-
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crt->decrypt(req);
}
@@ -705,11 +687,6 @@ static inline struct ablkcipher_request *ablkcipher_request_alloc(
{
struct ablkcipher_request *req;
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return NULL;
-#endif
-
req = kmalloc(sizeof(struct ablkcipher_request) +
crypto_ablkcipher_reqsize(tfm), gfp);
@@ -818,21 +795,11 @@ static inline struct crypto_aead *crypto_aead_reqtfm(struct aead_request *req)
static inline int crypto_aead_encrypt(struct aead_request *req)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_aead_crt(crypto_aead_reqtfm(req))->encrypt(req);
}
static inline int crypto_aead_decrypt(struct aead_request *req)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_aead_crt(crypto_aead_reqtfm(req))->decrypt(req);
}
@@ -852,11 +819,6 @@ static inline struct aead_request *aead_request_alloc(struct crypto_aead *tfm,
{
struct aead_request *req;
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return NULL;
-#endif
-
req = kmalloc(sizeof(*req) + crypto_aead_reqsize(tfm), gfp);
if (likely(req))
@@ -1005,11 +967,6 @@ static inline int crypto_blkcipher_encrypt(struct blkcipher_desc *desc,
struct scatterlist *src,
unsigned int nbytes)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
desc->info = crypto_blkcipher_crt(desc->tfm)->iv;
return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes);
}
@@ -1019,11 +976,6 @@ static inline int crypto_blkcipher_encrypt_iv(struct blkcipher_desc *desc,
struct scatterlist *src,
unsigned int nbytes)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes);
}
@@ -1032,11 +984,6 @@ static inline int crypto_blkcipher_decrypt(struct blkcipher_desc *desc,
struct scatterlist *src,
unsigned int nbytes)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
desc->info = crypto_blkcipher_crt(desc->tfm)->iv;
return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes);
}
@@ -1046,11 +993,6 @@ static inline int crypto_blkcipher_decrypt_iv(struct blkcipher_desc *desc,
struct scatterlist *src,
unsigned int nbytes)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes);
}
@@ -1148,11 +1090,6 @@ static inline int crypto_cipher_setkey(struct crypto_cipher *tfm,
static inline void crypto_cipher_encrypt_one(struct crypto_cipher *tfm,
u8 *dst, const u8 *src)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return;
-#endif
-
crypto_cipher_crt(tfm)->cit_encrypt_one(crypto_cipher_tfm(tfm),
dst, src);
}
@@ -1160,11 +1097,6 @@ static inline void crypto_cipher_encrypt_one(struct crypto_cipher *tfm,
static inline void crypto_cipher_decrypt_one(struct crypto_cipher *tfm,
u8 *dst, const u8 *src)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return;
-#endif
-
crypto_cipher_crt(tfm)->cit_decrypt_one(crypto_cipher_tfm(tfm),
dst, src);
}
@@ -1249,11 +1181,6 @@ static inline void crypto_hash_clear_flags(struct crypto_hash *tfm, u32 flags)
static inline int crypto_hash_init(struct hash_desc *desc)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_hash_crt(desc->tfm)->init(desc);
}
@@ -1261,21 +1188,11 @@ static inline int crypto_hash_update(struct hash_desc *desc,
struct scatterlist *sg,
unsigned int nbytes)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_hash_crt(desc->tfm)->update(desc, sg, nbytes);
}
static inline int crypto_hash_final(struct hash_desc *desc, u8 *out)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_hash_crt(desc->tfm)->final(desc, out);
}
@@ -1283,11 +1200,6 @@ static inline int crypto_hash_digest(struct hash_desc *desc,
struct scatterlist *sg,
unsigned int nbytes, u8 *out)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_hash_crt(desc->tfm)->digest(desc, sg, nbytes, out);
}
@@ -1352,11 +1264,6 @@ static inline int crypto_comp_compress(struct crypto_comp *tfm,
const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_comp_crt(tfm)->cot_compress(crypto_comp_tfm(tfm),
src, slen, dst, dlen);
}
@@ -1365,13 +1272,9 @@ static inline int crypto_comp_decompress(struct crypto_comp *tfm,
const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen)
{
-#ifdef CONFIG_CRYPTO_FIPS
- if (unlikely(in_fips_err()))
- return -EACCES;
-#endif
-
return crypto_comp_crt(tfm)->cot_decompress(crypto_comp_tfm(tfm),
src, slen, dst, dlen);
}
#endif /* _LINUX_CRYPTO_H */
+
diff --git a/include/net/bluetooth/hci_mon.h b/include/net/bluetooth/hci_mon.h
deleted file mode 120000
index e48f44c..0000000
--- a/include/net/bluetooth/hci_mon.h
+++ /dev/null
@@ -1 +0,0 @@
-tizen/hci_mon.h \ No newline at end of file