15. Client interoperability

End-to-end encryption is only worth having if the other end can read it. This chapter records what was actually measured, against which versions, and which cells have never been run.

Important

A cell in these tables means one of three things, and they are not interchangeable:

measured

An automated test executed the third-party tool and asserted the outcome. The test name is given, so the claim can be re-run.

observed

A human ran it once and wrote down what happened. No test guards it; it may already be false.

not run

Nobody has tried. It is not a claim of failure, and it is emphatically not a claim of success.

Rows are never filled in by inference. If Pepsi’s S/MIME output is readable by OpenSSL it does not follow that Outlook reads it, and this chapter does not pretend otherwise.

15.1. Summary

  • OpenPGP against gpg 2.4.7 — measured, both directions, PGP/MIME and inline. All six cells pass. gpg also takes every certificate of a multi-key Web Key Directory answer (Several certificates in one Web Key Directory answer); no other client’s handling of one is measured.

  • S/MIME against OpenSSL 3.5.6 — measured, both directions, including AuthEnvelopedData (AES-GCM), EnvelopedData (AES-CBC), RSA-OAEP, RSA PKCS#1 v1.5, ECDH-KARI, and detached and opaque SignedData.

  • S/MIME against Thunderbird 153.6.0esr — measured, decryption only, and the result is a negative: Thunderbird reads our EnvelopedData (AES-256-CBC) and cannot read our compiled-in default AuthEnvelopedData (AES-256-GCM) at all — silently, returning an empty plaintext rather than an error. This is why Pepsi keeps a per-peer S/MIME capability record and sends EnvelopedData to a correspondent recorded as unable to read AEAD. Signature verification and the OpenPGP half are still not run. See Thunderbird: the gate, and how a GUI client is tested without a GUI.

  • Outlook, Apple Mail — not run. See Outlook and Apple Mail: recorded observations, not gates.

The biggest open question is which clients can read S/MIME AuthEnvelopedData. Its most important answer is known, and it is no. Pepsi answers the question per correspondent rather than for the whole deployment: the recipient’s capability record (The per-peer S/MIME capability record) chooses the S/MIME container. Pepsi learns the record from the SMIMECapabilities attribute of the correspondent’s own signed mail, or the operator configures it. A correspondent with no record gets AEAD. The first such message carries a plaintext notice beside the ciphertext (What a correspondent on an unmeasured client sees), which explains this and asks for a signed reply. So a Thunderbird user who has never sent a signed message sees the notice rather than an unexplained blank, and their first signed reply ends the problem; pepsi-keys peer capability set ADDRESS cbc settles it at once. Outlook and Apple Mail remain unmeasured.

15.2. OpenPGP: gpg

Tested against gpg (GnuPG) 2.4.7, libgcrypt 1.11.0, as packaged on Debian 13. Every cell is executed by cargo test -p pepsi-crypto; the tests skip cleanly (they do not fail) on a machine with no gpg.

Capability

Status

Test

Notes

gpg verifies our PGP/MIME signature

measured

pgp.rs::gpg_verifies_our_detached_signature

RFC 3156 multipart/signed.

gpg decrypts our PGP/MIME ciphertext

measured

interop.rs::gpg_decrypts_what_we_emit

Only after the SEIPD negotiation below.

We verify a gpg PGP/MIME signature

measured

interop.rs::we_verify_a_gpg_signature

gpg’s own armor and micalg.

We decrypt a gpg PGP/MIME ciphertext

measured

interop.rs::we_decrypt_what_gpg_emits

We verify a gpg clearsigned body

measured

interop.rs::we_verify_a_gpg_clearsigned_message

Inline, non-MIME.

We decrypt a gpg inline ciphertext

measured

interop.rs::we_decrypt_a_gpg_inline_message

Inline, non-MIME.

gpg reads our inline output

n/a

—

Pepsi reads inline OpenPGP but never writes it; everything emitted is PGP/MIME. There is nothing to hand gpg, and no cleartext signature (OpenPGP cleartext and detached signature parsing lets unsigned text pass).

15.2.1. Several certificates in one Web Key Directory answer

Pepsi’s Web Key Directory serves every active MUA key of an address, newest first and at most eight, once the user registered one. These are the same keys to which the encrypt and reencrypt stages seal (Key management). The answer is the certificates concatenated, which the specification allows and asks a client to use in full for the address it looked up.

Capability

Status

Test

Notes

gpg imports every certificate of a two-key answer

measured

wkd_publication::gpg_imports_every_certificate_of_a_multi_key_answer

cargo test -p pepsi-test-stages (needs PostgreSQL); the bytes the endpoint serves are fed to gpg --import. The HTTPS fetch itself (gpg --locate-keys) is not exercised.

Thunderbird, Outlook, Apple Mail take every certificate

not run

—

A client that takes only the first certificate gets the newest key, which is what every client got when the directory served one key. A client that takes the last, or refuses a multi-certificate answer, would be a regression to record here when it is seen.

15.2.2. The SEIPDv2 negotiation, confirmed against the real gpg

CRYPTO_ALLOW_DOWNGRADE defaults to negotiate for one concrete reason:

INTEROP OBSERVATION: gpg (GnuPG) 2.4.7 CANNOT read our SEIPDv2/AEAD ciphertext

That line is printed by interop.rs::gpg_cannot_read_seipd_v2 on every run. gpg 2.4.x, which is most of the deployed base, cannot open an RFC 9580 SEIPDv2 message at all. Encrypting AES-GCM unconditionally would therefore produce mail that most OpenPGP users cannot read.

negotiate resolves this from the recipient’s own certificate: an OpenPGP certificate states which SEIPD versions its owner can read, so Pepsi emits SEIPDv2 to a correspondent whose key says they can handle it and SEIPDv1+MDC to one whose key says they cannot — and records which happened on the layer (LayerDetail::downgraded) instead of downgrading silently. The floor is integrity-protected either way: the legacy SED packet, which has no MDC, is neither emitted nor accepted (Downgrade from authenticated to unauthenticated encryption under the same key). That is what gpg_decrypts_what_we_emit proves end to end: encrypting to a SEIPDv1-only certificate produces something that the installed gpg opens.

Note the asymmetry deliberately built into the two tests. The positive claim (“gpg opens what we emit after negotiating”) is asserted, because it is a claim about our behaviour. The negative claim (“gpg cannot read SEIPDv2”) is only printed, because it is a claim about someone else’s roadmap: a future gpg that gains SEIPDv2 support must not turn this suite red.

15.3. S/MIME: OpenSSL

Tested against OpenSSL 3.5.6 (7 Apr 2026). Executed by cargo test -p pepsi-crypto; skips cleanly when openssl is absent.

Capability

Status

Test

Notes

openssl cms decrypts our ciphertext

measured

smime.rs::openssl_decrypts_what_we_emit

AES-GCM AuthEnvelopedData with RSA-OAEP and with PKCS#1 v1.5; AES-CBC EnvelopedData; ECDH-KARI.

openssl cms verifies our signature

measured

smime.rs::openssl_verifies_what_we_sign

Detached and opaque.

…carrying CMSAlgorithmProtection

measured

smime.rs::openssl_verifies_cms_algorithm_protection

RFC 6211 attribute, RSA and P-256 signers. OpenSSL 3.5.7 does not emit the attribute itself, so no OpenSSL signature carrying it is checked in.

openssl reads our certs-only message

measured

smime.rs::openssl_reads_our_certs_only_message

We open what openssl emits now

measured

smime.rs::we_open_what_openssl_emits_right_now

Runs the installed OpenSSL, so it tracks upstream changes.

We open frozen OpenSSL output

measured

smime.rs::every_openssl_produced_message_opens

Six checked-in smime-kat-openssl-*.der known answers (RSA and EC, GCM and CBC, RSA-OAEP, and both ECDH KDFs), so the reader is tested on machines with no OpenSSL at all. Twelve such specimens are checked in across the whole S/MIME suite.

We verify frozen OpenSSL signatures

measured

smime.rs::every_openssl_produced_signature_verifies

Detached, opaque and EC.

…including P-384

measured

smime.rs::p384_signatures_verify

A separate test, because several national S/MIME PKIs issue P-384 certificates.

15.3.1. Encrypting to an elliptic-curve certificate

A newly generated S/MIME identity is P-256 ([pepsi] CRYPTO_SMIME_ALGORITHM defaults to p256), chosen so that mail to it arrives as ECDH key agreement and never reaches an RSA private-key operation (Security model). For a correspondent, this raises the question whether their client can encrypt to an EC certificate, that is, build an ECDH KeyAgreeRecipientInfo (RFC 5753) for a certificate carrying a P-256 key. That is a different measurement from reading an ECDH message, and this table keeps them apart:

Client

Encrypts to our EC certificate?

Basis

OpenSSL 3.5.6 cms

yes

measured: smime.rs::we_open_what_openssl_emits_right_now runs the installed openssl cms -encrypt -recip smime-ec.cert.pem; smime.rs::every_openssl_produced_message_opens opens the frozen EC specimens (GCM and CBC, both ECDH KDFs); smime.rs::p384_key_agreement_round_trips_in_both_directions covers P-384.

Thunderbird 153.6.0esr (NSS)

unknown

not measured in this direction. What is measured (thunderbird.rs::thunderbird_reads_our_smime, the ec case) is the reverse: Thunderbird reads ECDH key agreement that we produced for its own EC certificate, so NSS has the recipient-info path. Whether it builds one for a correspondent’s EC certificate when sending was not run.

gpgsm, Outlook (desktop and Web), Apple Mail / iOS Mail

unknown

not run

If many correspondents cannot do this, the remedy applies to the whole site. The recipient info that a sender builds follows from the key type in our certificate, not from anything that Pepsi expresses, so a deployment whose correspondents cannot encrypt to EC certificates sets CRYPTO_SMIME_ALGORITHM = rsa and generates RSA identities instead. Existing RSA identities keep working either way; the option shapes new identities only (Key management).

15.3.2. The AuthEnvelopedData question

One client has answered this question: Thunderbird, below, and its answer is no. That answer is why the per-peer capability record exists. The rest of the table is still open.

Pepsi’s default S/MIME container is AuthEnvelopedData (AES-256-GCM, RFC 5083/5084). AES-256-CBC EnvelopedData has no integrity protection, which is the precondition for CBC gadget attacks against the recipient’s client (EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail, EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail); the AEAD default exists to avoid them for the mail Pepsi sends. Unlike an OpenPGP certificate, an X.509 certificate advertises no content-encryption capability, so the signal comes from elsewhere — see The per-peer S/MIME capability record.

Which correspondents need a record depends entirely on the clients that they use, and this table is there to record those clients:

Client

Reads AuthEnvelopedData?

Basis

OpenSSL 3.5.6 cms

yes

measured (smime.rs::openssl_decrypts_what_we_emit, gcm-oaep and gcm-kari cases)

Thunderbird 153.6.0esr (NSS)

no

measured (thunderbird.rs::thunderbird_reads_our_smime); see below

Outlook (desktop)

unknown

not run

Outlook Web

unknown

not run

Apple Mail / iOS Mail

unknown

not run

15.3.3. Thunderbird cannot read it

Measured against Thunderbird 153.6.0esr, for both RSA key transport and ECDH key agreement, on ciphertext that this crate produced:

  • EnvelopedData with AES-256-CBC is read correctly; this is what a recipient recorded as unable to read AEAD receives;

  • AuthEnvelopedData with AES-256-GCM, the default output, is not read at all.

Thunderbird’s S/MIME is NSS, so this is a property of NSS rather than of the user interface, and it is very unlikely to change in an ESR series.

Warning

NSS fails silently. It does not raise an error on an AuthEnvelopedData message; it returns an empty plaintext. A caller that checks only for an exception concludes that the message decrypted to nothing. Our own test therefore treats “opened, zero bytes” as a failure (see the note on plaintext() in thunderbird.rs). An operator who investigates a user’s report that “the message is blank” should suspect this before suspecting the message.

The consequence for deployments is concrete: a correspondent who reads mail in Thunderbird needs a capability record saying so. There are two ways to get one (The per-peer S/MIME capability record). Pepsi learns it automatically from the first signed message that the correspondent sends us, because NSS advertises the ciphers that it reads, and AES-GCM is not among them. Or the operator configures it. Until one of those happens, such a correspondent receives AuthEnvelopedData. The first such message tells them so in the clear (What a correspondent on an unmeasured client sees), and every later one is blank until they reply signed or the operator configures the record.

15.3.4. What a correspondent on an unmeasured client sees

Pepsi keeps AEAD for a correspondent with no record, and tells them once. Falling back to CBC for everybody without a record would make the unauthenticated container the rule, since few clients advertise AES-GCM in their SMIMECapabilities. The first message encrypted to a certificate with no capability record is a multipart/mixed: a short text/plain notice, then the application/pkcs7-mime part, under the message’s own header fields. The notice says that the message is protected with an authenticated S/MIME container, that an empty or unreadable message should be reported to the sender, and that a digitally signed reply lets the sender’s mail server learn what the client reads; it says nothing about the message. It is sent once per certificate (smime_capability.notice_sent_at), and a learnt or configured record ends it. The shipped text is smime-aead-notice.<lang>.body in ten languages, chosen from the message’s detected language.

So a user of Thunderbird, Outlook or Apple Mail who has never sent us a signed message sees, on the first message, a readable note above a part that their client either opens or shows blank. A signed reply records their client’s capabilities and switches them to EnvelopedData if that is what they read. What this does not measure is whether a client that reads AuthEnvelopedData also opens it as the second part of a multipart/mixed rather than as the top-level entity: pepsi-stage-decrypt does (notice::tests, encrypt_lifecycle), OpenSSL is not run on this shape, and the rows for Outlook and Apple Mail in the table above stay open on this point too. For that reason, the notice goes with a single message per certificate.

When NSS gains AEAD support, the gate reports this on the first run that succeeds: it prints the AES-256-GCM cell as READ CORRECTLY rather than turning red. The advice above then becomes moot. A Thunderbird that reads AES-GCM will also start advertising it, and its learnt record follows.

Warning

Outlook and Apple Mail remain unmeasured. An operator whose users exchange S/MIME with them should verify by hand with one real message, and configure a cbc record for a correspondent whose client turns out not to read AEAD (or, for a whole population that cannot, set CRYPTO_ALLOW_DOWNGRADE = yes globally). The first message to each unrecorded certificate carries the notice of What a correspondent on an unmeasured client sees, so the correspondent is at least told what to report. Pepsi records the container it emitted on each message’s state.crypto (and aead_notice when the notice went with it), so what actually went out is auditable after the fact rather than guessed at.

15.3.5. The per-peer S/MIME capability record

What a correspondent’s S/MIME client reads is kept in pepsi.smime_capability, one record per peer, and pepsi-stage-encrypt (and pepsi-stage-reencrypt, for a local user’s own client key) chooses the container per recipient from it (the security argument is Which S/MIME container a correspondent gets):

  • learnt: pepsi-stage-autocrypt-learn reads the RFC 8551 §2.5.2 SMIMECapabilities attribute of every S/MIME signature an inbound message carries. A list naming id-aes256-GCM records reads AEAD; a list without it (Thunderbird’s) records does not; no attribute records nothing. The claim counts only if the signature over it verifies under a certificate that the message carries, and it is keyed on that certificate, never on an address. So a stranger who signs a claim with a key of their own describes only that key, and mail to anybody else, encrypted to some other certificate, is untouched. An older claim never replaces a newer one, and a message scored as spam teaches nothing. A correspondent who signs with one certificate and encrypts to another is learnt for the signing certificate only, and needs a configured record;

  • configured: pepsi-keys peer capability set ADDRESS aead|cbc (also *@domain), for a correspondent who has never sent a signed message. A configured record wins over a learnt one.

Under the default CRYPTO_ALLOW_DOWNGRADE = negotiate the container is then:

Record

Container

none

AuthEnvelopedData (AES-256-GCM)

reads AEAD

AuthEnvelopedData (AES-256-GCM)

does not read AEAD

EnvelopedData (AES-256-CBC), recorded as downgraded with smime_capability naming the record’s source

Under no a recipient recorded as unable to read AEAD is refused instead (the no-key policy decides), and under yes every S/MIME recipient gets EnvelopedData whatever its record — the global switch for an operator who wants it. yes also makes an inbound 3DES S/MIME message decryptable instead of refused; 3DES is never emitted under any setting, and RC2, single DES, unprotected OpenPGP SED and MD2 stay refused under all of them (SHA-1 collisions; weak signature digests still produced or accepted, Insufficient key length: factoring RSA-768/1024 and brute-forcing DES, OpenPGP integrity protection (MDC) missing, strippable or not enforced). None of this touches OpenPGP, whose certificates state their own capability: SEIPDv2 for a certificate that advertises it, SEIPDv1+MDC only for one that does not.

A learnt record also says whether the certificate’s own capability list names RFC 9709 id-alg-cek-hkdf-sha256. Only then is the content key derived with HKDF over the algorithm identifier (pepsi-keys peer capability list shows aead+hkdf or cbc+hkdf): a client that does not know the identifier cannot open such a message at all, so a configured record never turns it on. OpenSSL 3.5.7 does not open such a message (openssl cms -decrypt: “Error decrypting CMS structure”; measured by smime::whether_openssl_opens_an_rfc_9709_message, which reports rather than asserts); no other client is measured. Every S/MIME signature Pepsi makes advertises AES-256-GCM, AES-256-CBC and the derivation, which is how one Pepsi installation learns this about another.

15.3.6. What other S/MIME clients make of Pepsi’s signatures

A signature Pepsi makes inside a ciphertext carries, beside the RFC 5652 attributes and SMIMECapabilities, a private signed attribute naming the SHA-256 of every certificate to which the message is encrypted (Who a signed and encrypted message was for; object identifier 1.3.6.1.4.1.32473.808069.1, provisional). Only Pepsi reads it. RFC 5652 section 5.3 tells a verifier to ignore a signed attribute that it does not recognise, and the signature still covers the attribute, so other clients verify such a signature exactly as one without it. OpenSSL 3.5.7 does so (smime::openssl_verifies_a_signature_naming_its_recipients, openssl cms -verify over a signature carrying the attribute and the advertised capabilities); no other client has been run against it. What those clients do not get from the attribute, they get from the protected To: and Cc: that PROTECT_HEADERS (off by default) puts inside the signed entity, provided that the option is on and the client renders protected headers. A client that does not render them shows ... as the subject.

15.4. Thunderbird: the gate, and how a GUI client is tested without a GUI

Thunderbird is a release gate alongside gpg and OpenSSL: it is the most widely deployed client speaking both protocols, and the one most likely to catch a MIME, Content-Transfer-Encoding or micalg problem that gpg and OpenSSL accept happily.

The gate is pepsi-crypto/tests/thunderbird.rs, which runs with the other tests wherever Thunderbird is installed (alone: make interop-thunderbird, or cargo test -p pepsi-crypto --test crypto thunderbird:: -- --nocapture). Version tested: Thunderbird 153.6.0esr.

The gate needs neither a real profile nor a display. Thunderbird’s S/MIME is NSS, and NSS’s CMS decoder is reachable from chrome-privileged JavaScript as @mozilla.org/nsCMSDecoderJS;1, so the test automates no user interface at all:

  1. pepsi-crypto emits the message — our output, not a fixture;

  2. openssl pkcs12 packages the matching fixture key;

  3. Thunderbird starts --headless --marionette -remote-allow-system-access against a throwaway profile;

  4. a small Marionette client (length-prefixed JSON over TCP, implemented inside the test — it is too small to be worth a dependency) runs a chrome script that imports the key into that profile’s NSS database and calls the decoder;

  5. what comes back is compared with the plaintext that was encrypted.

Starting Thunderbird costs about fifteen seconds. Without thunderbird and openssl on PATH the test skips, and a Thunderbird that does not start fails it. CI’s image has both.

Two traps that anyone who extends this test will hit:

  • nsICMSDecoderJS accumulates across calls. Reusing one decoder instance for several messages makes the second report the first message’s plaintext appended to its own — which reads as success. One instance per message.

  • NSS reports an unreadable container as an empty result, not an error. A test that checks only for a thrown exception passes on a message that was never decrypted.

What is still not measured: whether Thunderbird verifies what we sign. nsICMSDecoderJS exposes only decrypt, and reaching NSS’s signature verification from chrome script means going through the message-display pipeline, which does need a profile with a configured account. The OpenPGP half is likewise unmeasured against Thunderbird’s RNP, though gpg, a wholly independent implementation, covers both directions for that protocol.

The frozen-corpus half of the mechanism is built and working: pepsi-crypto/tests/data/interop/ holds specimens plus the verdict that each must produce, and interop.rs::the_frozen_third_party_corpus_still_opens walks them. It currently holds three gpg 2.4.7 specimens and no Thunderbird specimen. Adding one requires no code change; see the README in that directory.

15.4.1. Why the frozen corpus matters

When the gate fails it has to say whose side changed, and a live test cannot: a red result means either our emitter regressed or the client moved, and the run cannot distinguish them. The two halves together can:

  • the frozen corpus is opened by our reader, and the bytes are in git, so a failure there means we regressed; and

  • the live cells run the current tool, so a failure there means they moved.

The version tested must be recorded in this chapter and pinned in the harness, and a specimen of its output frozen into the corpus. Bumping that pin is then a deliberate act with its own result to record, and that keeps the gate meaningful over time.

15.5. Outlook and Apple Mail: recorded observations, not gates

These are out of automation on purpose: they cannot run on hardware that can be kept in CI, and a gate that is not actually checked is worse than an honest observation. They are meant to be exercised by hand at release time, with versions and failures recorded here.

Client

Protocol

Status

Notes

Outlook (desktop)

S/MIME

not run

No version tested. See The AuthEnvelopedData question.

Outlook Web

S/MIME

not run

No version tested.

Apple Mail / iOS Mail

S/MIME

not run

No version tested.

A webmail with no crypto support

—

not run

This is the case for which The secure-link fallback portal exists: the recipient has no key and no client support, and gets a notification mail with a link instead of ciphertext that they cannot open.

15.6. Encoding rules that interoperability forced

Several rules in the emitter exist only because a second implementation rejected the obvious thing. They are recorded here because they look arbitrary in the code and are expensive to rediscover:

  • Canonical CRLF before signing. A signature covers the MIME entity exactly as it appears on the wire. Sequoia’s armor writer emits bare LF, so signed bytes pass through a CRLF canonicaliser before hashing; without it gpg computes a different digest and reports a bad signature over correct data.

  • The signed entity is byte-preserved. The bytes handed to the verifier are the bytes between the MIME boundaries, untouched — no re-wrapping, no header re-ordering, no transfer-encoding change. Any “tidy-up” of a multipart/signed part invalidates it.

  • ``micalg`` is advisory. It is written correctly on output and ignored on input: the real digest is inside the signature. Clients get it wrong, and rejecting on a mismatched micalg rejects valid mail.

  • ``-recip`` rather than a trailing positional, in the OpenSSL test harness: OpenSSL’s option parsing stops at the first positional argument, which silently drops -binary and produces confusing failures.

15.7. Reproducing the measured rows

Everything marked measured runs from a checkout with no network and no deployment:

cargo test -p pepsi-crypto                      # every measured cell
cargo test -p pepsi-crypto --test crypto interop:: -- --nocapture   # OpenPGP, verbose

Both skip rather than fail when gpg or OpenSSL is missing, so a machine without them still runs the rest of the suite. A skipped cell prints a SKIP line with its reason (see When a case may skip). Once the tool is installed, whatever it refuses to do fails the cell.

To refresh the frozen gpg specimens against a newer gpg:

PEPSI_CRYPTO_WRITE_INTEROP_CORPUS=1 cargo test -p pepsi-crypto --test crypto interop::

That rewrites the specimens and the recorded producer version; it is a deliberate act, and a reviewer sees its diff; it is never part of an ordinary run.

15.8. See also

Key management — the identities, custody and discovery layer behind the messages measured here. pepsi-stage-encrypt and pepsi-stage-decrypt — the two stages whose output and input these tables describe. RFC Index — which specification each container and parameter comes from. Test Suite — how the rest of the suite is organised.