From dbeb6db1b55a50dedf17e7d78ddb6fe9eebc2a63 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Wed, 4 Jan 2017 16:55:53 +0100 Subject: nwztools: cleanup crypto, switch MD5 to Crypto++ We already use Crypto++ for DES anyway, and using OpenSSL is not great because of its incompatible licence. Change-Id: I78771b84c1708795a0c0c30afa5bdfe4885dea4e --- utils/nwztools/upgtools/fwp.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'utils/nwztools/upgtools/fwp.c') diff --git a/utils/nwztools/upgtools/fwp.c b/utils/nwztools/upgtools/fwp.c index 34c55f6e5a..7d8f8002a8 100644 --- a/utils/nwztools/upgtools/fwp.c +++ b/utils/nwztools/upgtools/fwp.c @@ -18,21 +18,20 @@ * KIND, either express or implied. * ****************************************************************************/ -#include +#include #include #include "fwp.h" #include "misc.h" #include "mg.h" -#include -int fwp_read(void *in, int size, void *out, uint8_t *key) +void fwp_read(void *in, int size, void *out, uint8_t *key) { - return mg_decrypt_fw(in, size, out, key); + mg_decrypt_fw(in, size, out, key); } -int fwp_write(void *in, int size, void *out, uint8_t *key) +void fwp_write(void *in, int size, void *out, uint8_t *key) { - return mg_encrypt_fw(in, size, out, key); + mg_encrypt_fw(in, size, out, key); } static uint8_t g_key[NWZ_KEY_SIZE]; @@ -42,7 +41,7 @@ void fwp_setkey(char key[NWZ_KEY_SIZE]) memcpy(g_key, key, NWZ_KEY_SIZE); } -int fwp_crypt(void *buf, int size, int mode) +void fwp_crypt(void *buf, int size, int mode) { while(size >= NWZ_KEY_SIZE) { @@ -54,6 +53,5 @@ int fwp_crypt(void *buf, int size, int mode) size -= NWZ_KEY_SIZE; } if(size != 0) - abort(); - return 0; + abort(); /* size is not a multiple of 8 */ } -- cgit v1.2.3