Skip to content

Commit

Permalink
Update sdfsign.c
Browse files Browse the repository at this point in the history
  • Loading branch information
guanzhi committed Jul 18, 2024
1 parent ae27f45 commit 228f789
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tools/sdfsign.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static const char *options =
"Examples\n"
"\n"
" $ echo -n 'message to be signed' | gmssl sdfsign -lib libsoftsdf.so -key 1 -pass P@ssw0rd -out sm2.sig\n"
" $ gmssl sdfexport -lib libsoftsdf.so -key 1 -out sm2pub.pem\n"
" $ gmssl sdfexport -lib libsoftsdf.so -sign -key 1 -out sm2pub.pem\n"
" $ echo -n 'message to be signed' | gmssl sm2verify -pubkey sm2pub.pem -sig sm2.sig\n"
"\n";

Expand Down Expand Up @@ -74,6 +74,16 @@ int sdfsign_main(int argc, char **argv)
} else if (!strcmp(*argv, "-lib")) {
if (--argc < 1) goto bad;
lib = *(++argv);
} else if (!strcmp(*argv, "-key")) {
if (--argc < 1) goto bad;
key_index = atoi(*(++argv));
if (key_index < 0) {
fprintf(stderr, "gmssl %s: illegal key index %d\n", prog, key_index);
goto end;
}
} else if (!strcmp(*argv, "-pass")) {
if (--argc < 1) goto bad;
pass = *(++argv);
} else if (!strcmp(*argv, "-id")) {
if (--argc < 1) goto bad;
id = *(++argv);
Expand Down

0 comments on commit 228f789

Please sign in to comment.