michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #include "blapi.h" michael@0: #include "secutil.h" michael@0: michael@0: static int Usage() michael@0: { michael@0: fprintf(stderr, "Usage: chktest \n"); michael@0: fprintf(stderr, " Will test for valid chk file.\n"); michael@0: fprintf(stderr, " Will print SUCCESS or FAILURE.\n"); michael@0: exit(1); michael@0: } michael@0: michael@0: int main(int argc, char **argv) michael@0: { michael@0: SECStatus rv = SECFailure; michael@0: PRBool good_result = PR_FALSE; michael@0: michael@0: if (argc != 2) michael@0: return Usage(); michael@0: michael@0: rv = RNG_RNGInit(); michael@0: if (rv != SECSuccess) { michael@0: SECU_PrintPRandOSError(""); michael@0: return -1; michael@0: } michael@0: rv = BL_Init(); michael@0: if (rv != SECSuccess) { michael@0: SECU_PrintPRandOSError(""); michael@0: return -1; michael@0: } michael@0: RNG_SystemInfoForRNG(); michael@0: michael@0: good_result = BLAPI_SHVerifyFile(argv[1]); michael@0: printf("%s\n", michael@0: (good_result ? "SUCCESS" : "FAILURE")); michael@0: return (good_result) ? SECSuccess : SECFailure; michael@0: }