X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fos_crypto%2Fblowfish%2Fbf_op.c;h=fe29f7f0e07f36a40b3c79a7c8a8e2fbb5510442;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hp=fe818316ba1384c6790e95ba78696e74e3d31f0c;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a;p=ossec-hids.git diff --git a/src/os_crypto/blowfish/bf_op.c b/src/os_crypto/blowfish/bf_op.c old mode 100755 new mode 100644 index fe81831..fe29f7f --- a/src/os_crypto/blowfish/bf_op.c +++ b/src/os_crypto/blowfish/bf_op.c @@ -1,20 +1,14 @@ -/* $OSSEC, os_crypto/blowfish_op.c, v0.2, 2005/09/17, Daniel B. Cid$ */ - /* Copyright (C) 2009 Trend Micro Inc. * All right reserved. * * This program is a free software; you can redistribute it * and/or modify it under the terms of the GNU General Public - * License (version 3) as published by the FSF - Free Software + * License (version 2) as published by the FSF - Free Software * Foundation */ -/* v0.2 (2005/09/17): uchar fixes - * v0.1 (2005/01/29) - */ - -/* OS_crypto/blowfish Library. - * APIs for many crypto operations. +/* OS_crypto/blowfish Library + * APIs for many crypto operations */ #include @@ -22,26 +16,25 @@ #include #include "blowfish.h" - #include "bf_op.h" typedef unsigned char uchar; -int OS_BF_Str(char *input, char *output, char *charkey, - long size, short int action) + +int OS_BF_Str(const char *input, char *output, const char *charkey, + long size, short int action) { BF_KEY key; - static unsigned char cbc_iv [8]={0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10}; + static unsigned char cbc_iv [8] = {0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}; unsigned char iv[8]; - memcpy(iv,cbc_iv,sizeof(iv)); + memcpy(iv, cbc_iv, sizeof(iv)); - BF_set_key(&key, strlen(charkey), (uchar *)charkey); + BF_set_key(&key, (int)strlen(charkey), (const uchar *)charkey); - BF_cbc_encrypt((uchar *)input, (uchar *)output, size, - &key, iv, action); + BF_cbc_encrypt((const uchar *)input, (uchar *)output, (long)size, + &key, iv, action); - return(1); + return (1); } -/* EOF */