1

I'm having trouble using gpg when I use the <() syntax for process substitution.

Here is a minimal-working example of my problem:

$ gpg2 -c -o out.gpg <(head -c 73729 /dev/zero)

gpg: do_plaintext(): wrote 65537 bytes but expected 65536 bytes

When the input file is less than 73729 bytes, I don't get the error. (On my friend's computer the maximum filesize was 65535 bytes. I notice that 73729 is very close to 65535 + 2^13, not sure if that's relevant.)

However, it works when I use the pipe-based process substitution:

$ head -c 73729 /dev/zero | gpg2 -c -o out.gpg   

Is this a bug, or am I doing something wrong with the <() syntax?

Here is the file in the GPG source code on GitHub where the error appears.

Here is my version of GPG:

$ gpg --version
gpg (GnuPG) 2.2.5
libgcrypt 1.8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /Users/XXXXXXXX/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Thanks for your help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.