Browse Source

added use_only_own_private_keys (testing)

doc_update_sequoia
Edouard Tisserant 6 years ago
parent
commit
cdc6a9d4a1
3 changed files with 24 additions and 6 deletions
  1. +9
    -6
      src/keymanagement.c
  2. +13
    -0
      src/pEpEngine.c
  3. +2
    -0
      src/pEp_internal.h

+ 9
- 6
src/keymanagement.c View File

@ -321,16 +321,19 @@ DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
for (_keylist = keylist; _keylist && _keylist->value; _keylist = _keylist->next) {
bool is_own = false;
status = own_key_is_listed(session, _keylist->value, &is_own);
assert(status == PEP_STATUS_OK);
if (status != PEP_STATUS_OK) {
free_stringlist(keylist);
return status;
if (_session->use_only_own_private_keys)
{
status = own_key_is_listed(session, _keylist->value, &is_own);
assert(status == PEP_STATUS_OK);
if (status != PEP_STATUS_OK) {
free_stringlist(keylist);
return status;
}
}
// TODO : also accept synchronized device group keys ?
if (is_own)
if (!_session->use_only_own_private_keys || is_own)
{
PEP_comm_type _comm_type_key;


+ 13
- 0
src/pEpEngine.c View File

@ -414,6 +414,13 @@ DYNAMIC_API PEP_STATUS init(PEP_SESSION *session)
_session->passive_mode = false;
_session->unencrypted_subject = false;
#ifdef ANDROID
_session->use_only_own_private_keys = true;
#elif TARGET_OS_IPHONE
_session->use_only_own_private_keys = true;
#else
_session->use_only_own_private_keys = false;
#endif
*session = _session;
return PEP_STATUS_OK;
@ -505,6 +512,12 @@ DYNAMIC_API void config_unencrypted_subject(PEP_SESSION session, bool enable)
session->unencrypted_subject = enable;
}
DYNAMIC_API void config_use_only_own_private_keys(PEP_SESSION session, bool enable)
{
assert(session);
session->use_only_own_private_keys = enable;
}
DYNAMIC_API PEP_STATUS log_event(
PEP_SESSION session,
const char *title,


+ 2
- 0
src/pEp_internal.h View File

@ -133,6 +133,8 @@ typedef struct _pEpSession {
bool passive_mode;
bool unencrypted_subject;
bool use_only_own_private_keys;
} pEpSession;
PEP_STATUS init_transport_system(PEP_SESSION session, bool in_first);


Loading…
Cancel
Save