28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
+
+
+
+
+
+
|
pinPrompt = strdup("Please enter your PIN: ");
}
printf("%s: ", pinPrompt);
fflush(stdout);
free(pinPrompt);
pinPrompt = NULL;
fgets(pin, sizeof(pin), stdin);
while (strlen(pin) >= 1 && pin[strlen(pin) - 1] == '\n') {
pin[strlen(pin) - 1] = '\0';
}
signLength = sizeof(signBuffer);
rvSign = cackey_chrome_signMessage(&certificates[idxCertificate], "Test", 4, signBuffer, &signLength, &pinPrompt, pin);
}
if (pinPrompt != NULL) {
free(pinPrompt);
}
printf("Signed message \"Test\": %lu bytes (return value = %i)\n", signLength, rvSign);
}
cackey_chrome_freeCertificates(certificates, numCertificates);
cackey_chrome_terminate();
|