summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-08-25 04:31:52 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-25 04:31:52 +0200
commitdb7c441175942d3b3c3e6321a9a16dc7e83b747c (patch)
tree1e76d08e646d466dd0e096b23c048dde074fb78e
parent9de348f24de5ab4f6eafba7a20f3fa64912b917b (diff)
downloadkernel-crypto-db7c441175942d3b3c3e6321a9a16dc7e83b747c.tar.gz
kernel-crypto-db7c441175942d3b3c3e6321a9a16dc7e83b747c.tar.xz
kernel-crypto-db7c441175942d3b3c3e6321a9a16dc7e83b747c.zip
Remove a redundant argument of cryptodev_hash_init
-rw-r--r--cryptodev_cipher.c4
-rw-r--r--cryptodev_int.h2
-rw-r--r--libtomcrypt/hashes/hash_memory.c2
-rw-r--r--libtomcrypt/hashes/hash_memory_multi.c2
-rw-r--r--ncr-sessions.c6
5 files changed, 8 insertions, 8 deletions
diff --git a/cryptodev_cipher.c b/cryptodev_cipher.c
index 4e74fcc39d0..dae4a63a174 100644
--- a/cryptodev_cipher.c
+++ b/cryptodev_cipher.c
@@ -216,7 +216,7 @@ ssize_t cryptodev_cipher_decrypt( struct cipher_data* cdata, const struct scatte
/* Hash functions */
-int cryptodev_hash_init( struct hash_data* hdata, const char* alg_name, int hmac_mode, void * mackey, size_t mackeylen)
+int cryptodev_hash_init(struct hash_data *hdata, const char *alg_name, const void *mackey, size_t mackeylen)
{
int ret;
@@ -228,7 +228,7 @@ int ret;
}
/* Copy the key from user and set to TFM. */
- if (hmac_mode != 0) {
+ if (mackey != NULL) {
ret = crypto_ahash_setkey(hdata->async.s, mackey, mackeylen);
if (unlikely(ret)) {
diff --git a/cryptodev_int.h b/cryptodev_int.h
index e38150545b0..573fcaaed16 100644
--- a/cryptodev_int.h
+++ b/cryptodev_int.h
@@ -77,6 +77,6 @@ ssize_t cryptodev_hash_update( struct hash_data* hdata, struct scatterlist *sg,
ssize_t _cryptodev_hash_update( struct hash_data* hdata, const void* data, size_t len);
int cryptodev_hash_reset( struct hash_data* hdata);
void cryptodev_hash_deinit(struct hash_data* hdata);
-int cryptodev_hash_init( struct hash_data* hdata, const char* alg_name, int hmac_mode, void* mackey, size_t mackeylen);
+int cryptodev_hash_init(struct hash_data *hdata, const char *alg_name, const void *mackey, size_t mackeylen);
#endif /* CRYPTODEV_INT_H */
diff --git a/libtomcrypt/hashes/hash_memory.c b/libtomcrypt/hashes/hash_memory.c
index a416de9624e..c6f51881245 100644
--- a/libtomcrypt/hashes/hash_memory.c
+++ b/libtomcrypt/hashes/hash_memory.c
@@ -44,7 +44,7 @@ int hash_memory(const struct algo_properties_st *hash, const unsigned char *in,
return CRYPT_BUFFER_OVERFLOW;
}
- err = cryptodev_hash_init( &hdata, hash->kstr, 0, NULL, 0);
+ err = cryptodev_hash_init(&hdata, hash->kstr, NULL, 0);
if (err < 0) {
err = CRYPT_INVALID_HASH;
goto LBL_ERR;
diff --git a/libtomcrypt/hashes/hash_memory_multi.c b/libtomcrypt/hashes/hash_memory_multi.c
index a9149166700..74226767a72 100644
--- a/libtomcrypt/hashes/hash_memory_multi.c
+++ b/libtomcrypt/hashes/hash_memory_multi.c
@@ -50,7 +50,7 @@ int hash_memory_multi(const struct algo_properties_st *hash, unsigned char *out,
return CRYPT_BUFFER_OVERFLOW;
}
- err = cryptodev_hash_init( &hdata, hash->kstr, 0, NULL, 0);
+ err = cryptodev_hash_init(&hdata, hash->kstr, NULL, 0);
if (err < 0) {
err = CRYPT_INVALID_HASH;
goto LBL_ERR;
diff --git a/ncr-sessions.c b/ncr-sessions.c
index 2521f2e9920..a08f2371495 100644
--- a/ncr-sessions.c
+++ b/ncr-sessions.c
@@ -444,7 +444,7 @@ static struct session_item_st *_ncr_session_init(struct ncr_lists *lists,
goto fail;
}
- ret = cryptodev_hash_init(&ns->hash, ns->algorithm->kstr, 0, NULL, 0);
+ ret = cryptodev_hash_init(&ns->hash, ns->algorithm->kstr, NULL, 0);
if (ret < 0) {
err();
goto fail;
@@ -474,7 +474,7 @@ static struct session_item_st *_ncr_session_init(struct ncr_lists *lists,
goto fail;
}
- ret = cryptodev_hash_init(&ns->hash, ns->algorithm->kstr, 1,
+ ret = cryptodev_hash_init(&ns->hash, ns->algorithm->kstr,
ns->key->key.secret.data, ns->key->key.secret.size);
if (ret < 0) {
err();
@@ -509,7 +509,7 @@ static struct session_item_st *_ncr_session_init(struct ncr_lists *lists,
goto fail;
}
- ret = cryptodev_hash_init(&ns->hash, sign_hash->kstr, 0, NULL, 0);
+ ret = cryptodev_hash_init(&ns->hash, sign_hash->kstr, NULL, 0);
if (ret < 0) {
err();
goto fail;