Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include <stdio.h>
6 #include <stdlib.h>
8 #include "blapi.h"
9 #include "secutil.h"
11 static int Usage()
12 {
13 fprintf(stderr, "Usage: chktest <full-path-to-shared-library>\n");
14 fprintf(stderr, " Will test for valid chk file.\n");
15 fprintf(stderr, " Will print SUCCESS or FAILURE.\n");
16 exit(1);
17 }
19 int main(int argc, char **argv)
20 {
21 SECStatus rv = SECFailure;
22 PRBool good_result = PR_FALSE;
24 if (argc != 2)
25 return Usage();
27 rv = RNG_RNGInit();
28 if (rv != SECSuccess) {
29 SECU_PrintPRandOSError("");
30 return -1;
31 }
32 rv = BL_Init();
33 if (rv != SECSuccess) {
34 SECU_PrintPRandOSError("");
35 return -1;
36 }
37 RNG_SystemInfoForRNG();
39 good_result = BLAPI_SHVerifyFile(argv[1]);
40 printf("%s\n",
41 (good_result ? "SUCCESS" : "FAILURE"));
42 return (good_result) ? SECSuccess : SECFailure;
43 }