adding blacklist test

doc_update_sequoia
Volker Birk 7 years ago
parent 9335495d8f
commit 81bf33f33d

@ -2,6 +2,7 @@
#include "dynamic_api.h"
#include "cryptotech.h"
#include "transport.h"
#include "blacklist.h"
static int init_count = -1;
@ -724,6 +725,15 @@ DYNAMIC_API PEP_STATUS set_identity(
identity->user_id && identity->username))
return PEP_ILLEGAL_VALUE;
bool listed;
PEP_STATUS status = blacklist_is_listed(session, identity->fpr, &listed);
assert(status == PEP_STATUS_OK);
if (status != PEP_STATUS_OK)
return status;
if (listed)
return PEP_KEY_BLACKLISTED;
sqlite3_exec(session->db, "BEGIN ;", NULL, NULL, NULL);
sqlite3_reset(session->set_person);

@ -45,6 +45,7 @@ typedef enum {
PEP_CANNOT_SET_PGP_KEYPAIR = 0x0382,
PEP_CANNOT_SET_IDENTITY = 0x0383,
PEP_CANNOT_SET_TRUST = 0x0384,
PEP_KEY_BLACKLISTED = 0x0385,
PEP_UNENCRYPTED = 0x0400,
PEP_VERIFIED = 0x0401,
@ -459,6 +460,7 @@ DYNAMIC_API PEP_STATUS get_identity(
// PEP_CANNOT_SET_PGP_KEYPAIR writing to table pgp_keypair failed
// PEP_CANNOT_SET_IDENTITY writing to table identity failed
// PEP_COMMIT_FAILED SQL commit failed
// PEP_KEY_BLACKLISTED Key blacklisted, cannot set identity
//
// caveat:
// in the identity structure you need to set the const char * fields to

Loading…
Cancel
Save