diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-12-02 03:49:04 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-12-04 08:09:05 -0500 |
commit | 201a5929c8c788f9ef53b010065c9ce70c9c06f0 (patch) | |
tree | 94909a7924645c50f37e6ceba9ea1234f93b7d90 /net/bluetooth/smp.c | |
parent | e84a6b139bdd3af2914f194ff840b1a36fa55598 (diff) |
Bluetooth: Remove dead code from SMP encryption function
The AES cipher is used in ECB mode by SMP and therefore doesn't use an
IV (crypto_blkcipher_ivsize returns 0) so the code trying to set the IV
was never getting called. Simply remove this code to avoid anyone from
thinking it actually makes some difference.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r-- | net/bluetooth/smp.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 3bcb765b6a92..e61e74a1aabb 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -53,8 +53,7 @@ static int smp_e(struct crypto_blkcipher *tfm, const u8 *k, u8 *r) | |||
53 | { | 53 | { |
54 | struct blkcipher_desc desc; | 54 | struct blkcipher_desc desc; |
55 | struct scatterlist sg; | 55 | struct scatterlist sg; |
56 | int err, iv_len; | 56 | int err; |
57 | unsigned char iv[128]; | ||
58 | 57 | ||
59 | if (tfm == NULL) { | 58 | if (tfm == NULL) { |
60 | BT_ERR("tfm %p", tfm); | 59 | BT_ERR("tfm %p", tfm); |
@@ -72,12 +71,6 @@ static int smp_e(struct crypto_blkcipher *tfm, const u8 *k, u8 *r) | |||
72 | 71 | ||
73 | sg_init_one(&sg, r, 16); | 72 | sg_init_one(&sg, r, 16); |
74 | 73 | ||
75 | iv_len = crypto_blkcipher_ivsize(tfm); | ||
76 | if (iv_len) { | ||
77 | memset(&iv, 0xff, iv_len); | ||
78 | crypto_blkcipher_set_iv(tfm, iv, iv_len); | ||
79 | } | ||
80 | |||
81 | err = crypto_blkcipher_encrypt(&desc, &sg, &sg, 16); | 74 | err = crypto_blkcipher_encrypt(&desc, &sg, &sg, 16); |
82 | if (err) | 75 | if (err) |
83 | BT_ERR("Encrypt data error %d", err); | 76 | BT_ERR("Encrypt data error %d", err); |