summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-12-10 13:02:52 +0100
committerJustus Winter <justus@sequoia-pgp.org>2021-12-10 13:02:52 +0100
commitcf4c70b46040a53bf3992a124ba70b1b1ca852f1 (patch)
treec321c5f549dc2d69519bd68bf540f78e7a294735
parent34b930595f7e125cbbad64404c79de454c6e62ef (diff)
Remove the ffi crates.
- Remove the general-purpose ffi crates. They will be moved into their own repository. Note that we consider general-purpose ffi crates to be a dead end: exposing Sequoia's interface requires a large number of types and functions, and using the interface from C turned out to be verbose and error-prone. Instead, we prefer to write point solutions in Rust that implement exactly the functionality the downstream consumer needs, then expose this via ffi bindings. - See https://gitlab.com/sequoia-pgp/sequoia-ffi.
-rw-r--r--.Makefile12
-rw-r--r--.gitlab-ci.yml6
-rw-r--r--Cargo.lock61
-rw-r--r--Cargo.toml3
-rw-r--r--ffi-macros/Cargo.toml33
l---------ffi-macros/LICENSE.txt1
-rw-r--r--ffi-macros/README.md1
-rw-r--r--ffi-macros/src/lib.rs1026
-rw-r--r--ffi-macros/src/rust2c.rs174
-rw-r--r--ffi/.gitignore1
-rw-r--r--ffi/Cargo.toml49
l---------ffi/LICENSE.txt1
-rw-r--r--ffi/Makefile91
-rw-r--r--ffi/examples/Makefile28
-rw-r--r--ffi/examples/configure.c51
-rw-r--r--ffi/examples/keyserver.c56
-rw-r--r--ffi/include/sequoia.h9
-rw-r--r--ffi/include/sequoia/core.h172
-rw-r--r--ffi/include/sequoia/net.h99
-rw-r--r--ffi/lang/python/.gitignore8
-rw-r--r--ffi/lang/python/Makefile89
-rw-r--r--ffi/lang/python/README.md5
-rw-r--r--ffi/lang/python/examples/decrypt.py42
-rw-r--r--ffi/lang/python/sequoia/__init__.py7
-rw-r--r--ffi/lang/python/sequoia/core.py119
-rw-r--r--ffi/lang/python/sequoia/error.py69
-rw-r--r--ffi/lang/python/sequoia/glue.py127
-rw-r--r--ffi/lang/python/sequoia/net.py50
-rw-r--r--ffi/lang/python/sequoia/openpgp.py361
-rw-r--r--ffi/lang/python/sequoia/prelude.py5
-rw-r--r--ffi/lang/python/sequoia/sequoia_build.py59
-rw-r--r--ffi/lang/python/setup.cfg2
-rw-r--r--ffi/lang/python/setup.py41
-rw-r--r--ffi/lang/python/tests/test_armor.py69
-rw-r--r--ffi/lang/python/tests/test_cert.py67
-rw-r--r--ffi/lang/python/tests/test_fingerprint.py45
-rw-r--r--ffi/lang/python/tests/test_keyid.py63
-rw-r--r--ffi/lang/python/tests/test_keyserver.py10
-rw-r--r--ffi/lang/python/tests/test_packet_parser.py52
-rw-r--r--ffi/sequoia.pc.in11
-rw-r--r--ffi/src/core.rs200
-rw-r--r--ffi/src/error.rs99
-rw-r--r--ffi/src/lib.rs148
-rw-r--r--ffi/src/net.rs158
-rw-r--r--ffi/tests/c-tests.rs323
-rw-r--r--openpgp-ffi/Cargo.toml45
l---------openpgp-ffi/LICENSE.txt1
-rw-r--r--openpgp-ffi/Makefile102
-rw-r--r--openpgp-ffi/examples/Makefile36
-rw-r--r--openpgp-ffi/examples/armor.c68
-rw-r--r--openpgp-ffi/examples/decrypt-with.c255
-rw-r--r--openpgp-ffi/examples/encrypt-for.c92
-rw-r--r--openpgp-ffi/examples/example.c37
-rw-r--r--openpgp-ffi/examples/generate-key.c38
-rw-r--r--openpgp-ffi/examples/immutable-reference-demo.c59
-rw-r--r--openpgp-ffi/examples/parser.c82
-rw-r--r--openpgp-ffi/examples/reader-cookie.c19
-rw-r--r--openpgp-ffi/examples/reader.c40
-rw-r--r--openpgp-ffi/examples/sign.c106
-rw-r--r--openpgp-ffi/examples/type-safety-demo.c36
-rw-r--r--openpgp-ffi/examples/use-after-free-demo.c36
-rw-r--r--openpgp-ffi/examples/writer-cookie.c31
-rw-r--r--openpgp-ffi/include/sequoia/io.h154
-rw-r--r--openpgp-ffi/include/sequoia/openpgp.h2125
-rw-r--r--openpgp-ffi/include/sequoia/openpgp/crypto.h106
-rw-r--r--openpgp-ffi/include/sequoia/openpgp/error.h179
-rw-r--r--openpgp-ffi/include/sequoia/openpgp/packet.h76
-rw-r--r--openpgp-ffi/include/sequoia/openpgp/serialize.h48
-rw-r--r--openpgp-ffi/include/sequoia/openpgp/types.h568
-rw-r--r--openpgp-ffi/sequoia-openpgp.pc.in11
-rw-r--r--openpgp-ffi/src/amalgamation.rs107
-rw-r--r--openpgp-ffi/src/armor.rs416
-rw-r--r--openpgp-ffi/src/cert.rs1083
-rw-r--r--openpgp-ffi/src/common.rs347
-rw-r--r--openpgp-ffi/src/crypto.rs101
-rw-r--r--openpgp-ffi/src/error.rs282
-rw-r--r--openpgp-ffi/src/fingerprint.rs103
-rw-r--r--openpgp-ffi/src/io.rs529
-rw-r--r--openpgp-ffi/src/key_amalgamation.rs200
-rw-r--r--openpgp-ffi/src/keyid.rs91
-rw-r--r--openpgp-ffi/src/lib.rs319
-rw-r--r--openpgp-ffi/src/packet/key.rs179
-rw-r--r--openpgp-ffi/src/packet/literal.rs58
-rw-r--r--openpgp-ffi/src/packet/mod.rs139
-rw-r--r--openpgp-ffi/src/packet/pkesk.rs74
-rw-r--r--openpgp-ffi/src/packet/signature.rs267
-rw-r--r--openpgp-ffi/src/packet/skesk.rs54
-rw-r--r--openpgp-ffi/src/packet/user_attribute.rs29
-rw-r--r--openpgp-ffi/src/packet/userid.rs353
-rw-r--r--openpgp-ffi/src/packet_pile.rs17
-rw-r--r--openpgp-ffi/src/parse/mod.rs420
-rw-r--r--openpgp-ffi/src/parse/stream.rs1106
-rw-r--r--openpgp-ffi/src/policy.rs51
-rw-r--r--openpgp-ffi/src/revocation_status.rs30
-rw-r--r--openpgp-ffi/src/serialize.rs402
-rw-r--r--openpgp-ffi/src/tsk.rs20
-rw-r--r--openpgp-ffi/tests/c-tests.rs322
97 files changed, 5 insertions, 15547 deletions
diff --git a/.Makefile b/.Makefile
index 7e8eb636..0377017b 100644
--- a/.Makefile
+++ b/.Makefile
@@ -59,8 +59,6 @@ all: build examples
.PHONY: build
build:
CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) $(CARGO) build $(CARGO_FLAGS) $(CARGO_PACKAGES)
- $(MAKE) -Copenpgp-ffi build
- $(MAKE) -Cffi build
# Testing and examples.
#
@@ -79,8 +77,6 @@ test check:
then \
echo 'WARNING: Not running other tests, because $$CARGO_PACKAGES specifies a package.'; \
else \
- $(MAKE) -Copenpgp-ffi test && \
- $(MAKE) -Cffi test && \
$(MAKE) --file=.Makefile examples; \
fi
@@ -88,8 +84,6 @@ test check:
examples:
CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
$(CARGO) build $(CARGO_FLAGS) --examples
- $(MAKE) -Copenpgp-ffi examples
- $(MAKE) -Cffi examples
# Documentation.
.PHONY: doc
@@ -103,16 +97,12 @@ doc:
# Installation.
.PHONY: build-release
build-release:
- $(MAKE) -Copenpgp-ffi build-release
- $(MAKE) -Cffi build-release
$(MAKE) -Csq build-release
# "install" needs "build-release" as it builds the project
# with optimizations enabled.
.PHONY: install
install: build-release
- $(MAKE) -Copenpgp-ffi install
- $(MAKE) -Cffi install
$(MAKE) -Csq install
# Infrastructure for creating source distributions.
@@ -155,8 +145,6 @@ dist-test dist-check: $(CARGO_TARGET_DIR)/dist/sequoia-$(VERSION).tar.pgp.gz
.PHONY: clean
clean:
CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) $(CARGO) $(CARGO_FLAGS) clean
- $(MAKE) -Copenpgp-ffi clean
- $(MAKE) -Cffi clean
.PHONY: codespell
codespell:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 323e7f69..84a2b642 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -308,7 +308,7 @@ windows-gnu:
- rustc --version --verbose
- cargo --version
script:
- - cargo test --worksp