Browse Source

DEBUG_LOG() for keymanagement

doc_update_sequoia
Volker Birk 7 years ago
parent
commit
2cb54a7ec1
2 changed files with 32 additions and 4 deletions
  1. +22
    -4
      src/keymanagement.c
  2. +10
    -0
      src/keymanagement.h

+ 22
- 4
src/keymanagement.c View File

@ -19,6 +19,13 @@
#define KEY_EXPIRE_DELTA (60 * 60 * 24 * 365)
#ifdef NDEBUG
#define DEBUG_LOG(TITLE, ENTITY, DESC)
#else
#define DEBUG_LOG(TITLE, ENTITY, DESC) \
log_event(session, (TITLE), (ENTITY), (DESC), "debug");
#endif
DYNAMIC_API PEP_STATUS update_identity(
PEP_SESSION session, pEp_identity * identity
)
@ -204,7 +211,7 @@ DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
pEp_identity *_identity;
log_event(session, "myself", "debug", identity->address, NULL);
DEBUG_LOG("myself", "debug", identity->address);
status = get_identity(session, identity->address, &_identity);
assert(status != PEP_OUT_OF_MEMORY);
if (status == PEP_OUT_OF_MEMORY)
@ -216,13 +223,13 @@ DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity)
return PEP_OUT_OF_MEMORY;
if (keylist == NULL || keylist->value == NULL) {
log_event(session, "generating key pair", "debug", identity->address, NULL);
DEBUG_LOG("generating key pair", "debug", identity->address);
status = generate_keypair(session, identity);
assert(status != PEP_OUT_OF_MEMORY);
if (status != PEP_STATUS_OK) {
char buf[11];
snprintf(buf, 11, "%d", status);
log_event(session, "generating key pair failed", "debug", buf, NULL);
DEBUG_LOG("generating key pair failed", "debug", buf);
return status;
}
@ -280,7 +287,7 @@ DYNAMIC_API PEP_STATUS do_keymanagement(
while ((identity = retrieve_next_identity(management))) {
assert(identity->address);
log_event(session, "do_keymanagement", "debug", identity->address, NULL);
DEBUG_LOG("do_keymanagement", "debug", identity->address);
if (identity->me) {
status = myself(session, identity);
assert(status != PEP_OUT_OF_MEMORY);
@ -297,3 +304,14 @@ DYNAMIC_API PEP_STATUS do_keymanagement(
return PEP_STATUS_OK;
}
DYNAMIC_API PEP_STATUS key_compromized(PEP_SESSION session, const char *fpr)
{
assert(session);
assert(fpr);
if (!(session && fpr))
return PEP_ILLEGAL_VALUE;
return PEP_STATUS_OK;
}

+ 10
- 0
src/keymanagement.h View File

@ -84,6 +84,16 @@ DYNAMIC_API PEP_STATUS do_keymanagement(
void *management
);
// key_compromized() - mark key as being compromized
//
// parameters:
// session (in) session to use
// fpr (in) key which was compromized
DYNAMIC_API PEP_STATUS key_compromized(PEP_SESSION session, const char *fpr);
#ifdef __cplusplus
}
#endif


Loading…
Cancel
Save