diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-02-19 12:27:30 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-02-19 12:27:30 +0100 |
commit | 11b8f099bf0545fe6f1613fc37eb18f37eebd9da (patch) | |
tree | dfcad45dbbc484cae3d775941209e47b1b7423b7 | |
parent | 11722af465b4e8999d16630067b17ddc64f819ec (diff) | |
download | gnutls-11b8f099bf0545fe6f1613fc37eb18f37eebd9da.tar.gz |
update in cryptodev
-rw-r--r-- | lib/accelerated/cryptodev.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/accelerated/cryptodev.c b/lib/accelerated/cryptodev.c index 7a34c0c3b6..84471c5f23 100644 --- a/lib/accelerated/cryptodev.c +++ b/lib/accelerated/cryptodev.c @@ -64,7 +64,7 @@ static const int gnutls_cipher_map[] = { }; static int -cryptodev_cipher_init (gnutls_cipher_algorithm_t algorithm, void **_ctx) +cryptodev_cipher_init (gnutls_cipher_algorithm_t algorithm, void **_ctx, int enc) { struct cryptodev_ctx *ctx; int cipher = gnutls_cipher_map[algorithm]; @@ -172,8 +172,9 @@ static int register_crypto (int cfd) { struct session_op sess; - char fake_key[CRYPTO_CIPHER_MAX_KEY_LEN]; - int i = 0, ret; + uint8_t fake_key[CRYPTO_CIPHER_MAX_KEY_LEN]; + unsigned int i; + int ret; memset (&sess, 0, sizeof (sess)); @@ -365,13 +366,13 @@ cryptodev_mac_fast (gnutls_mac_algorithm_t algo, const void *key, size_t key_size, const void *text, size_t text_size, void *digest) { -int mac = gnutls_mac_map[algorithm]; +int mac = gnutls_mac_map[algo]; struct session_op sess; struct crypt_op cryp; sess.mac = mac; - sess.mackey = key; - sess.mackeylen = keysize; + sess.mackey = (void*)key; + sess.mackeylen = key_size; if (ioctl (cryptodev_fd, CIOCGSESSION, &sess)) { @@ -401,7 +402,7 @@ static const gnutls_crypto_mac_st mac_struct = { .setkey = cryptodev_mac_setkey, .hash = cryptodev_mac_hash, .output = cryptodev_mac_output, - .deinit = cryptodev_mac_deinit + .deinit = cryptodev_mac_deinit, .fast = cryptodev_mac_fast }; @@ -409,8 +410,9 @@ static int register_mac (int cfd) { struct session_op sess; - char fake_key[CRYPTO_CIPHER_MAX_KEY_LEN]; - int i = 0, ret; + uint8_t fake_key[CRYPTO_CIPHER_MAX_KEY_LEN]; + unsigned int i; + int ret; memset (&sess, 0, sizeof (sess)); for (i = 0; i < sizeof (gnutls_mac_map) / sizeof (gnutls_mac_map[0]); i++) |