Skip to content

Commit

Permalink
fix sign-message and shared-secret without argument bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jg1uaa committed Apr 7, 2023
1 parent a4b7aed commit 436c106
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions command.c
Expand Up @@ -102,6 +102,9 @@ static void command_sign(const char *cmd, const char *arg)
uint8_t id[32], sig[64];
char buf[hexstr_len(sizeof(sig))];

if (arg == NULL)
return;

if (decode_hex(id, sizeof(id), arg) < 0)
return;

Expand All @@ -120,6 +123,9 @@ static void command_shared_secret(const char *cmd, const char *arg)
uint8_t pubkey[hexstr_len(pubkey_len)];
char buf[hexstr_len(sizeof(secret))];

if (arg == NULL)
return;

/* due to defect of decode_hex(), modified arg needed */
if (strlen(arg) != 128)
return;
Expand Down

0 comments on commit 436c106

Please sign in to comment.