X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=src%2Fos_crypto%2Fsha1%2Fsha1_op.c;h=99d74ec7c4e345efb5b00ef6d9eaa102fbfb85c4;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hp=3b1ad04b45d0370f18a2e947c695125aa5085bb6;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a;p=ossec-hids.git diff --git a/src/os_crypto/sha1/sha1_op.c b/src/os_crypto/sha1/sha1_op.c index 3b1ad04..99d74ec 100755 --- a/src/os_crypto/sha1/sha1_op.c +++ b/src/os_crypto/sha1/sha1_op.c @@ -1,11 +1,12 @@ -/* @(#) $Id: sha1_op.c,v 1.7 2009/06/24 17:06:29 dcid Exp $ */ +/* @(#) $Id: ./src/os_crypto/sha1/sha1_op.c, 2011/09/08 dcid Exp $ + */ /* 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 */ @@ -14,20 +15,20 @@ #include #include "sha1_op.h" -/* Openssl sha1 +/* Openssl sha1 * Only use if open ssl is not available. #ifndef USE_OPENSSL #include "sha.h" #include "sha_locl.h" #else -#include +#include #endif */ #include "sha_locl.h" - + int OS_SHA1_File(char * fname, char * output) { SHA_CTX c; @@ -35,32 +36,32 @@ int OS_SHA1_File(char * fname, char * output) unsigned char buf[2048 +2]; unsigned char md[SHA_DIGEST_LENGTH]; int n; - + memset(output,0, 65); buf[2049] = '\0'; - + fp = fopen(fname,"r"); if(!fp) return(-1); - + SHA1_Init(&c); while((n = fread(buf, 1, 2048, fp)) > 0) { buf[n] = '\0'; SHA1_Update(&c,buf,(unsigned long)n); } - + SHA1_Final(&(md[0]),&c); - + for (n=0; n