summaryrefslogtreecommitdiff
path: root/lib/crypto
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-06-23 09:52:49 +0200
committerJeremy Allison <jra@samba.org>2015-06-23 22:12:08 +0200
commita4d4cc2550fec0343b8c46f591d5c3a05e70f87f (patch)
treeba81b33df4267689fc412699a1185ba57a9d08c7 /lib/crypto
parent0934134d2e367936d0d6d914b12f333accb98c50 (diff)
downloadsamba-a4d4cc2550fec0343b8c46f591d5c3a05e70f87f.tar.gz
lib: Simplify arcfour_crypt
We don't need a dependency on data_blob in crypto Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/arcfour.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/crypto/arcfour.c b/lib/crypto/arcfour.c
index 1afd659be69..d310649e702 100644
--- a/lib/crypto/arcfour.c
+++ b/lib/crypto/arcfour.c
@@ -81,11 +81,12 @@ _PUBLIC_ void arcfour_crypt_blob(uint8_t *data, int len, const DATA_BLOB *key)
*/
_PUBLIC_ void arcfour_crypt(uint8_t *data, const uint8_t keystr[16], int len)
{
- DATA_BLOB key = data_blob(keystr, 16);
-
- arcfour_crypt_blob(data, len, &key);
+ uint8_t keycopy[16];
+ DATA_BLOB key = { .data = keycopy, .length = sizeof(keycopy) };
- data_blob_free(&key);
+ memcpy(keycopy, keystr, sizeof(keycopy));
+
+ arcfour_crypt_blob(data, len, &key);
}