certbotbot
Reference documentation for a modular Bash project
Loading...
Searching...
No Matches
Functions
client-crypto.bash File Reference

Conditional authenticated-GnuPG capability preflight for the client. More...

Functions

int certbotbot_client_crypto_probe_packets (String home, String packet)
 Recognizes the expected issuer-compatible authenticated probe format.
 
int certbotbot_client_crypto_require (String workspace)
 Proves the local GnuPG implementation can produce and consume v1 OCB.
 
int certbotbot_client_crypto_framing_valid (String packet)
 Requires exactly one complete SKESK packet then one AEAD packet.
 
int certbotbot_client_crypto_unwrap (String workspace)
 Authenticates the selected exact-v1 S3 ciphertext before any tar work.
 

Detailed Description

Conditional authenticated-GnuPG capability preflight for the client.

ADR-037 requires a real AES-256/OCB encrypt/decrypt roundtrip with the producer's exact S2K and packet parameters before encrypted retrieval. Only authenticated, checked ciphertext is handed to the existing validator. The entrypoint captures the exported secret into a non-exported Bash local and removes its environment name before any external program is invoked.

Function Documentation

◆ certbotbot_client_crypto_framing_valid()

int certbotbot_client_crypto_framing_valid ( String  packet)

Requires exactly one complete SKESK packet then one AEAD packet.

OpenPGP packet framing is length-delimited; GnuPG diagnostic text alone does not prove that a complete ciphertext was consumed. This bounded, streaming byte walk accepts old/new definite-length headers and RFC-4880 new-format partial-body chunks, but no extra packet or trailing bytes. Format details still require the separate GnuPG packet inspection and authenticated decrypt. This parser does not interpret crypto payloads.

Parameters
packetPrivately staged binary GnuPG ciphertext.
STDIN
Nothing is read from STDIN.
STDOUT
Nothing is written to STDOUT.
STDERR
Nothing is written to STDERR.
Return values
0Exactly two complete supported packet frames and no trailing data.
1Invalid, overlong, truncated or unsupported framing.

◆ certbotbot_client_crypto_probe_packets()

int certbotbot_client_crypto_probe_packets ( String  home,
String  packet 
)

Recognizes the expected issuer-compatible authenticated probe format.

Parameters
homePrivate GnuPG home owned by this invocation.
packetFresh probe ciphertext in the private workspace.
STDIN
Nothing is read from STDIN.
Returns
Nothing is written to STDOUT.
Return values
0Probe packet reports the expected v1 OCB cipher and S2K.
1Missing, invalid, or unsupported probe packet.
Note
Packet inspection is not authentication; a complete verified decrypt-and-compare is a separate mandatory preflight gate.

◆ certbotbot_client_crypto_require()

int certbotbot_client_crypto_require ( String  workspace)

Proves the local GnuPG implementation can produce and consume v1 OCB.

Parameters
workspaceNew private mode-0700 staging directory.
STDIN
Nothing is read from STDIN.
STDOUT
Nothing is written to STDOUT.
STDERR
A single fixed nonsecret diagnostic is written on failure.
Return values
0GnuPG >=2.4.7 and actual authenticated OCB roundtrip succeeded.
69Missing, incompatible, or malfunctioning GnuPG capability.
Note
CERTBOTBOT_CLIENT_GPG_SECRET is a non-exported Bash-local variable dynamically scoped from the entrypoint, never an OS process argument.

◆ certbotbot_client_crypto_unwrap()

int certbotbot_client_crypto_unwrap ( String  workspace)

Authenticates the selected exact-v1 S3 ciphertext before any tar work.

Only the existing client workspace is touched. GnuPG may write plaintext before its final AEAD check; therefore the private candidate is NEVER handed to tar or presented as downloaded.tar.gz until GnuPG has exited successfully, its complete framed packet has been inspected, and the existing bounded archive validator has accepted the decrypted file. The entrypoint's EXIT cleanup owns all temporary paths on every failure.

Parameters
workspaceExisting private client workspace after one S3 GetObject.
STDIN
Nothing is read from STDIN.
STDOUT
Nothing is written to STDOUT.
STDERR
Fixed nonsecret diagnostics on failure; raw tool output suppressed.
Return values
0Full authenticated gzip/tar now staged as downloaded.tar.gz.
65Missing/wrong envelope, unsupported packet, bad key or archive.
74Local private staging failure.