X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fos_crypto%2Fblowfish%2Fbf_op.c;fp=src%2Fos_crypto%2Fblowfish%2Fbf_op.c;h=fe29f7f0e07f36a40b3c79a7c8a8e2fbb5510442;hp=d7a111841703a60dd2c0c8326f3ed186ca2f4ea7;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b 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 d7a1118..fe29f7f --- a/src/os_crypto/blowfish/bf_op.c +++ b/src/os_crypto/blowfish/bf_op.c @@ -1,5 +1,3 @@ -/* $OSSEC, os_crypto/blowfish_op.c, v0.2, 2005/09/17, Daniel B. Cid$ */ - /* Copyright (C) 2009 Trend Micro Inc. * All right reserved. * @@ -9,12 +7,8 @@ * 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 */