GithubHelp home page GithubHelp logo

gpgme's People

Contributors

alexanderkjall avatar awidegreen avatar byron avatar crawford avatar derekdreery avatar johnschug avatar maennchen avatar timvisee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gpgme's Issues

Key selection or encrypt with all subkeys

I'm not sure if this is an issue for here or the upstream gpgme folks.

I'm looking for a way to force selection of a specific subkey for encryption, or to encrypt using all encryption subkeys (each subkey would be a recipient of the message).

I know GPG automatically select the most recent subkey for encryption, and the ! suffix is used - on the command line - to select a particular subkey. I cannot find the equivalent for gpgme.

Is there any way to do that?

provide a changelog?

Thanks for the recent updates to libgpg-error and gpgme. I note that the versions incremented in a semver-incompatible way (from 0.10.x to 0.11), which means every downstream project that depends on them will itself need to adjust its dependencies and confirm that it works with whatever API changes are supplied.

It would be useful to downstream projects if there were a changelog that made clear what adjustments they need to make when moving across a semver-incompatible version.

Exporting secret keys

The following code fails to export secret keys. The result is an empty file. Public keys however seems to be exported correctly.
I ran it using the master branch.

use gpgme::{
    Context, CreateKeyFlags as Flags, ExportMode, PassphraseRequest, PinentryMode, Protocol,
};
use std::{fs::File, io::Write, iter, path::PathBuf, time::Duration};

fn main() {
    let validity = Duration::from_secs(3600);

    let mut ctx = Context::from_protocol(Protocol::OpenPgp).unwrap();
    ctx.set_offline(true);
    ctx.set_armor(true);
    ctx.set_pinentry_mode(PinentryMode::Loopback).unwrap();
    ctx.set_engine_home_dir("/tmp").unwrap();

    let mut ctx = ctx.set_passphrase_provider(|_: PassphraseRequest, out: &mut dyn Write| {
        out.write_all("password".as_bytes())?;
        Ok(())
    });

    let res = ctx
        .create_key_with_flags("john doe <[email protected]>", "ed25519", validity, Flags::CERT)
        .unwrap();

    let fpr = res.fingerprint().unwrap();
    let key = ctx.get_key(fpr).unwrap();

    ctx.create_subkey_with_flags(&key, "ed25519", validity, Flags::AUTH)
        .unwrap();
    ctx.create_subkey_with_flags(&key, "cv25519", validity, Flags::ENCR)
        .unwrap();
    ctx.create_subkey_with_flags(&key, "ed25519", validity, Flags::SIGN)
        .unwrap();

    let mut path = PathBuf::from("/tmp");

    path.push(format!("{}.pub.asc", fpr));
    let file = File::create(&path).unwrap();
    ctx.export(iter::once(fpr), ExportMode::empty(), &file)
        .unwrap();

    path.pop();
    path.push(format!("{}.sec.asc", fpr));
    let file = File::create(&path).unwrap();
    ctx.export(iter::once(fpr), ExportMode::SECRET, &file)
        .unwrap();
}

Clone Context

Hi @johnschug,

Thank you very much for this great lib!

I'm currently implementing an Elixir NIF (using rustler).
To share the context to Elixir, I implemented a ResourceArc<ContextNifResource>.

To have immutability in elixir, I want to create a copy of the Context for every function that modifies it. (For example set_armor)

So that this works, I need the possibility to clone the Context.

I tried to do that myself using this code:

new_context = unsafe{Context::from_raw(Context::as_raw(old_context))}

I got those two errors though (not at the same time; randomly):

1:
Assertion failed: (!"lock ABI version"), function get_lock_object, file posix-lock.c, line 132.

2:
keybeam.smp(38723,0xb0599000) malloc: *** error for object 0x7fb36b4036c0: pointer being freed was not allocated

Exporting secret subkeys only

I cannot find a way to only export secret subkeys without the main secret key.
With the GPG CLI there is the --export-secret-subkeys option.
What is the equivalent in GPGME?

Decryption Failed

kleo-log.log
kleo-log.log
kleopatraerrorsnapshot

I have installed gpg4win 3.1.0 version. I installed it on a Windows 2008 R2 and Windows 2012 server. I am trying to decrypt the file using Kleopatra and getting attached error. I have also attached the logs.

Basincally we have an interface, where in we download a file from a Vendor's ftp site, decrypt the file and then process it. To do this I am using an ETL tool called Pentaho. To decrypt the file from with in pentaho I am using gpg4win.

I did following on a Windows 2012 VM server:
After my initial installation I run the job from with PDI and everything works fine.
After that I kicked off the Pentaho job using a batch file and it worked fine.
After that I scheduled the batch file in Windows scheduler and it worked fine.
When I kicked off windows scheduler second time it results in error.

Now forget about Pentaho, even if I try to decrypt file directly using Kleopatra (on windows 2012 server) I get attached error. I have attached screenshot of Kleppatra error. When I try to decrypt same file which resides on the server from my local Windows 10 it works fine.

When I decrypt using Kleopatra on server it does not even ask for pass phrase and results in error, where as from my local it asks for pass phrase and completes successfully.

Any help on the matter is highly appreciated.

Thanks,
Saket

Experience note: My (sudo: false) Travis build fails

My simple sudo: false Travis build fails inside gpgme-sys. I haven't diagnosed it but thought I'd make a note here, in case anyone else has the solution.

e.g. build: https://travis-ci.org/FauxFaux/fapt/jobs/331235428
travis.yml at that build: https://github.com/FauxFaux/fapt/blob/a58706d16515234224e37d1913eaceefb1b5d621/.travis.yml

My guess as to the problem is that the build of embedded gpgme is failing for some unknown reason (perhaps a submodule fetch failed?), and the exterior one is too old according to some check, even though 1.2 looks to be supported. (1.4.3 > 1.2)?

I realise the library itself builds fine on Travis normally.

Log excerpts:

Reading state information...
libgpg-error-dev is already the newest version (1.12-0.2ubuntu1).
Selecting previously unselected package libgpgme11-dev.
Preparing to unpack .../libgpgme11-dev_1.4.3-0.1ubuntu5.1_amd64.deb ...
Running `/home/travis/build/FauxFaux/fapt/target/debug/build/gpgme-sys-956dcc06fe93269b/build-script-build`
error: failed to run custom build command for `gpgme-sys v0.6.1`
process didn't exit successfully: `/home/travis/build/FauxFaux/fapt/target/debug/build/gpgme-sys-956dcc06fe93269b/build-script-build` (exit code: 101)
--- stdout
running: "git" "apply" "../libassuan-remove-doc.patch"
command did not execute successfully: "git" "apply" "../libassuan-remove-doc.patch"
expected success, got: exit code: 1
running: "git" "apply" "../gpgme-remove-doc.patch"
command did not execute successfully: "git" "apply" "../gpgme-remove-doc.patch"
expected success, got: exit code: 1

...

checking for x86_64-unknown-linux-gnu-gpg-error-config... /usr/bin/gpg-error-config
checking for GPG Error - version >= 1.17... no
command did not execute successfully: "sh" "/home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/gpgme-sys-0.6.1/libassuan/configure" "--build" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--enable-static" "--disable-shared" "--with-libgpg-error-prefix=/usr" "--prefix=/home/travis/build/FauxFaux/fapt/target/debug/build/gpgme-sys-c80c4dc982428462/out"
expected success, got: exit code: 1
running: "sh" "-c" "gpgme-config --version"
--- stderr
error: patch failed: Makefile.am:28
error: Makefile.am: patch does not apply
error: patch failed: configure.ac:459
error: configure.ac: patch does not apply
error: patch failed: Makefile.am:33
error: Makefile.am: patch does not apply
error: patch failed: configure.ac:862
error: configure.ac: patch does not apply
autogen.sh: Running aclocal -I m4 ...
autogen.sh: Running autoheader...
autogen.sh: Running automake --gnu ...
autogen.sh: Running autoconf ...
autogen.sh: You may now run:
  ./configure --enable-maintainer-mode && make
configure: error: libgpg-error was not found

Any suggestions appreciated, but I don't expect anyone to fix this for me.

`trust_value` should return the original value as is

gpgme/src/keys.rs

Lines 908 to 917 in feff0a1

pub fn trust_value(&self) -> SignatureTrust {
let value = unsafe { (*self.as_raw()).trust_value() };
if !self.is_trust_signature() {
SignatureTrust::None
} else if value >= 120 {
SignatureTrust::Complete
} else {
SignatureTrust::Partial
}
}

As a binding of gpgme, gpg-rs should respect the original return value of gpgme as is, instead of changing it. To judge whether the signature is trustable should be left to user program.

Context::pinentry_mode should take `&self` not `self`

The current signature of pinentry_mode is this:

fn pinentry_mode(self) -> PinentryMode

I feel like it should be this:

fn pinentry_mode(&self) -> PinentryMode

It seems overkill to have a method that seems to be nothing more than a getter take ownership of self.

Segmentation fault on x86_64-unknown-linux-musl

Creating a context segfaults when compiled on this target. I made a minimal repro to make sure it wasn't something else. Commenting the first line of main results in a binary that prints "Made it.", so the setup is sufficient to produce working binaries.

code/src/main.rs

use gpgme::{Context, Protocol};

pub fn main() {
  let _ = Context::from_protocol(Protocol::OpenPgp)
    .expect("Context::from_protocol() returned error");
  print!("Made it.")
}

code/Cargo.toml

[package]
name = "repro"
version = "0.1.0"
edition = "2021"

[dependencies]
gpgme = { version = "0.10" }

Containerfile

FROM docker.io/rust:alpine

RUN apk add --no-cache musl-dev gpgme-dev

ADD code /usr/local/src
WORKDIR /usr/local/src
RUN cargo build

Console log:

$ podman build . --tag=repro && podman run --rm -it repro
STEP 1/5: FROM docker.io/rust:alpine
Trying to pull docker.io/library/rust:alpine...
Getting image source signatures
Copying blob 97518928ae5f done  
Copying blob a95f12a5672f done  
Copying blob 8087f14819d9 done  
Copying config 9a5be7281d done  
Writing manifest to image destination
Storing signatures
STEP 2/5: RUN apk add --no-cache musl-dev gpgme-dev
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/173) Installing dbus-libs (1.12.20-r2)
(2/173) Installing libffi (3.3-r2)
(3/173) Installing libintl (0.21-r0)
(4/173) Installing libblkid (2.37.2-r0)
(5/173) Installing libmount (2.37.2-r0)
(6/173) Installing pcre (8.44-r0)
(7/173) Installing glib (2.68.3-r0)
(8/173) Installing icu-libs (67.1-r2)
(9/173) Installing libpcre2-16 (10.36-r0)
(10/173) Installing zstd-libs (1.4.9-r1)
(11/173) Installing qt5-qtbase (5.15.3_git20210406-r0)
(12/173) Installing sqlite-libs (3.35.5-r0)
(13/173) Installing qt5-qtbase-sqlite (5.15.3_git20210406-r0)
(14/173) Installing ncurses-terminfo-base (6.2_p20210612-r0)
(15/173) Installing ncurses-libs (6.2_p20210612-r0)
(16/173) Installing readline (8.1.0-r0)
(17/173) Installing unixodbc (2.3.9-r1)
(18/173) Installing qt5-qtbase-odbc (5.15.3_git20210406-r0)
(19/173) Installing gdbm (1.19-r0)
(20/173) Installing libsasl (2.1.27-r12)
(21/173) Installing libldap (2.4.58-r0)
(22/173) Installing libpq (13.5-r0)
(23/173) Installing qt5-qtbase-postgresql (5.15.3_git20210406-r0)
(24/173) Installing mariadb-connector-c (3.1.13-r0)
(25/173) Installing qt5-qtbase-mysql (5.15.3_git20210406-r0)
(26/173) Installing freetds (1.2.21-r0)
(27/173) Installing qt5-qtbase-tds (5.15.3_git20210406-r0)
(28/173) Installing hicolor-icon-theme (0.17-r1)
(29/173) Installing mesa (21.1.2-r0)
(30/173) Installing libxau (1.0.9-r0)
(31/173) Installing libmd (1.0.3-r0)
(32/173) Installing libbsd (0.11.3-r0)
(33/173) Installing libxdmcp (1.1.3-r0)
(34/173) Installing libxcb (1.14-r2)
(35/173) Installing libx11 (1.7.2-r0)
(36/173) Installing libpciaccess (0.16-r0)
(37/173) Installing libdrm (2.4.106-r0)
(38/173) Installing expat (2.4.1-r0)
(39/173) Installing wayland-libs-server (1.19.0-r0)
(40/173) Installing mesa-gbm (21.1.2-r0)
(41/173) Installing mesa-glapi (21.1.2-r0)
(42/173) Installing wayland-libs-client (1.19.0-r0)
(43/173) Installing libxext (1.3.4-r0)
(44/173) Installing libxfixes (6.0.0-r0)
(45/173) Installing libxxf86vm (1.1.4-r2)
(46/173) Installing libxshmfence (1.3-r1)
(47/173) Installing mesa-gl (21.1.2-r0)
(48/173) Installing qt5-qtdeclarative (5.15.3_git20210531-r0)
(49/173) Installing libxcomposite (0.4.5-r0)
(50/173) Installing brotli-libs (1.0.9-r5)
(51/173) Installing libbz2 (1.0.8-r1)
(52/173) Installing libpng (1.6.37-r1)
(53/173) Installing freetype (2.10.4-r1)
(54/173) Installing libuuid (2.37.2-r0)
(55/173) Installing fontconfig (2.13.1-r4)
(56/173) Installing wayland-libs-cursor (1.19.0-r0)
(57/173) Installing wayland-libs-egl (1.19.0-r0)
(58/173) Installing pkgconf (1.7.4-r0)
(59/173) Installing xkeyboard-config (2.33-r0)
(60/173) Installing xz-libs (5.2.5-r0)
(61/173) Installing libxml2 (2.9.12-r1)
(62/173) Installing libxkbcommon (1.2.1-r0)
(63/173) Installing qt5-qtwayland (5.15.3_git20210510-r0)
(64/173) Installing mesa-egl (21.1.2-r0)
(65/173) Installing libice (1.0.10-r0)
(66/173) Installing libsm (1.2.3-r0)
(67/173) Installing avahi-libs (0.8-r5)
(68/173) Installing nettle (3.7.3-r0)
(69/173) Installing p11-kit (0.23.22-r0)
(70/173) Installing libtasn1 (4.17.0-r0)
(71/173) Installing libunistring (0.9.10-r1)
(72/173) Installing gnutls (3.7.1-r0)
(73/173) Installing cups-libs (2.3.3-r2)
(74/173) Installing graphite2 (1.3.14-r0)
(75/173) Installing harfbuzz (2.8.1-r0)
(76/173) Installing libevdev (1.11.0-r1)
(77/173) Installing mtdev (1.1.6-r0)
(78/173) Installing eudev-libs (3.2.10-r0)
(79/173) Installing libinput-libs (1.18.0-r0)
(80/173) Installing libjpeg-turbo (2.1.0-r0)
(81/173) Installing xcb-util-wm (0.4.1-r1)
(82/173) Installing xcb-util (0.4.0-r3)
(83/173) Installing xcb-util-image (0.4.0-r1)
(84/173) Installing xcb-util-keysyms (0.4.0-r1)
(85/173) Installing xcb-util-renderutil (0.3.9-r1)
(86/173) Installing libxkbcommon-x11 (1.2.1-r0)
(87/173) Installing qt5-qtbase-x11 (5.15.3_git20210406-r0)
(88/173) Installing qt5-qtbase-dbg (5.15.3_git20210406-r0)
(89/173) Installing blkid (2.37.2-r0)
(90/173) Installing libcap-ng (0.8.2-r0)
(91/173) Installing setpriv (2.37.2-r0)
(92/173) Installing libsmartcols (2.37.2-r0)
(93/173) Installing findmnt (2.37.2-r0)
(94/173) Installing mcookie (2.37.2-r0)
(95/173) Installing hexdump (2.37.2-r0)
(96/173) Installing lsblk (2.37.2-r0)
(97/173) Installing libfdisk (2.37.2-r0)
(98/173) Installing sfdisk (2.37.2-r0)
(99/173) Installing cfdisk (2.37.2-r0)
(100/173) Installing partx (2.37.2-r0)
(101/173) Installing flock (2.37.2-r0)
(102/173) Installing logger (2.37.2-r0)
(103/173) Installing uuidgen (2.37.2-r0)
(104/173) Installing libeconf (0.3.8-r1)
(105/173) Installing util-linux (2.37.2-r0)
(106/173) Installing util-linux-dev (2.37.2-r0)
(107/173) Installing dbus-dev (1.12.20-r2)
(108/173) Installing expat-dev (2.4.1-r0)
(109/173) Installing brotli-dev (1.0.9-r5)
(110/173) Installing zlib-dev (1.2.11-r3)
(111/173) Installing libpng-dev (1.6.37-r1)
(112/173) Installing freetype-dev (2.10.4-r1)
(113/173) Installing fontconfig-dev (2.13.1-r4)
(114/173) Installing mpdecimal (2.5.1-r1)
(115/173) Installing python3 (3.9.5-r1)
(116/173) Installing gettext-asprintf (0.21-r0)
(117/173) Installing gettext-libs (0.21-r0)
(118/173) Installing gettext (0.21-r0)
(119/173) Installing gettext-dev (0.21-r0)
(120/173) Installing bzip2-dev (1.0.8-r1)
(121/173) Installing libxml2-utils (2.9.12-r1)
(122/173) Installing libgpg-error (1.42-r0)
(123/173) Installing libgcrypt (1.9.4-r0)
(124/173) Installing libxslt (1.1.34-r1)
(125/173) Installing docbook-xml (4.5-r6)
Executing docbook-xml-4.5-r6.post-install
(126/173) Installing docbook-xsl (1.79.2-r2)
Executing docbook-xsl-1.79.2-r2.post-install
(127/173) Installing linux-headers (5.10.41-r0)
(128/173) Installing libffi-dev (3.3-r2)
(129/173) Installing libpcre16 (8.44-r0)
(130/173) Installing libpcre32 (8.44-r0)
(131/173) Installing libpcrecpp (8.44-r0)
(132/173) Installing pcre-dev (8.44-r0)
(133/173) Installing glib-dev (2.68.3-r0)
(134/173) Installing xorgproto (2021.4-r0)
(135/173) Installing libice-dev (1.0.10-r0)
(136/173) Installing libsm-dev (1.2.3-r0)
(137/173) Installing libxau-dev (1.0.9-r0)
(138/173) Installing xcb-proto (1.14.1-r2)
(139/173) Installing libxdmcp-dev (1.1.3-r0)
(140/173) Installing libxcb-dev (1.14-r2)
(141/173) Installing xtrans (1.4.0-r1)
(142/173) Installing libx11-dev (1.7.2-r0)
(143/173) Installing libxext-dev (1.3.4-r0)
(144/173) Installing libpciaccess-dev (0.16-r0)
(145/173) Installing libdrm-dev (2.4.106-r0)
(146/173) Installing libxdamage (1.1.5-r1)
(147/173) Installing libxfixes-dev (6.0.0-r0)
(148/173) Installing libxdamage-dev (1.1.5-r1)
(149/173) Installing libxshmfence-dev (1.3-r1)
(150/173) Installing mesa-gles (21.1.2-r0)
(151/173) Installing llvm11-libs (11.1.0-r2)
(152/173) Installing mesa-osmesa (21.1.2-r0)
(153/173) Installing mesa-xatracker (21.1.2-r0)
(154/173) Installing libxxf86vm-dev (1.1.4-r2)
(155/173) Installing mesa-dev (21.1.2-r0)
(156/173) Installing openssl-dev (1.1.1l-r0)
(157/173) Installing perl (5.32.1-r0)
(158/173) Installing sqlite-dev (3.35.5-r0)
(159/173) Installing qt5-qtbase-dev (5.15.3_git20210406-r0)
(160/173) Installing libassuan (2.5.5-r0)
(161/173) Installing libcap (2.50-r0)
(162/173) Installing libsecret (0.20.4-r1)
(163/173) Installing pinentry (1.1.1-r0)
Executing pinentry-1.1.1-r0.post-install
(164/173) Installing libksba (1.5.1-r0)
(165/173) Installing npth (1.6-r0)
(166/173) Installing gnupg (2.2.31-r0)
(167/173) Installing gpgme (1.15.1-r2)
(168/173) Installing gpgmepp (1.15.1-r2)
(169/173) Installing libgpg-error-dev (1.42-r0)
(170/173) Installing libassuan-dev (2.5.5-r0)
(171/173) Installing qgpgme (1.15.1-r2)
(172/173) Installing gpgme-dev (1.15.1-r2)
(173/173) Installing musl-dev (1.2.2-r3)
Executing busybox-1.33.1-r6.trigger
Executing glib-2.68.3-r0.trigger
No schema files found: doing nothing.
OK: 678 MiB in 199 packages
--> 53f3ffe4843
STEP 3/5: ADD code /usr/local/src
--> ae2c01cc392
STEP 4/5: WORKDIR /usr/local/src
--> 1cd2da187ee
STEP 5/5: RUN cargo build
    Updating crates.io index
 Downloading crates ...
  Downloaded conv v0.3.3
  Downloaded custom_derive v0.1.7
  Downloaded gpg-error v0.5.2
  Downloaded gpgme v0.10.0
  Downloaded cfg-if v1.0.0
  Downloaded bitflags v1.3.2
  Downloaded libgpg-error-sys v0.5.2
  Downloaded gpgme-sys v0.10.0
  Downloaded smallvec v1.7.0
  Downloaded static_assertions v1.1.0
  Downloaded memchr v2.4.1
  Downloaded once_cell v1.8.0
  Downloaded cstr-argument v0.1.2
  Downloaded libc v0.2.108
   Compiling libgpg-error-sys v0.5.2
   Compiling libc v0.2.108
   Compiling memchr v2.4.1
   Compiling gpg-error v0.5.2
   Compiling gpgme-sys v0.10.0
   Compiling cfg-if v1.0.0
   Compiling custom_derive v0.1.7
   Compiling once_cell v1.8.0
   Compiling bitflags v1.3.2
   Compiling static_assertions v1.1.0
   Compiling smallvec v1.7.0
   Compiling conv v0.3.3
   Compiling cstr-argument v0.1.2
   Compiling gpgme v0.10.0
   Compiling repro v0.1.0 (/usr/local/src)
    Finished dev [unoptimized + debuginfo] target(s) in 42.54s
COMMIT repro
--> 810199c328b
Successfully tagged localhost/repro:latest
810199c328b67593723180052720dfb5e458be9bb0b98985944e391986d757f9
/usr/local/src # target/debug/repro
Segmentation fault

Public key generation

Hello,
I'm trying to split a public PGP key with n identities into n public PGP keys with one identity each.
It should be noted that all public PGP keys should share a common private key.
I tried "create_key_with_flags" with the flag WANTPUB but I'm getting a new pair of keys for each user. Is there another way to achieve my goal ?

No need for a `Key` when doing `interact_with_card`

Hi! Thanks for this wrapper around gpgme. I just started using it and try to get used to it. I need to create a program that automatically configures YubiKeys. This can be done with gpg --edit-card and by extension then also gpgme_op_interact (the C function) and of course interact_with_card from this Rust library. The problem is that the latter requires a &Key to be passed in.

I can configure a smartcard without having any keys in my GnuPG keystore with gpg --edit-key. But the Rust wrapper interact_with_card requires a key. So the only way to currently do what I need is to create some mock key, just to get a handle to pass in.

I kind of get why it's implemented like this. Because the C documentation for gpgme_op_interact states that a valid key pointer must be provided. However, I did look at the source code. And nowhere is it using that key argument if the flag GPGME_INTERACT_CARD is provided.

Ultimately I should report this upstream to the gpgme mailing list or similar, and ask for advice there. How to use the C library to edit smartcards without needing a key. Hopefully they find it OK to use a null pointer for the key argument when interacting with cards. Just that they didn't properly document it. But I was too lazy to do that now. So I thought I'd start the journey by reporting this inconvenience here.

For now I think I'll just write my own interact_with_card wrapper around gpgme-sys that just uses a null pointer for key, given that I know it's safe (with the current versions of gpgme)

Latest stable release comes with broken rustc: invalid ELF header

How to reproduce

docker run  clux/muslrust:stable rustc

Workaround

Use the previous version.

docker run  clux/muslrust:stable-2018-01-01 rustc --version
rustc 1.23.0 (766bd11c8 2018-01-01)

Impact

I would like to use the latest rustc version to benefit from lower build times thanks to (improved) incremental compilation.
Compilation takes 70s for me within docker, but only ~5s on the host, with the same amount of cores (2) and debug mode.

Meta

docker version
Client:
 Version:       17.12.0-ce
 API version:   1.35
 Go version:    go1.9.2
 Git commit:    c97c6d6
 Built: Wed Dec 27 20:03:51 2017
 OS/Arch:       darwin/amd64

Server:
 Engine:
  Version:      17.12.0-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.2
  Git commit:   c97c6d6
  Built:        Wed Dec 27 20:12:29 2017
  OS/Arch:      linux/amd64
  Experimental: true

Code examples for decrypt gives type error

I tried creating an empty repository with the following code, directly from the example for decrypt

extern crate gpgme;
use std::fs::File;

use gpgme::{Context, Data, Protocol};
fn main(){
    let mut ctx = Context::from_protocol(Protocol::OpenPgp).unwrap();
    let mut cipher = Data::load("some file").unwrap();
    let mut plain = Vec::new();
    let mut input = File::open("some_file").unwrap();
    let mut output = Vec::new();

    ctx.decrypt(&mut input, &mut plain).unwrap();
}

This however gives me a type error:

error[E0308]: mismatched types
  --> main.rs:12:17
   |
12 |     ctx.decrypt(&mut input, &mut plain).unwrap();
   |                 ^^^^^^^^^^ expected struct `gpgme::Data`, found struct `std::fs::File`
   |
   = note: expected type `&mut gpgme::Data<'_>`
              found type `&mut std::fs::File`

error[E0308]: mismatched types
  --> main.rs:12:29
   |
12 |     ctx.decrypt(&mut input, &mut plain).unwrap();
   |                             ^^^^^^^^^^ expected struct `gpgme::Data`, found struct `std::vec::Vec`
   |
   = note: expected type `&mut gpgme::Data<'_>`
              found type `&mut std::vec::Vec<_>`
   = help: here are some functions which might fulfill your needs:
           - .remove(...)
           - .swap_remove(...)

error: aborting due to 2 previous errors

error: Could not compile `gpgtest`.

It works when I instantiate a gpgme::Data variable instead of a Vec. What I find quite strange is that the example in examples/decrypt.rs compiles just fine for me if I run cargo run --example decrypt.

gpgme::encrypt produces "Bad file descriptor" error

If you try to encrypt some data with gpgme::encrypt I always seem to get the following error:

thread 'main' panicked at 'encrypt: Error { source: Some("GPGME"), code: 32779, description: "Bad file descriptor" }', src/libcore/result.rs:906:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Here's a minimal snippet of Rust code which will reproduce this.

extern crate gpgme;

fn main() {
    // Get a gpgme context.
    let mut gpg_context = gpgme::Context::from_protocol(gpgme::Protocol::OpenPgp).expect("new context");
    gpg_context.set_armor(true);
    //gpg_context.set_offline(true);

    // Find the keyids that we are looking for.
    let recipient_key = gpg_context.find_key("[email protected]").expect("finding key");

    // Encrypt some text. in_data is filled from somewhere else.
    let mut in_data = String::from("Hello, world!").into_bytes();
    let (mut plain, mut cipher) = (Vec::new(), Vec::new());

    plain.append(&mut in_data);
    //std::mem::drop(in_data);

    // Encrypt the body.
    gpg_context.encrypt_with_flags(Some(&recipient_key), &mut plain, &mut cipher, gpgme::EncryptFlags::empty()).expect("encrypt");
    println!("ciphertext: {}", String::from_utf8(cipher).unwrap());
}

I've double checked that the equivalent Assam commands operate correctly:

% echo "Hello, world" > in ; gpgme-tool 3<in 4>out
OK GPGME-Tool 1.9.0 ready
ARMOR true
OK
RECIPIENT [email protected]
S RECIPIENT 6FA1B3E3F9A18CDCBE6A2CF54A7BE7BF70DE9B9F
OK
OUTPUT FD=4
OK
INPUT FD=3
OK
ENCRYPT
S PROGRESS -&11 0x3f 0 0
S PROGRESS -&11 0x3f 13 0
OK
% cat out
-----BEGIN PGP MESSAGE-----

hQIMA+hUAzv9on82ARAApJZIinIMeOQAtbhDIQzSe+UqmU68atpQuR1TzZQfSjbl
kVAoHz0BuDxRWVmlJ6180QArXQWynm/3OuJtS96tM6Mt5xsf5AHzr7vlAL+XikJG
YsZEFhaHZLit3cpI2gT3do/OG9nf/Ill+zEoeOVS6KAaR4FNLKBYzEg85oAWW7Ds
lL45jgLShMo8vo6gNF778rXk32ZNgwyeRJvQ1sRZLSVVLmiaAoBbEFKgphJmq+lL
vwuxh7zL1cE3eckcWEqyozQRU7FGi/j4LmEv3vHJIIDgCLylvneUX7hsaQgttFT/
O5Ak959gocmghd3yhjjRV9K55I70F5XFEeC0wNa1ri4oD+l8wQie4IZd6eUazGtH
lanlznnw7Ft9R7+Qi6T10HYm6vONS1dDy38zOP6ESujsKEqDv1AgO/BouBGu5oaL
59kfSgsWnbvTMBgWNmgS9MWA9rOxOET5YsWHjBzki51cgc31KT7Q72XHPtBuIC+p
iPyOM2U1xHO54lvKOAGH9GIpnencH/dOwhcrS0Hie+Jv81+U+a3UGgMk51hdsAWq
GV8KMXWMqlE2auYoSEn2UayTyYiZuJfMe6Sj82WxygWBdMIdGjbWpDbIL7ogzSa3
TJugkhWEpnvZPTAH3kbZUxTCejVv/1hOtY8/4385z+bc/YJ/PNC9lwFHN1VLzLfS
SAF+u4VIgQKDEhkPnRLsh6vsHfBQlhCvWFmkIuoNM962YW2c80jCJlYo82sYh9Wr
ztXfpn/3nZvpbPjUAWOxaWBYhF+BbNVQbg==
=VVre
-----END PGP MESSAGE-----

And here is the gpgme-error information about the error code:

% gpg-error 32779
32779 = (0, 32779) = (GPG_ERR_SOURCE_UNKNOWN, GPG_ERR_EBADF) = (Unspecified source, Bad file descriptor)

Misleading example code in `context.rs`?

The doc comment for find_key says:

/// Returns the public key with the specified fingerprint, if such a key can
/// be found. Otherwise, an error is returned.

The there are a couple of places which suggest that find_key accepts a pattern, not a finger print, e.g.:

https://github.com/johnschug/rust-gpgme/blob/fd15950293fdd6d3a28a0098bb40c78409ded642/src/context.rs#L1166-L1177

https://github.com/johnschug/rust-gpgme/blob/fd15950293fdd6d3a28a0098bb40c78409ded642/src/context.rs#L1237-L1248

So does find_key take a fingerprint or a pattern?

Thanks

Windows Support

There is now preliminary support for building on windows with some limitations. The build script will automatically detect an installed version of Gpg4win/GnuPG via the registry and attempt to use the provided libraries. However, the Gpg4win project only provides 32-bit versions of those libraries, requiring any rust project that wishes to use them to use the i686-pc-windows-gnu target. There is a windows dockerfile demonstrating the necessary setup.

It should also be possible to use alternative builds of the libraries (e.g., msys maybe) by setting the appropriate environment variables as specified in the README. However static linking with the upstream gpgme library is not supported as it needs to be built and installed alongside the gpg executable.

NOTE: For whatever reason, the gnupg installer does not seem to work correctly on github's CI runners, either it hangs or it silently doesn't install anything.

NOTE 2: When running the test suite on windows the tests may crash with a STATUS_ACCESS_VIOLATION (probably a bug in gpgme). Setting the GPGME_DEBUG environment variable (e.g., $env:GPGME_DEBUG=9 in powershell) before running the tests seems to prevent this.

Support for x86_64-unknown-linux-musl

I'd like to use gpgme in a statically compiled binary with musl.

Sadly, the following compiles but fails with a segfault at runtime when trying to obtain a Context.

export PKG_CONFIG_ALL_STATIC=1
export PKG_CONFIG_ALLOW_CROSS=1
export GPGME_STATIC=1
export LIBGPG_ERROR_STATIC=1

cargo build --target x86_64-unknown-linux-musl --release

Is static compilation with musl supported at all? I couldn't really figure that out based on the README. How would I fix this issue?

Failed to build test cases

Running: "cargo run --example keylist --" on master branch returns:

error: failed to run custom build command for libgpg-error-sys v0.2.3``

process didn't exit successfully: C:...\rust-gpgme-master\target\debug\build\libgpg-error-sys-d4e48e575169ab8b\build-script-build (exit code: 1)

both in Linux Mint (Ubuntu like) and Windows 10. Are there any other dependencies? What am I doing wrong?

My goal is to use a key pair to encrypt/decrypt a string (i.e. a hash value from sha512). However it is not clear to me how to achieve that from the given sample codes.

Error on decrypt.

Hi,

I'm pretty sure it's not rust-gpgme issue, but I'll ask anyway.

On ctx.decrypt(...).unwrap() I'm getting

thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { err: 117440664 }', ../src/libcore/result.rs:688

With:

$ gpg-error 117440664
117440664 = (7, 152) = (GPG_ERR_SOURCE_GPGME, GPG_ERR_DECRYPT_FAILED) = (GPGME, Decryption failed)

Decrypting the same file manually with gpg -e <file> seem to work fine.

I tried using with_passphrase_handler, but it's not being called.

The only informative reference about error 117440664 I've found: https://lists.gnupg.org/pipermail/gnupg-devel/2005-June/022154.html

statically linking gpgme

As far as i can see there is no way to make gpgme link statically. Is there any reason this is not supported? Could the gpgme-sys be changed to use the common static variable linking format PROJNAME_{STATIC, LIB_DIR, INCLUDE_DIR}

Release a new version

Hey,

I'm heavily depending on this library for my gpg-tui project. But the latest version of gpgme crate is 0.9.2 which is pretty old if you consider the changes made after that. (Those changes include updating the library for GPGME 1.14, 1.15 and 1.16)

So can you please release a new version for crates.io soon?

ld error on macOS when running example

When I run cargo run -vv --example keylist -- on macOS High Sierra I just end up getting a link error:

       Fresh cfg-if v0.1.2
       Fresh libc v0.2.33
       Fresh bitflags v0.9.1
       Fresh getopts v0.2.15
       Fresh gcc v0.3.54
       Fresh lazy_static v0.2.9
       Fresh custom_derive v0.1.7
       Fresh rand v0.3.17
       Fresh conv v0.3.3
       Fresh tempdir v0.3.5
       Fresh libgpg-error-sys v0.2.3
       Fresh gpg-error v0.2.2
       Fresh gpgme-sys v0.6.1 (file:///Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/gpgme-sys)
   Compiling gpgme v0.6.1 (file:///Users/bro/Documents/Lisberg/host-secrets/rust-gpgme)
     Running `rustc --crate-name keylist examples/keylist.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="gpgme-sys"' --cfg 'feature="v1_3_0"' --cfg 'feature="v1_3_1"' --cfg 'feature="v1_4_0"' --cfg 'feature="v1_4_2"' --cfg 'feature="v1_4_3"' --cfg 'feature="v1_5_0"' --cfg 'feature="v1_5_1"' --cfg 'feature="v1_6_0"' --cfg 'feature="v1_7_0"' --cfg 'feature="v1_7_1"' --cfg 'feature="v1_8_0"' --cfg 'feature="v1_9_0"' -C metadata=7bb811b06a99be38 -C extra-filename=-7bb811b06a99be38 --out-dir /Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/examples -L dependency=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps --extern tempdir=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libtempdir-41f9ef7ced3d7ab3.rlib --extern getopts=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgetopts-b22bfbb9fcaac879.rlib --extern conv=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libconv-465d507795a5a13b.rlib --extern bitflags=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libbitflags-f74dcc09093f3825.rlib --extern gpg_error=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgpg_error-745d5a05db922b49.rlib --extern gpgme_sys=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgpgme_sys-f5e8f70d23114d6e.rlib --extern lazy_static=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/liblazy_static-a09627d31e820603.rlib --extern libc=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/liblibc-37bfd0d05eb7f2fd.rlib --extern cfg_if=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libcfg_if-76f9e060a7696f63.rlib --extern gpgme=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgpgme-d478aeac1ca31717.rlib -L native=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/build/libgpg-error-sys-ff02a55722eb8617/out/lib -L native=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/build/gpgme-sys-1fbce602af7b2732/out/lib`
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/examples/keylist-7bb811b06a99be38.0.o" "-o" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/examples/keylist-7bb811b06a99be38" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/examples/keylist-7bb811b06a99be38.crate.allocator.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps" "-L" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/build/libgpg-error-sys-ff02a55722eb8617/out/lib" "-L" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/build/gpgme-sys-1fbce602af7b2732/out/lib" "-L" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgetopts-b22bfbb9fcaac879.rlib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgpgme-d478aeac1ca31717.rlib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/liblazy_static-a09627d31e820603.rlib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgpgme_sys-f5e8f70d23114d6e.rlib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libcfg_if-76f9e060a7696f63.rlib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libconv-465d507795a5a13b.rlib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/liblibc-37bfd0d05eb7f2fd.rlib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgpg_error-745d5a05db922b49.rlib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libbitflags-f74dcc09093f3825.rlib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libcustom_derive-ca5481277da64a56.rlib" "/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/liblibgpg_error_sys-1e5d12927a0d5d3a.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-85bc071b5d81d134.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-e87b7be0b9af1e69.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-a9bf608d57cb3ab8.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-bfed0c7224ca9ee7.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_system-f4db5bf69a27b115.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-27755265f6d9b001.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-ee22503fe7599f41.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-01cef03bcbdc80f2.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librand-5109c06c40edb5dc.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-6067a72a06865dba.rlib" "/Users/bro/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-14b1ff6b197b2c39.rlib" "-l" "System" "-l" "resolv" "-l" "pthread" "-l" "c" "-l" "m"
  = note: Undefined symbols for architecture x86_64:
            "_libintl_dgettext", referenced from:
                __gpg_strerror in liblibgpg_error_sys-1e5d12927a0d5d3a.rlib(libgpg_error_la-strerror.o)
                __gpg_strerror_r in liblibgpg_error_sys-1e5d12927a0d5d3a.rlib(libgpg_error_la-strerror.o)
                __gpg_strsource in liblibgpg_error_sys-1e5d12927a0d5d3a.rlib(libgpg_error_la-strsource.o)
            "_libintl_bindtextdomain", referenced from:
                _real_init in liblibgpg_error_sys-1e5d12927a0d5d3a.rlib(libgpg_error_la-init.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: aborting due to previous error

error: Could not compile `gpgme`.

Caused by:
  process didn't exit successfully: `rustc --crate-name keylist examples/keylist.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 --cfg feature="default" --cfg feature="gpgme-sys" --cfg feature="v1_3_0" --cfg feature="v1_3_1" --cfg feature="v1_4_0" --cfg feature="v1_4_2" --cfg feature="v1_4_3" --cfg feature="v1_5_0" --cfg feature="v1_5_1" --cfg feature="v1_6_0" --cfg feature="v1_7_0" --cfg feature="v1_7_1" --cfg feature="v1_8_0" --cfg feature="v1_9_0" -C metadata=7bb811b06a99be38 -C extra-filename=-7bb811b06a99be38 --out-dir /Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/examples -L dependency=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps --extern tempdir=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libtempdir-41f9ef7ced3d7ab3.rlib --extern getopts=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgetopts-b22bfbb9fcaac879.rlib --extern conv=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libconv-465d507795a5a13b.rlib --extern bitflags=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libbitflags-f74dcc09093f3825.rlib --extern gpg_error=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgpg_error-745d5a05db922b49.rlib --extern gpgme_sys=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgpgme_sys-f5e8f70d23114d6e.rlib --extern lazy_static=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/liblazy_static-a09627d31e820603.rlib --extern libc=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/liblibc-37bfd0d05eb7f2fd.rlib --extern cfg_if=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libcfg_if-76f9e060a7696f63.rlib --extern gpgme=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/deps/libgpgme-d478aeac1ca31717.rlib -L native=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/build/libgpg-error-sys-ff02a55722eb8617/out/lib -L native=/Users/bro/Documents/Lisberg/host-secrets/rust-gpgme/target/debug/build/gpgme-sys-1fbce602af7b2732/out/lib` (exit code: 101)

Linking issue when using in a dylib crate

Using gpgme (or any crate depending on it) in a dylib crate produces a ton of linker error that makes the build fail. They are all of the type multiple definition of [...] first defined here.

You can find the build output in this gist.

The source project is the most simple I could create, latest stable gpgme as a dependency and use statement.

It looks a bit like this issue.

Do you have any idea why this happens and how it could be fixed?

find_trust_items doesn't return Error on invalid argument

If I run the following code:

let mut ctx = gpgme::Context::from_protocol(gpgme::Protocol::OpenPgp)?;
ctx.find_trust_items("DF0C3D316B7312D5", 0)?;

Then it simple returns a empty TrustItems object.

Looking what gpgme does in strace produces the following calls:

[pid  6303] execve("/usr/bin/gpg", ["gpg", "--batch", "--no-sk-comments", "--status-fd", "9", "--no-tty", "--charset", "utf8", "--enable-progress-filter", "--exit-on-status-write-error", "--display", ":0.0", "--ttyname", "/dev/pts/1", "--ttytype", "xterm-256color", "--logger-fd", "13", "--with-colons", "--list-trust-path", "--", "DF0C3D316B7312D5"], 0x5580ba36ad10 /* 57 vars */) = 0
[pid  6303] arch_prctl(0x3001 /* ARCH_??? */, 0x7ffca1eb87e0) = -1 EINVAL (Invalid argument)
[pid  6303] arch_prctl(ARCH_SET_FS, 0x7fcb35d7e740) = 0
[pid  6303] exit_group(2)               = ?

And running that same command in my shell produces this result:

capitol@tool:~$ gpg --batch --no-sk-comments --no-tty --charset utf8 --enable-progress-filter --exit-on-status-write-error --display :0.0 --ttyname /dev/pts/1 --ttytype xterm-256color --with-colons --list-trust-path -- DF0C3D316B7312D5
gpg: invalid option "--list-trust-path"

I would have expected that gpgme would return an error object.

(why gpgme tries to run an option that doesn't seem to exist is a bug for that library maybe?)

Invalid expiration date

Using the following code, the created keys should expires one hour later. In fact they expires after 60 years.

Side note: Why not ask for a duration instead of a absolute time? It would match the API of gpgme.

use gpgme::{Context, CreateKeyFlags, PassphraseRequest, PinentryMode, Protocol};
use std::{
    io::Write,
    time::{Duration, SystemTime},
};

fn main() {
    let validity = Duration::from_secs(3600);
    let expiry = SystemTime::now() + validity;

    let mut ctx = Context::from_protocol(Protocol::OpenPgp).unwrap();
    ctx.set_offline(true);
    ctx.set_armor(true);
    ctx.set_pinentry_mode(PinentryMode::Loopback).unwrap();
    ctx.set_engine_home_dir("/tmp").unwrap();

    ctx.with_passphrase_provider(
        |_: PassphraseRequest, out: &mut dyn Write| {
            out.write_all("password".as_bytes())?;
            Ok(())
        },
        |ctx| {
            let res = ctx
                .create_key_with_flags(
                    "john doe <[email protected]>",
                    "ed25519",
                    Some(expiry),
                    CreateKeyFlags::CERT,
                )
                .unwrap();
            let fpr = res.fingerprint().unwrap();
            let key = ctx.get_key(fpr).unwrap();
            ctx.create_subkey_with_flags(&key, "ed25519", Some(expiry), CreateKeyFlags::AUTH)
                .unwrap();
            ctx.create_subkey_with_flags(&key, "cv25519", Some(expiry), CreateKeyFlags::ENCR)
                .unwrap();
            ctx.create_subkey_with_flags(&key, "ed25519", Some(expiry), CreateKeyFlags::SIGN)
                .unwrap();
        },
    );
}

Q&A: Is it possible to build gpgme with MUSL

For share-secrets-safely I have been hitting my head against a brick wall so far on my quest to get a fully static build on OSX, as well as one that allows to use MUSL. Whenever a wall breaks down, there is another one behind it, making the endeavor very cumbersome and unrewarding.

Thus I am reaching out to you just to ask: Do you think it's feasible and possible to get a fully static and MUSL build with GPGME?

Thanks so much for sharing your expertise :)!

How to build this library on Windows 10?

Hi all,
I'm thinking about creating a cross-platform pass compatible application, and I wish to use this library. However, I failed to build this library. Currently do this library support Windows 10?

`GPG_ERROR_STATIC` does not appear to have an effect on OSX

First of all, thanks so much for making this library! I want to use it for share-secrets-safely, which relies on a 'single binary' deployment model. Thus I am working on statically linking everything, and building with MUSL on linux.

Even though GPGME_STATIC is working fine on OSX, GPG_ERROR_STATIC does not appear to have an effect.

Maybe you have seen that already and can provide me with some pointers on why that could be.
A full log can be found in the details section.

How to reproduce

I could reproduce this on OSX 10.13.1, with GPG installed via brew.

git clone https://github.com/Byron/share-secrets-safely
cd share-secrets-safely
git checkout ed485fd17ba0a6ec9b16091cda8c72e8ca080611 
make target/debug/s3
otool -L target/debug/s3
➜  share-secrets-safely git:(master) ✗ cargo clean
➜  share-secrets-safely git:(master) ✗ make target/debug/s3
GPG_ERROR_STATIC=1 GPGME_STATIC=1 cargo build --all-features -v
   Compiling cfg-if v0.1.2
   Compiling bitflags v0.9.1
   Compiling libc v0.2.34
   Compiling vec_map v0.8.0
     Running `rustc --crate-name cfg_if /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.2/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=be89b6a63a2b495d -C extra-filename=-be89b6a63a2b495d --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name bitflags /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-0.9.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="example_generated"' -C metadata=4b25c0d30084f3de -C extra-filename=-4b25c0d30084f3de --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name vec_map /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/vec_map-0.8.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=2c209cae88e0e9de -C extra-filename=-2c209cae88e0e9de --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name libc /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.34/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="use_std"' -C metadata=b73e05d4592fd20c -C extra-filename=-b73e05d4592fd20c --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling custom_derive v0.1.7
     Running `rustc --crate-name custom_derive /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/custom_derive-0.1.7/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="std"' -C metadata=6c818d7461926838 -C extra-filename=-6c818d7461926838 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling linked-hash-map v0.5.0
     Running `rustc --crate-name linked_hash_map /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/linked-hash-map-0.5.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=eb1bd511edaced1e -C extra-filename=-eb1bd511edaced1e --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling strsim v0.6.0
     Running `rustc --crate-name strsim /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/strsim-0.6.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=6fae99ee65844b18 -C extra-filename=-6fae99ee65844b18 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling lazy_static v0.2.11
     Running `rustc --crate-name lazy_static /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-0.2.11/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=68e4452558387eea -C extra-filename=-68e4452558387eea --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling gcc v0.3.54
     Running `rustc --crate-name gcc /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.54/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=22ab1db1915e3c4a -C extra-filename=-22ab1db1915e3c4a --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling num-traits v0.1.41
     Running `rustc --crate-name num_traits /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/num-traits-0.1.41/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=e348ee14b3a67576 -C extra-filename=-e348ee14b3a67576 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling unicode-xid v0.0.4
     Running `rustc --crate-name unicode_xid /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-xid-0.0.4/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' -C metadata=8a53fcb22e444a4e -C extra-filename=-8a53fcb22e444a4e --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling bitflags v1.0.1
     Running `rustc --crate-name bitflags /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="example_generated"' -C metadata=281389a39f4bf4d9 -C extra-filename=-281389a39f4bf4d9 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling ansi_term v0.10.2
     Running `rustc --crate-name ansi_term /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/ansi_term-0.10.2/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=2f46ca4662737584 -C extra-filename=-2f46ca4662737584 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling s3-types v0.1.0 (file:///Users/byron/dev/share-secrets-safely/lib/types)
     Running `rustc --crate-name s3_types lib/types/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=2e4d256a888bfdea -C extra-filename=-2e4d256a888bfdea --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps`
   Compiling rustc-demangle v0.1.5
     Running `rustc --crate-name rustc_demangle /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-demangle-0.1.5/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=9775e153cf6bc4a8 -C extra-filename=-9775e153cf6bc4a8 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling serde v1.0.24
     Running `rustc --crate-name serde /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.24/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=e409fd2d7f0f760b -C extra-filename=-e409fd2d7f0f760b --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling quote v0.3.15
     Running `rustc --crate-name quote /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-0.3.15/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=5d5fe9e0c8eb4a8c -C extra-filename=-5d5fe9e0c8eb4a8c --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling unicode-width v0.1.4
     Running `rustc --crate-name unicode_width /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-width-0.1.4/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' -C metadata=373df2373c2b9bd9 -C extra-filename=-373df2373c2b9bd9 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow`
   Compiling conv v0.3.3
     Running `rustc --crate-name conv /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/conv-0.3.3/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="custom_derive"' --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=b6e202528589552f -C extra-filename=-b6e202528589552f --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern custom_derive=/Users/byron/dev/share-secrets-safely/target/debug/deps/libcustom_derive-6c818d7461926838.rlib --cap-lints allow`
   Compiling yaml-rust v0.4.0
     Running `rustc --crate-name yaml_rust /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/yaml-rust-0.4.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=ca05f9642fb0de1b -C extra-filename=-ca05f9642fb0de1b --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern linked_hash_map=/Users/byron/dev/share-secrets-safely/target/debug/deps/liblinked_hash_map-eb1bd511edaced1e.rlib --cap-lints allow`
   Compiling atty v0.2.3
     Running `rustc --crate-name atty /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/atty-0.2.3/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=544e4ac45dcf25b8 -C extra-filename=-544e4ac45dcf25b8 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern libc=/Users/byron/dev/share-secrets-safely/target/debug/deps/liblibc-b73e05d4592fd20c.rlib --cap-lints allow`
   Compiling synom v0.11.3
     Running `rustc --crate-name synom /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/synom-0.11.3/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=dfc35b3c4e34a538 -C extra-filename=-dfc35b3c4e34a538 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern unicode_xid=/Users/byron/dev/share-secrets-safely/target/debug/deps/libunicode_xid-8a53fcb22e444a4e.rlib --cap-lints allow`
   Compiling backtrace v0.3.4
     Running `rustc --crate-name backtrace /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.4/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="backtrace-sys"' --cfg 'feature="coresymbolication"' --cfg 'feature="dbghelp"' --cfg 'feature="dbghelp-sys"' --cfg 'feature="default"' --cfg 'feature="dladdr"' --cfg 'feature="kernel32-sys"' --cfg 'feature="libbacktrace"' --cfg 'feature="libunwind"' --cfg 'feature="winapi"' -C metadata=9dbf2971d51afbb9 -C extra-filename=-9dbf2971d51afbb9 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern cfg_if=/Users/byron/dev/share-secrets-safely/target/debug/deps/libcfg_if-be89b6a63a2b495d.rlib --extern rustc_demangle=/Users/byron/dev/share-secrets-safely/target/debug/deps/librustc_demangle-9775e153cf6bc4a8.rlib --extern libc=/Users/byron/dev/share-secrets-safely/target/debug/deps/liblibc-b73e05d4592fd20c.rlib --cap-lints allow`
   Compiling libgpg-error-sys v0.2.3
     Running `rustc --crate-name build_script_build /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/libgpg-error-sys-0.2.3/build.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=2186757e6145f848 -C extra-filename=-2186757e6145f848 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/build/libgpg-error-sys-2186757e6145f848 -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern gcc=/Users/byron/dev/share-secrets-safely/target/debug/deps/libgcc-22ab1db1915e3c4a.rlib --cap-lints allow`
   Compiling gpgme-sys v0.6.1
     Running `rustc --crate-name build_script_build /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/gpgme-sys-0.6.1/build.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 --cfg 'feature="v1_3_0"' --cfg 'feature="v1_3_1"' --cfg 'feature="v1_4_0"' --cfg 'feature="v1_4_2"' --cfg 'feature="v1_4_3"' --cfg 'feature="v1_5_0"' --cfg 'feature="v1_5_1"' --cfg 'feature="v1_6_0"' --cfg 'feature="v1_7_0"' --cfg 'feature="v1_7_1"' --cfg 'feature="v1_8_0"' --cfg 'feature="v1_9_0"' -C metadata=1c3db43400f752cd -C extra-filename=-1c3db43400f752cd --out-dir /Users/byron/dev/share-secrets-safely/target/debug/build/gpgme-sys-1c3db43400f752cd -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern gcc=/Users/byron/dev/share-secrets-safely/target/debug/deps/libgcc-22ab1db1915e3c4a.rlib --extern cfg_if=/Users/byron/dev/share-secrets-safely/target/debug/deps/libcfg_if-be89b6a63a2b495d.rlib --cap-lints allow`
   Compiling textwrap v0.9.0
     Running `rustc --crate-name textwrap /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/textwrap-0.9.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=50e2507be0e6d3ca -C extra-filename=-50e2507be0e6d3ca --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern unicode_width=/Users/byron/dev/share-secrets-safely/target/debug/deps/libunicode_width-373df2373c2b9bd9.rlib --cap-lints allow`
   Compiling syn v0.11.11
     Running `rustc --crate-name syn /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-0.11.11/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="quote"' --cfg 'feature="synom"' --cfg 'feature="unicode-xid"' --cfg 'feature="visit"' -C metadata=942a18d93ce5f2b3 -C extra-filename=-942a18d93ce5f2b3 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern unicode_xid=/Users/byron/dev/share-secrets-safely/target/debug/deps/libunicode_xid-8a53fcb22e444a4e.rlib --extern quote=/Users/byron/dev/share-secrets-safely/target/debug/deps/libquote-5d5fe9e0c8eb4a8c.rlib --extern synom=/Users/byron/dev/share-secrets-safely/target/debug/deps/libsynom-dfc35b3c4e34a538.rlib --cap-lints allow`
     Running `/Users/byron/dev/share-secrets-safely/target/debug/build/libgpg-error-sys-2186757e6145f848/build-script-build`
   Compiling clap v2.29.0
     Running `rustc --crate-name clap /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.29.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="ansi_term"' --cfg 'feature="atty"' --cfg 'feature="color"' --cfg 'feature="default"' --cfg 'feature="strsim"' --cfg 'feature="suggestions"' --cfg 'feature="vec_map"' -C metadata=3a293a1157199ebc -C extra-filename=-3a293a1157199ebc --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern bitflags=/Users/byron/dev/share-secrets-safely/target/debug/deps/libbitflags-281389a39f4bf4d9.rlib --extern unicode_width=/Users/byron/dev/share-secrets-safely/target/debug/deps/libunicode_width-373df2373c2b9bd9.rlib --extern vec_map=/Users/byron/dev/share-secrets-safely/target/debug/deps/libvec_map-2c209cae88e0e9de.rlib --extern ansi_term=/Users/byron/dev/share-secrets-safely/target/debug/deps/libansi_term-2f46ca4662737584.rlib --extern strsim=/Users/byron/dev/share-secrets-safely/target/debug/deps/libstrsim-6fae99ee65844b18.rlib --extern textwrap=/Users/byron/dev/share-secrets-safely/target/debug/deps/libtextwrap-50e2507be0e6d3ca.rlib --extern atty=/Users/byron/dev/share-secrets-safely/target/debug/deps/libatty-544e4ac45dcf25b8.rlib --cap-lints allow`
     Running `rustc --crate-name libgpg_error_sys /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/libgpg-error-sys-0.2.3/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=a3fcf41dbc101870 -C extra-filename=-a3fcf41dbc101870 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --cap-lints allow -L native=/usr/local/opt/libgpg-error/lib -l gpg-error -l pthread`
     Running `/Users/byron/dev/share-secrets-safely/target/debug/build/gpgme-sys-1c3db43400f752cd/build-script-build`
   Compiling gpg-error v0.2.2
     Running `rustc --crate-name gpg_error /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/gpg-error-0.2.2/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=79178c586be30b2f -C extra-filename=-79178c586be30b2f --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern libgpg_error_sys=/Users/byron/dev/share-secrets-safely/target/debug/deps/liblibgpg_error_sys-a3fcf41dbc101870.rlib --cap-lints allow -L native=/usr/local/opt/libgpg-error/lib`
   Compiling serde_derive_internals v0.18.0
     Running `rustc --crate-name serde_derive_internals /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive_internals-0.18.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=0b6bdc704c7b93a7 -C extra-filename=-0b6bdc704c7b93a7 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern syn=/Users/byron/dev/share-secrets-safely/target/debug/deps/libsyn-942a18d93ce5f2b3.rlib --extern synom=/Users/byron/dev/share-secrets-safely/target/debug/deps/libsynom-dfc35b3c4e34a538.rlib --cap-lints allow`
   Compiling synstructure v0.6.1
     Running `rustc --crate-name synstructure /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/synstructure-0.6.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=17fa371df2959430 -C extra-filename=-17fa371df2959430 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern syn=/Users/byron/dev/share-secrets-safely/target/debug/deps/libsyn-942a18d93ce5f2b3.rlib --extern quote=/Users/byron/dev/share-secrets-safely/target/debug/deps/libquote-5d5fe9e0c8eb4a8c.rlib --cap-lints allow`
   Compiling serde_yaml v0.7.3
     Running `rustc --crate-name serde_yaml /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_yaml-0.7.3/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=422e5d3fcd48b917 -C extra-filename=-422e5d3fcd48b917 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern linked_hash_map=/Users/byron/dev/share-secrets-safely/target/debug/deps/liblinked_hash_map-eb1bd511edaced1e.rlib --extern serde=/Users/byron/dev/share-secrets-safely/target/debug/deps/libserde-e409fd2d7f0f760b.rlib --extern num_traits=/Users/byron/dev/share-secrets-safely/target/debug/deps/libnum_traits-e348ee14b3a67576.rlib --extern yaml_rust=/Users/byron/dev/share-secrets-safely/target/debug/deps/libyaml_rust-ca05f9642fb0de1b.rlib --cap-lints allow`
   Compiling serde_derive v1.0.24
     Running `rustc --crate-name serde_derive /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.24/src/lib.rs --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C debuginfo=2 -C metadata=859e3c64aedb6358 -C extra-filename=-859e3c64aedb6358 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern quote=/Users/byron/dev/share-secrets-safely/target/debug/deps/libquote-5d5fe9e0c8eb4a8c.rlib --extern serde_derive_internals=/Users/byron/dev/share-secrets-safely/target/debug/deps/libserde_derive_internals-0b6bdc704c7b93a7.rlib --extern syn=/Users/byron/dev/share-secrets-safely/target/debug/deps/libsyn-942a18d93ce5f2b3.rlib --cap-lints allow`
   Compiling failure_derive v0.1.1
     Running `rustc --crate-name failure_derive /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/failure_derive-0.1.1/src/lib.rs --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=913cc5e42272d191 -C extra-filename=-913cc5e42272d191 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern syn=/Users/byron/dev/share-secrets-safely/target/debug/deps/libsyn-942a18d93ce5f2b3.rlib --extern quote=/Users/byron/dev/share-secrets-safely/target/debug/deps/libquote-5d5fe9e0c8eb4a8c.rlib --extern synstructure=/Users/byron/dev/share-secrets-safely/target/debug/deps/libsynstructure-17fa371df2959430.rlib --cap-lints allow`
   Compiling failure v0.1.1
     Running `rustc --crate-name failure /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="backtrace"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="failure_derive"' --cfg 'feature="std"' -C metadata=683c7b5098f2c8d6 -C extra-filename=-683c7b5098f2c8d6 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern failure_derive=/Users/byron/dev/share-secrets-safely/target/debug/deps/libfailure_derive-913cc5e42272d191.dylib --extern backtrace=/Users/byron/dev/share-secrets-safely/target/debug/deps/libbacktrace-9dbf2971d51afbb9.rlib --cap-lints allow`
   Compiling s3-extract v0.1.0 (file:///Users/byron/dev/share-secrets-safely/lib/extract)
     Running `rustc --crate-name s3_extract lib/extract/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=3ce231fe4aa3bb6a -C extra-filename=-3ce231fe4aa3bb6a --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern s3_types=/Users/byron/dev/share-secrets-safely/target/debug/deps/libs3_types-2e4d256a888bfdea.rlib --extern failure=/Users/byron/dev/share-secrets-safely/target/debug/deps/libfailure-683c7b5098f2c8d6.rlib`
     Running `rustc --crate-name gpgme_sys /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/gpgme-sys-0.6.1/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="v1_3_0"' --cfg 'feature="v1_3_1"' --cfg 'feature="v1_4_0"' --cfg 'feature="v1_4_2"' --cfg 'feature="v1_4_3"' --cfg 'feature="v1_5_0"' --cfg 'feature="v1_5_1"' --cfg 'feature="v1_6_0"' --cfg 'feature="v1_7_0"' --cfg 'feature="v1_7_1"' --cfg 'feature="v1_8_0"' --cfg 'feature="v1_9_0"' -C metadata=98c6936f5906d49e -C extra-filename=-98c6936f5906d49e --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern libc=/Users/byron/dev/share-secrets-safely/target/debug/deps/liblibc-b73e05d4592fd20c.rlib --extern libgpg_error_sys=/Users/byron/dev/share-secrets-safely/target/debug/deps/liblibgpg_error_sys-a3fcf41dbc101870.rlib --cap-lints allow -L native=/Users/byron/dev/share-secrets-safely/target/debug/build/gpgme-sys-5638a05ba9146ee9/out/lib -l static=assuan -l static=gpgme -L native=/usr/local/opt/libgpg-error/lib`
   Compiling gpgme v0.6.1
     Running `rustc --crate-name gpgme /Users/byron/.cargo/registry/src/github.com-1ecc6299db9ec823/gpgme-0.6.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="gpgme-sys"' --cfg 'feature="v1_3_0"' --cfg 'feature="v1_3_1"' --cfg 'feature="v1_4_0"' --cfg 'feature="v1_4_2"' --cfg 'feature="v1_4_3"' --cfg 'feature="v1_5_0"' --cfg 'feature="v1_5_1"' --cfg 'feature="v1_6_0"' --cfg 'feature="v1_7_0"' --cfg 'feature="v1_7_1"' --cfg 'feature="v1_8_0"' --cfg 'feature="v1_9_0"' -C metadata=daaefe49b94b45d3 -C extra-filename=-daaefe49b94b45d3 --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern cfg_if=/Users/byron/dev/share-secrets-safely/target/debug/deps/libcfg_if-be89b6a63a2b495d.rlib --extern conv=/Users/byron/dev/share-secrets-safely/target/debug/deps/libconv-b6e202528589552f.rlib --extern libc=/Users/byron/dev/share-secrets-safely/target/debug/deps/liblibc-b73e05d4592fd20c.rlib --extern gpg_error=/Users/byron/dev/share-secrets-safely/target/debug/deps/libgpg_error-79178c586be30b2f.rlib --extern lazy_static=/Users/byron/dev/share-secrets-safely/target/debug/deps/liblazy_static-68e4452558387eea.rlib --extern bitflags=/Users/byron/dev/share-secrets-safely/target/debug/deps/libbitflags-4b25c0d30084f3de.rlib --extern gpgme_sys=/Users/byron/dev/share-secrets-safely/target/debug/deps/libgpgme_sys-98c6936f5906d49e.rlib --cap-lints allow -L native=/usr/local/opt/libgpg-error/lib -L native=/Users/byron/dev/share-secrets-safely/target/debug/build/gpgme-sys-5638a05ba9146ee9/out/lib`
   Compiling s3-vault v0.1.0 (file:///Users/byron/dev/share-secrets-safely/lib/vault)
     Running `rustc --crate-name s3_vault lib/vault/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=37072d227d361bba -C extra-filename=-37072d227d361bba --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern serde_yaml=/Users/byron/dev/share-secrets-safely/target/debug/deps/libserde_yaml-422e5d3fcd48b917.rlib --extern serde_derive=/Users/byron/dev/share-secrets-safely/target/debug/deps/libserde_derive-859e3c64aedb6358.dylib --extern serde=/Users/byron/dev/share-secrets-safely/target/debug/deps/libserde-e409fd2d7f0f760b.rlib --extern gpgme=/Users/byron/dev/share-secrets-safely/target/debug/deps/libgpgme-daaefe49b94b45d3.rlib --extern s3_types=/Users/byron/dev/share-secrets-safely/target/debug/deps/libs3_types-2e4d256a888bfdea.rlib --extern failure=/Users/byron/dev/share-secrets-safely/target/debug/deps/libfailure-683c7b5098f2c8d6.rlib --extern failure_derive=/Users/byron/dev/share-secrets-safely/target/debug/deps/libfailure_derive-913cc5e42272d191.dylib -L native=/usr/local/opt/libgpg-error/lib -L native=/Users/byron/dev/share-secrets-safely/target/debug/build/gpgme-sys-5638a05ba9146ee9/out/lib`
   Compiling s3-cli v0.1.0 (file:///Users/byron/dev/share-secrets-safely)
     Running `rustc --crate-name s3 src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=90a77fc2ad5a6abc -C extra-filename=-90a77fc2ad5a6abc --out-dir /Users/byron/dev/share-secrets-safely/target/debug/deps -L dependency=/Users/byron/dev/share-secrets-safely/target/debug/deps --extern clap=/Users/byron/dev/share-secrets-safely/target/debug/deps/libclap-3a293a1157199ebc.rlib --extern failure=/Users/byron/dev/share-secrets-safely/target/debug/deps/libfailure-683c7b5098f2c8d6.rlib --extern s3_extract=/Users/byron/dev/share-secrets-safely/target/debug/deps/libs3_extract-3ce231fe4aa3bb6a.rlib --extern s3_vault=/Users/byron/dev/share-secrets-safely/target/debug/deps/libs3_vault-37072d227d361bba.rlib --extern s3_types=/Users/byron/dev/share-secrets-safely/target/debug/deps/libs3_types-2e4d256a888bfdea.rlib -L native=/usr/local/opt/libgpg-error/lib -L native=/Users/byron/dev/share-secrets-safely/target/debug/build/gpgme-sys-5638a05ba9146ee9/out/lib`
    Finished dev [unoptimized + debuginfo] target(s) in 216.21 secs
➜  share-secrets-safely git:(master) ✗ otool -L ./target/debug/s3
./target/debug/s3:
        /usr/local/opt/libgpg-error/lib/libgpg-error.0.dylib (compatibility version 23.0.0, current version 23.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
        /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.