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
5 #define _POSIX_C_SOURCE 200809L
11 #include <sys/select.h>
12 #include <sys/param.h>
16 #include <uuid/uuid.h>
25 const char *unix_local_db(void);
26 const char *gpg_conf(void);
27 const char *gpg_agent_conf(void);
28 const char *gpg_home(void);
30 const char *unix_local_db(int reset);
31 const char *gpg_conf(int reset);
32 const char *gpg_agent_conf(int reset);
33 const char *gpg_home(int reset);
39 time_t timegm(struct tm* const t);
41 char *stpncpy(char *, const char *, size_t);
42 char *stpcpy(char *, const char *);
44 // Beware: predictable pseudo random with static seed!
45 // Only the lowest 31 bits are filled randomly.
46 //long int random(void);
48 const char *android_system_db(void);
49 #define SYSTEM_DB android_system_db()
51 #define LIBGPGME "libgpgme.11.dylib"
53 #define LIBGPGME "libgpgme.so"
57 #include "TargetConditionals.h"
61 extern char* SystemDB;
62 #define SYSTEM_DB SystemDB
67 #if !defined(BSD) && !defined(__APPLE__)
68 size_t strlcpy(char* dst, const char* src, size_t size);
69 size_t strlcat(char* dst, const char* src, size_t size);
71 // N.B. This is ifdef'd out because NDK users sometimes have trouble finding regex functions in
72 // the library in spite of the inclusion of regex.h - this is a FIXME, but since iOS is
73 // *currently* the only netpgp user, we will ifdef this so that we don't block Android.
75 int regnexec(const regex_t* preg, const char* string,
76 size_t len, size_t nmatch, regmatch_t pmatch[], int eflags);
81 #ifndef _UUID_STRING_T
82 #define _UUID_STRING_T
83 typedef char uuid_string_t[37];
88 // on *nix, uuid_t is an array and already implements pointer semantics
92 typedef char pEpUUID[16];
93 void uuid_generate_random(pEpUUID out);
94 void uuid_unparse_upper(pEpUUID uu, uuid_string_t out);
96 typedef uuid_t pEpUUID;