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 7 years ago
parent 28fd680839
commit 2cf840e4e7

@ -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;
}

@ -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