Browse Source

temporary: revert to the old-style sequoia FFI, and an old sequoia as dependency

master
Luca Saiu 5 months ago
parent
commit
a8c318b667
5 changed files with 4324 additions and 91 deletions
  1. +8
    -2
      DEPENDENCIES
  2. +4
    -4
      Makefile.conf
  3. +31
    -31
      src/pEp_internal.h
  4. +4277
    -54
      src/pgp_sequoia.c
  5. +4
    -0
      test/Makefile

+ 8
- 2
DEPENDENCIES View File

@ -1,6 +1,12 @@
# 1st Party Dependencies
## Prefer git tags instead of SHA hashes when possible.
sequoia=openpgp/v1.7.0
pEpEngineSequoiaBackend=9d04816d381111cc770d92d92ba510bbe7a0b794
# Temporarily re-enabled, in order to have the old-style FFI that works on
# every platform.
sequoia=openpgp/v1.3.1
# Temporarily disabled
# pEpEngineSequoiaBackend=9d04816d381111cc770d92d92ba510bbe7a0b794
yml2=2.7.1
libpEpTransport=5738d9f0703215d923d396fa1720631a7003f284

+ 4
- 4
Makefile.conf View File

@ -339,16 +339,16 @@ endif
# Otherwise, add them to the CFLAGS/CXXFLAGS/LDFLAGS and library/include variables
ifeq ($(OPENPGP),SEQUOIA)
ifeq ($(SEQUOIA_CFLAGS),)
SEQUOIA_CFLAGS+=$(shell pkg-config --cflags-only-other pep_engine_sequoia_backend) -O2
SEQUOIA_CFLAGS+=$(shell pkg-config --cflags-only-other sequoia-openpgp) -O2
endif
ifeq ($(SEQUOIA_LDFLAGS),)
SEQUOIA_LDFLAGS+=$(shell pkg-config --libs-only-L pep_engine_sequoia_backend)
SEQUOIA_LDFLAGS+=$(shell pkg-config --libs-only-L sequoia-openpgp)
endif
ifeq ($(SEQUOIA_LIB),)
SEQUOIA_LIB=$(shell pkg-config --libs-only-l --libs-only-other pep_engine_sequoia_backend)
SEQUOIA_LIB=$(shell pkg-config --libs-only-l --libs-only-other sequoia-openpgp)
endif
ifeq ($(SEQUOIA_INC),)
SEQUOIA_INC=$(shell pkg-config --cflags-only-I pep_engine_sequoia_backend)
SEQUOIA_INC=$(shell pkg-config --cflags-only-I sequoia-openpgp)
endif
CFLAGS+= $(SEQUOIA_CFLAGS)
CXXFLAGS+= $(SEQUOIA_CFLAGS)


+ 31
- 31
src/pEp_internal.h View File

@ -110,6 +110,10 @@
#include "keymanagement_internal.h"
#include "message_api_internal.h"
#if defined(USE_SEQUOIA)
#include "pgp_sequoia_internal.h"
#endif
#include "../asn.1/Distribution.h"
#include "../asn.1/Sync.h"
@ -132,41 +136,37 @@ typedef struct _pEpSession pEpSession;
*/
struct _pEpSession {
const char *version;
// This ***must*** be the second pointer. Do not disappoint.
void *cryptotech_cookie;
// These four fields but be next. Do not disappoint.
char* curr_passphrase;
bool new_key_pass_enable;
char* generation_passphrase;
PEP_CIPHER_SUITE cipher_suite;
messageToSend_t messageToSend;
// #if defined(USE_SEQUOIA)
// sqlite3 *key_db;
// struct {
// sqlite3_stmt *begin_transaction;
// sqlite3_stmt *commit_transaction;
// sqlite3_stmt *rollback_transaction;
// sqlite3_stmt *cert_find;
// sqlite3_stmt *tsk_find;
// sqlite3_stmt *cert_find_by_keyid;
// sqlite3_stmt *tsk_find_by_keyid;
// sqlite3_stmt *cert_find_by_email;
// sqlite3_stmt *tsk_find_by_email;
// sqlite3_stmt *cert_all;
// sqlite3_stmt *tsk_all;
// sqlite3_stmt *cert_save_insert_primary;
// sqlite3_stmt *cert_save_insert_subkeys;
// sqlite3_stmt *cert_save_insert_userids;
// sqlite3_stmt *delete_keypair;
// } sq_sql;
//
// pgp_policy_t policy;
// #endif
#if defined(USE_SEQUOIA)
sqlite3 *key_db;
struct {
sqlite3_stmt *begin_transaction;
sqlite3_stmt *commit_transaction;
sqlite3_stmt *rollback_transaction;
sqlite3_stmt *cert_find;
sqlite3_stmt *tsk_find;
sqlite3_stmt *cert_find_by_keyid;
sqlite3_stmt *tsk_find_by_keyid;
sqlite3_stmt *cert_find_by_email;
sqlite3_stmt *tsk_find_by_email;
sqlite3_stmt *cert_all;
sqlite3_stmt *tsk_all;
sqlite3_stmt *cert_save_insert_primary;
sqlite3_stmt *cert_save_insert_subkeys;
sqlite3_stmt *cert_save_insert_userids;
sqlite3_stmt *delete_keypair;
} sq_sql;
pgp_policy_t policy;
#endif
PEP_cryptotech_t *cryptotech;
PEP_CIPHER_SUITE cipher_suite;
char* curr_passphrase;
bool new_key_pass_enable;
char* generation_passphrase;
PEP_transport_t *transports;


+ 4277
- 54
src/pgp_sequoia.c
File diff suppressed because it is too large
View File


+ 4
- 0
test/Makefile View File

@ -119,6 +119,10 @@ ifeq ($(BUILD_ON),OS/390)
LDLIBS+=-lzz
endif
ifeq ($(OPENPGP),SEQUOIA)
LDLIBS+=-lsequoia_openpgp_ffi
endif
$(TARGET): $(OBJS)
${CXX} ${LDFLAGS} -L${PREFIX}/lib -o $@ $^ $(LDLIBS)


Loading…
Cancel
Save