/* * Stolen form Cryptographic API. * * MD4 Message Digest Algorithm (RFC1320). * * Implementation derived from Andrew Tridgell and Steve French's * CIFS MD4 implementation, and the cryptoapi implementation * originally based on the public domain implementation written * by Colin Plumb in 1993. * * Copyright (c) Andrew Tridgell 1997-1998. * Modified by Steve French (sfrench@us.ibm.com) 2002 * Copyright (c) Cryptoapi developers. * Copyright (c) 2002 David S. Miller (davem@redhat.com) * Copyright (c) 2002 James Morris <jmorris@intercode.com.au> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *
*/ #define MD4_DIGEST_SIZE 16 #define MD4_HMAC_BLOCK_SIZE 64 #define MD4_BLOCK_WORDS 16 #define MD4_HASH_WORDS 4
for (i = 0; i < len; i++) { /* Collapse and ignore \ and CR. */ if (file[i] == '\\' && (i+1 < len) && file[i+1] == '\n') {
i++; continue;
}
/* Ignore whitespace */ if (isspace(file[i])) continue;
/* Handle strings as whole units */ if (file[i] == '"') {
i += parse_string(file+i, len - i, md); continue;
}
/* Comments: ignore */ if (file[i] == '/' && file[i+1] == '*') {
i += parse_comment(file+i, len - i); continue;
}
add_char(file[i], md);
}
free(file); return 1;
} /* Check whether the file is a static library or not */ staticbool is_static_library(constchar *objfile)
{ int len = strlen(objfile);
/* We have dir/file.o. Open dir/.file.o.cmd, look for source_ and deps_ line
* to figure out source files. */ staticint parse_source_files(constchar *objfile, struct md4_ctx *md)
{ char *cmd, *file, *line, *dir, *pos; constchar *base; int dirlen, ret = 0, check_files = 0;
cmd = xmalloc(strlen(objfile) + sizeof("..cmd"));
base = get_basename(objfile);
dirlen = base - objfile;
sprintf(cmd, "%.*s.%s.cmd", dirlen, objfile, base);
/* Sum all files in the same dir or subdirs. */ while ((line = get_line(&pos))) { char* p;
/* trim the leading spaces away */ while (isspace(*line))
line++;
p = line;
if (strstarts(line, "source_")) {
p = strrchr(line, ' '); if (!p) {
warn("malformed line: %s\n", line); goto out_file;
}
p++; if (!parse_file(p, md)) {
warn("could not open %s: %s\n",
p, strerror(errno)); goto out_file;
} continue;
} if (strstarts(line, "deps_")) {
check_files = 1; continue;
} if (!check_files) continue;
/* Continue until line does not end with '\' */ if ( *(p + strlen(p)-1) != '\\') break; /* Terminate line at first space, to get rid of final ' \' */ while (*p) { if (isspace(*p)) {
*p = '\0'; break;
}
p++;
}
/* Check if this file is in same dir as objfile */ if ((strstr(line, dir)+strlen(dir)-1) == strrchr(line, '/')) { if (!parse_file(line, md)) {
warn("could not open %s: %s\n",
line, strerror(errno)); goto out_file;
}
}
}
/* Everyone parsed OK */
ret = 1;
out_file:
free(file);
free(dir);
free(cmd); return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.