X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fos_crypto%2Fshared%2Fmsgs.c;h=4587bf9786b1f1345fd5c489ce32d5cad208f539;hb=927951d1c1ad45ba9e7325f07d996154a91c911b;hp=eab2a52db5d41594a8ad812a8d265ac49f33cb3c;hpb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;p=ossec-hids.git diff --git a/src/os_crypto/shared/msgs.c b/src/os_crypto/shared/msgs.c index eab2a52..4587bf9 100755 --- a/src/os_crypto/shared/msgs.c +++ b/src/os_crypto/shared/msgs.c @@ -86,7 +86,7 @@ void OS_StartCounter(keystore *keys) int my_error = errno; /* Just in case we run out of file descriptiors */ - if((keys->keyentries[i -1]->fp) && (i > 10)) + if((i > 10) && (keys->keyentries[i -1]->fp)) { fclose(keys->keyentries[i -1]->fp); @@ -268,7 +268,7 @@ char *ReadSecMSG(keystore *keys, char *buffer, char *cleartext, } /* Uncompressing */ - cmp_size = os_uncompress(cleartext, buffer, buffer_size, OS_MAXSTR); + cmp_size = os_zlib_uncompress(cleartext, buffer, buffer_size, OS_MAXSTR); if(!cmp_size) { merror(UNCOMPRESS_ERR, __local_name); @@ -488,7 +488,7 @@ int CreateSecMSG(keystore *keys, char *msg, char *msg_encrypted, int id) local_count++; - snprintf(_tmpmsg, OS_MAXSTR,"%05hu%010u:%04hu:%s", + snprintf(_tmpmsg, OS_MAXSTR,"%05hu%010u:%04u:%s", rand1, global_count, local_count, msg); @@ -506,7 +506,7 @@ int CreateSecMSG(keystore *keys, char *msg, char *msg_encrypted, int id) /* Compressing message. * We assing the first 8 bytes for padding. */ - cmp_size = os_compress(_finmsg, _tmpmsg + 8, msg_size, OS_MAXSTR - 12); + cmp_size = os_zlib_compress(_finmsg, _tmpmsg + 8, msg_size, OS_MAXSTR - 12); if(!cmp_size) { merror(COMPRESS_ERR, __local_name, _finmsg);