mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 05:07:56 +00:00
Fixed bug in "keyring add" command.
Added opening of keyring in "mdp ping" command. MDP ping now works with the new keyring framework (but authcryption is not being attempted it seems).
This commit is contained in:
parent
faa2f5ef6c
commit
4de6622c68
@ -351,6 +351,8 @@ int app_mdp_ping(int argc,char **argv,struct command_line_option *o)
|
||||
{
|
||||
char *sid=cli_arg(argc,argv,o,"SID|broadcast","broadcast");
|
||||
|
||||
if (!keyring) keyring=keyring_open_with_pins("");
|
||||
|
||||
/* MDP frames consist of:
|
||||
destination SID (32 bytes)
|
||||
destination port (4 bytes)
|
||||
@ -736,13 +738,13 @@ int app_keyring_add(int argc, char **argv, struct command_line_option *o)
|
||||
if (!k) { fprintf(stderr,"keyring add:Failed to create/open keyring file\n");
|
||||
return -1; }
|
||||
|
||||
if (keyring_create_identity(k,k->contexts[0],(char *)pin))
|
||||
if (keyring_create_identity(k,k->contexts[0],(char *)pin)==NULL)
|
||||
{
|
||||
fprintf(stderr,"Could not create new identity\n");
|
||||
fprintf(stderr,"Could not create new identity (keyring_create_identity() failed)\n");
|
||||
return -1;
|
||||
}
|
||||
if (keyring_commit(k)) {
|
||||
fprintf(stderr,"Could not write new identity\n");
|
||||
fprintf(stderr,"Could not write new identity (keyring_commit() failed)\n");
|
||||
return -1;
|
||||
}
|
||||
keyring_free(k);
|
||||
|
Loading…
Reference in New Issue
Block a user