diff options
author | Ingo Klöcker <[email protected]> | 2023-01-24 10:05:52 +0000 |
---|---|---|
committer | Ingo Klöcker <[email protected]> | 2023-01-24 11:32:23 +0000 |
commit | 95ea3bf831aeac201108876e73750692aa1ba3f5 (patch) | |
tree | bff29ce413cb9ee4d55b5a3aa6f4c16888163e8a /doc | |
parent | core: Allow setting the base directory when creating an archive (diff) | |
download | gpgme-95ea3bf831aeac201108876e73750692aa1ba3f5.tar.gz gpgme-95ea3bf831aeac201108876e73750692aa1ba3f5.zip |
core: Support usage of gpgtar for decrypting an encrypted archive
* src/gpgme.h.in (GPGME_DECRYPT_ARCHIVE): New decryption flag.
* src/engine-gpg.c (gpg_decrypt): Set use_gpgtar engine flag if
GPGME_DECRYPT_ARCHIVE flag is set. Check for new enough gpg and
incompatible flags. Use add_gpg_arg_with_value for gpg-only options
with a value and add_gpg_arg for gpg-only options without a value.
Set extra options for gpgtar and pass input data to stdin when using
gpgtar.
* tests/run-decrypt.c (show_usage): New options --archive and
--directory.
(main): Parse new options. Decrypt with gpgtar if --archive is given.
Set file name of output data to value of --directory option.
--
GnuPG-bug-id: 6342
Diffstat (limited to 'doc')
-rw-r--r-- | doc/gpgme.texi | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/doc/gpgme.texi b/doc/gpgme.texi index b8b90bb1..184b1afe 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -3172,8 +3172,8 @@ The string given in @var{value} is passed to the GnuPG engine to override the session key for decryption. The format of that session key is specific to GnuPG and can be retrieved during a decrypt operation when the context flag "export-session-key" is enabled. Please be aware that -using this feature with GnuPG < 2.1.16 will leak the session key on -many platforms via ps(1). +using this feature with GnuPG < 2.1.16 or when decrypting an archive +will leak the session key on many platforms via ps(1). @item "auto-key-retrieve" Setting the @var{value} to "1" asks the backend to automatically @@ -5589,6 +5589,12 @@ The function @code{gpgme_op_decrypt} decrypts the ciphertext in the data object @var{cipher} and stores it into the data object @var{plain}. +If the flag @code(GPGME_DECRYPT_ARCHIVE) is set, then an encrypted +archive in the data object @var{cipher} is decrypted and extracted. +The content of the archive is extracted into a directory named +@code{GPGARCH_n_} (where @code{n} is a number) or into the directory +set with @code{gpgme_data_set_file_name} for the data object @var{plain}. + The function returns the error code @code{GPG_ERR_NO_ERROR} if the ciphertext could be decrypted successfully, @code{GPG_ERR_INV_VALUE} if @var{ctx}, @var{cipher} or @var{plain} is not a valid pointer, @@ -5632,6 +5638,13 @@ multiple of the following bit values: The @code{GPGME_DECRYPT_VERIFY} symbol specifies that this function shall exactly act as @code{gpgme_op_decrypt_verify}. +@item GPGME_DECRYPT_ARCHIVE +@since{1.19.0} + +The @code{GPGME_DECRYPT_ARCHIVE} symbol specifies that the input is an +encrypted archive that shall be decrypted and extracted. This feature +is currently only supported for the OpenPGP crypto engine. + @item GPGME_DECRYPT_UNWRAP @since{1.8.0} |