int main(int argc, char **argv) { SECStatus rv = SECFailure; PRBool good_result = PR_FALSE; if (argc != 2) return Usage(); rv = RNG_RNGInit(); if (rv != SECSuccess) { SECU_PrintPRandOSError(""); return -1; } rv = BL_Init(); if (rv != SECSuccess) { SECU_PrintPRandOSError(""); return -1; } RNG_SystemInfoForRNG(); good_result = BLAPI_SHVerifyFile(argv[1]); printf("%s\n", (good_result ? "SUCCESS" : "FAILURE")); return (good_result) ? SECSuccess : SECFailure; }
PRBool BLAPI_SHVerify(const char *name, PRFuncPtr addr) { PRBool result = PR_FALSE; /* if anything goes wrong, * the signature does not verify */ /* find our shared library name */ char *shName = PR_GetLibraryFilePathname(name, addr); if (!shName) { goto loser; } result = BLAPI_SHVerifyFile(shName); loser: if (shName != NULL) { PR_Free(shName); } return result; }
PRBool BLAPI_SHVerify(const char *name, PRFuncPtr addr) { #ifdef PSEUDO_FIPS return PR_TRUE; /* a lie, hence *pseudo* FIPS */ #else PRBool result = PR_FALSE; /* if anything goes wrong, * the signature does not verify */ /* find our shared library name */ char *shName = PR_GetLibraryFilePathname(name, addr); if (!shName) { goto loser; } result = BLAPI_SHVerifyFile(shName); loser: if (shName != NULL) { PR_Free(shName); } return result; #endif /* PSEUDO_FIPS */ }