Replace use of Sequoia's backend with a custom key store.
- Sequoia's key store doesn't meet pep's needs (in particular, the
ability to search on a key's user id) and trying to shoehorn pep's
needs onto Sequoia's key store abstractions is just introducing
overhead with no appreciable gain in functionality.
- This patch changes the Sequoia backend to use a local sqlite
database to store the public keys.
1 // This file is under GNU General Public License 3.0
15 typedef enum _sync_handshake_signal {
16 SYNC_NOTIFY_UNDEFINED = 0,
18 // request show handshake dialog
19 SYNC_NOTIFY_INIT_ADD_OUR_DEVICE,
20 SYNC_NOTIFY_INIT_ADD_OTHER_DEVICE,
21 SYNC_NOTIFY_INIT_FORM_GROUP,
22 SYNC_NOTIFY_INIT_MOVE_OUR_DEVICE,
24 // handshake process timed out
27 // handshake accepted by user
28 SYNC_NOTIFY_ACCEPTED_DEVICE_ADDED,
29 SYNC_NOTIFY_ACCEPTED_GROUP_CREATED,
30 SYNC_NOTIFY_ACCEPTED_DEVICE_MOVED,
32 // handshake dialog must be closed
34 } sync_handshake_signal;
37 // notifyHandshake() - notify UI about sync handshaking process
40 // obj (in) object handle (implementation defined)
41 // me (in) own identity
42 // partner (in) identity of partner
43 // signal (in) reason of the notification
46 // PEP_STATUS_OK or any other value on error
49 // ownership of self and partner go to the callee
51 typedef PEP_STATUS (*notifyHandshake_t)(
53 pEp_identity *partner,
54 sync_handshake_signal signal
57 typedef enum _sync_handshake_result {
58 SYNC_HANDSHAKE_CANCEL = -1,
59 SYNC_HANDSHAKE_ACCEPTED = 0,
60 SYNC_HANDSHAKE_REJECTED = 1
61 } sync_handshake_result;
63 // deliverHandshakeResult() - give the result of the handshake dialog
66 // session (in) session handle
67 // result (in) handshake result
69 DYNAMIC_API PEP_STATUS deliverHandshakeResult(
71 pEp_identity *partner,
72 sync_handshake_result result
76 // retrieve_next_sync_event - receive next sync event
79 // management (in) application defined; usually a locked queue
80 // threshold (in) threshold in seconds for timeout
86 // an implementation of retrieve_next_sync_event must return
87 // new_sync_timeout_event() in case of timeout
89 typedef SYNC_EVENT (*retrieve_next_sync_event_t)(void *management,
93 // register_sync_callbacks() - register adapter's callbacks
96 // session (in) session where to store obj handle
97 // management (in) application defined; usually a locked queue
98 // notifyHandshake (in) callback for doing the handshake
99 // retrieve_next_sync_event (in) callback for receiving sync event
102 // PEP_STATUS_OK or any other value on errror
105 // call that BEFORE you're using any other part of the engine
107 DYNAMIC_API PEP_STATUS register_sync_callbacks(
110 notifyHandshake_t notifyHandshake,
111 retrieve_next_sync_event_t retrieve_next_sync_event
114 DYNAMIC_API void unregister_sync_callbacks(PEP_SESSION session);
117 // do_sync_protocol() - function to be run on an extra thread
120 // session pEp session to use
121 // retrieve_next_sync_msg pointer to retrieve_next_identity() callback
122 // which returns at least a valid address field in
123 // the identity struct
124 // obj application defined sync object
127 // PEP_STATUS_OK if thread has to terminate successfully or any other
130 DYNAMIC_API PEP_STATUS do_sync_protocol(
136 // do_sync_protocol_step() - function for single threaded implementations
139 // session pEp session to use
140 // retrieve_next_sync_msg pointer to retrieve_next_identity() callback
141 // which returns at least a valid address field in
142 // the identity struct
143 // obj application defined sync object
144 // event Sync event to process
146 DYNAMIC_API PEP_STATUS do_sync_protocol_step(
153 // is_sync_thread() - determine if this is sync thread's session
156 // session pEp session to test
159 // true if this is sync thread's session, false otherwise
161 DYNAMIC_API bool is_sync_thread(PEP_SESSION session);
164 // new_sync_timeout_event() - create a Sync timeout event
167 // returns a new Sync timeout event, or NULL on failure
169 DYNAMIC_API SYNC_EVENT new_sync_timeout_event();