Imported Upstream version 2.7
[ossec-hids.git] / src / os_crypto / sha1 / sha1_op.c
index 159c3cf..99d74ec 100755 (executable)
@@ -1,4 +1,5 @@
-/* @(#) $Id$ */
+/* @(#) $Id: ./src/os_crypto/sha1/sha1_op.c, 2011/09/08 dcid Exp $
+ */
 
 /* Copyright (C) 2009 Trend Micro Inc.
  * All right reserved.
 #include <string.h>
 #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 <openssl/sha.h>  
+#include <openssl/sha.h>
 #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<SHA_DIGEST_LENGTH; n++)
     {
         snprintf(output, 3, "%02x", md[n]);
         output+=2;
     }
-                
+
     /* Closing it */
     fclose(fp);
-        
+
     return(0);
 }