Esempio n. 1
0
static void
processFile(char *name)
{
	switch(mode) {
	case MD_DETECT_FILE_TYPE:
		detectFileType(name);
		break;
	case MD_DUMP:
		dumpFile(name);
		break;
	case MD_SHOW_SIGBLK_PARAMS:
		showSigblkParams(name);
		break;
	case MD_VERIFY:
	case MD_EXTEND:
		verify(name);
		break;
	}
}
Esempio n. 2
0
static void
processFile(char *name)
{
    char errbuf[4096];

    switch(mode) {
    case MD_DETECT_FILE_TYPE:
        if(verbose)
            fprintf(stdout, "ProcessMode: Detect Filetype\n");
#ifdef ENABLEGT
        if (apimode == API_GT)
            detectFileType(name);
#endif
#ifdef ENABLEKSI
        if (apimode == API_KSI)
            detectFileTypeKSI(name);
#endif
        break;
    case MD_DUMP:
        if(verbose)
            fprintf(stdout, "ProcessMode: Dump FileHashes\n");

        if (apimode == API_GT)
#ifdef ENABLEGT
            dumpFile(name);
#else
            fprintf(stderr, "ERROR, unable to perform dump using GuardTime Api, rsyslog need to be configured with --enable-guardtime.\n");
#endif
        if (apimode == API_KSI)
#ifdef ENABLEKSI
            dumpFileKSI(name);
#else
            fprintf(stderr, "ERROR, unable to perform dump using GuardTime KSI Api, rsyslog need to be configured with --enable-gt-ksi.\n");
#endif
        break;
    case MD_SHOW_SIGBLK_PARAMS:
        if(verbose)
            fprintf(stdout, "ProcessMode: Show SigBlk Params\n");
#ifdef ENABLEGT
        if (apimode == API_GT)
            showSigblkParams(name);
#endif
#ifdef ENABLEKSI
        if (apimode == API_KSI)
            showSigblkParamsKSI(name);
#endif
        break;
    case MD_CONVERT:
#ifdef ENABLEGT
        if (apimode == API_GT)
            convertFile(name);
#endif
#ifdef ENABLEKSI
        if (apimode == API_KSI)
            convertFileKSI(name);
#endif
        break;
    case MD_VERIFY:
    case MD_EXTEND:
        if(verbose)
            fprintf(stdout, "ProcessMode: Verify/Extend\n");
        verify(name, errbuf);
        break;
    }
}