lib: Simplify arcfour_crypt
authorVolker Lendecke <vl@samba.org>
Tue, 23 Jun 2015 07:52:49 +0000 (09:52 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 23 Jun 2015 20:12:08 +0000 (22:12 +0200)
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>
lib/crypto/arcfour.c

index 1afd659be6975f0746f41ab5128c6a05d7324267..d310649e702e39dbd194552e1efc7014614bb140 100644 (file)
@@ -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);
 }