Browse Source

moved KeyGen state injection from generate_keypair() to the bottom of myself() (in case of successfull keygen), thus ensuring that new identity has been already created when starting to multicast beacons to all own identities.

doc_update_sequoia
Edouard Tisserant 6 years ago
parent
commit
2cf840e4e7
2 changed files with 11 additions and 5 deletions
  1. +11
    -1
      src/keymanagement.c
  2. +0
    -4
      src/pEpEngine.c

+ 11
- 1
src/keymanagement.c View File

@ -447,7 +447,9 @@ DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
return status;
}
}
bool new_key_generated = false;
if (EMPTYSTR(identity->fpr) || revoked)
{
if(revoked)
@ -467,6 +469,8 @@ DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
free(r_fpr);
return status;
}
new_key_generated = true;
if(revoked)
{
@ -503,6 +507,12 @@ DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
return status;
}
// if a state machine for keysync is in place, inject notify
if (session->sync_state != DeviceState_state_NONE)
status = fsm_DeviceState_inject(session, KeyGen, NULL, NULL);
if (status != PEP_STATUS_OK)
return status;
return PEP_STATUS_OK;
}


+ 0
- 4
src/pEpEngine.c View File

@ -1353,10 +1353,6 @@ DYNAMIC_API PEP_STATUS generate_keypair(
if (status != PEP_STATUS_OK)
return status;
// if a state machine for keysync is in place, inject notify
if (session->sync_state != DeviceState_state_NONE)
status = fsm_DeviceState_inject(session, KeyGen, NULL, NULL);
return status;
}


Loading…
Cancel
Save