Fix file IO ambiguity for UI scripts

The variable sm should contain the signature and the message,
not the message and the signature (i.e. the order is crucial).
This commit is contained in:
Joost Rijneveld 2017-10-19 16:08:09 +02:00
parent 2c976d5268
commit c803860cf8
No known key found for this signature in database
GPG Key ID: A4FE39CF49CBC553
4 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ int main(int argc, char **argv) {
if (argc != 2) { if (argc != 2) {
fprintf(stderr, "Expected keypair filename as only parameter, " fprintf(stderr, "Expected keypair filename as only parameter, "
"and the message + signature via stdin.\n" "and the signature + message via stdin.\n"
"Keypair file needs only to contain the public key.\n" "Keypair file needs only to contain the public key.\n"
"The return code 0 indicates verification success.\n"); "The return code 0 indicates verification success.\n");
return -1; return -1;

View File

@ -18,7 +18,7 @@ int main(int argc, char **argv) {
return -1; return -1;
} }
keypair = fopen(argv[1], "rb"); keypair = fopen(argv[1], "r+b");
if (keypair == NULL) { if (keypair == NULL) {
fprintf(stderr, "Could not open keypair file.\n"); fprintf(stderr, "Could not open keypair file.\n");
return -1; return -1;

View File

@ -12,7 +12,7 @@ int main(int argc, char **argv) {
if (argc != 2) { if (argc != 2) {
fprintf(stderr, "Expected keypair filename as only parameter, " fprintf(stderr, "Expected keypair filename as only parameter, "
"and the message + signature via stdin.\n" "and the signature + message via stdin.\n"
"Keypair file needs only to contain the public key.\n" "Keypair file needs only to contain the public key.\n"
"The return code 0 indicates verification success.\n"); "The return code 0 indicates verification success.\n");
return -1; return -1;

View File

@ -18,7 +18,7 @@ int main(int argc, char **argv) {
return -1; return -1;
} }
keypair = fopen(argv[1], "rb"); keypair = fopen(argv[1], "r+b");
if (keypair == NULL) { if (keypair == NULL) {
fprintf(stderr, "Could not open keypair file.\n"); fprintf(stderr, "Could not open keypair file.\n");
return -1; return -1;