Ver código fonte

* Remove MD5FILE, never used

Bryan Drewery 17 anos atrás
pai
commit
f7408f2e58
2 arquivos alterados com 0 adições e 26 exclusões
  1. 0 25
      src/crypt.c
  2. 0 1
      src/crypt.h

+ 0 - 25
src/crypt.c

@@ -192,31 +192,6 @@ int md5cmp(const char *hash, const char *string) {
   return n;
   return n;
 }
 }
 
 
-char *
-MD5FILE(const char *bin)
-{
-  FILE *f = NULL;
-
-  if (!(f = fopen(bin, "rb")))
-    return "";
-
-  static char     md5string[MD5_HASH_LENGTH + 1] = "";
-  unsigned char   md5out[MD5_HASH_LENGTH + 1] = "", buffer[1024] = "";
-  MD5_CTX ctx;
-  size_t binsize = 0, len = 0;
-
-  MD5_Init(&ctx);
-  while ((len = fread(buffer, 1, sizeof buffer, f))) {
-    binsize += len;
-    MD5_Update(&ctx, buffer, len);
-  }
-  MD5_Final(md5out, &ctx);
-  btoh(md5out, MD5_DIGEST_LENGTH, md5string, sizeof(md5string));
-  OPENSSL_cleanse(&ctx, sizeof(ctx));
-
-  return md5string;
-}
-
 char *SHA1(const char *string)
 char *SHA1(const char *string)
 {
 {
   static int n = 0;
   static int n = 0;

+ 0 - 1
src/crypt.h

@@ -23,7 +23,6 @@ namespace bd {
 
 
 char *MD5(const char *);
 char *MD5(const char *);
 int md5cmp(const char *, const char*);
 int md5cmp(const char *, const char*);
-char *MD5FILE(const char *);
 char *SHA1(const char *);
 char *SHA1(const char *);
 int sha1cmp(const char *, const char*);
 int sha1cmp(const char *, const char*);