Sync : asynchronously inject KeyGen and CannotDecrypt to fsm

doc_update_sequoia
Edouard Tisserant 7 years ago
parent 5e85411af8
commit ee8eccb069

@ -9,6 +9,8 @@
#include "pEp_internal.h"
#include "keymanagement.h"
#include "sync_fsm.h"
#ifndef EMPTYSTR
#define EMPTYSTR(STR) ((STR) == NULL || (STR)[0] == '\0')
#endif
@ -513,8 +515,7 @@ DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
if(new_key_generated)
{
// 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);
status = inject_DeviceState_event(session, KeyGen, NULL, NULL);
if (status != PEP_STATUS_OK)
return status;
}

@ -1434,8 +1434,10 @@ DYNAMIC_API PEP_STATUS _decrypt_message(
}
status = cryptotech[crypto].decrypt_and_verify(session, ctext,
csize, &ptext, &psize, &_keylist);
if (status > PEP_CANNOT_DECRYPT_UNKNOWN)
if (status > PEP_CANNOT_DECRYPT_UNKNOWN){
status = inject_DeviceState_event(session, CannotDecrypt, NULL, NULL);
goto pep_error;
}
decrypt_status = status;

@ -86,6 +86,14 @@ PEP_STATUS receive_DeviceState_msg(
stringlist_t *keylist
);
// event injector
PEP_STATUS inject_DeviceState_event(
PEP_SESSION session,
DeviceState_event event,
Identity partner,
void *extra);
// state machine
DeviceState_state fsm_DeviceState(

@ -13,6 +13,12 @@ PEP_STATUS receive_sync_msg(
sync_msg_t *sync_msg
);
PEP_STATUS inject_DeviceState_event(
PEP_SESSION session,
DeviceState_event event,
Identity partner,
void *extra);
PEP_STATUS receive_DeviceState_msg(
PEP_SESSION session,
message *src,

Loading…
Cancel
Save