Compare commits
32 Commits
ikloecker/
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
5c095553e4 | ||
|
9ab2ce36f9 | ||
|
c69240c843 | ||
|
42e151b34b | ||
|
e6830b58b6 | ||
|
899a572b33 | ||
|
69558f2c0b | ||
|
576d2db9dd | ||
|
aa15a664b3 | ||
|
e46748a0d1 | ||
|
f6d020e24f | ||
|
28542b14c4 | ||
|
2656d3ee5b | ||
|
acf574af64 | ||
|
b7435b31f6 | ||
|
95bd4fa813 | ||
|
de60684500 | ||
|
8b4171680c | ||
|
9c276e762a | ||
|
ec2c6dd8bc | ||
|
6ed5c9a38a | ||
|
7d5df0bf0d | ||
|
09827ffc77 | ||
|
53c367629a | ||
|
c52e1943a7 | ||
|
60b96d149c | ||
|
6c90ec7be2 | ||
|
14b035034a | ||
|
2187a4de8c | ||
|
5b73b0722a | ||
|
3b9815bd8a | ||
|
307256d277 |
20
NEWS
20
NEWS
@ -9,27 +9,43 @@ Noteworthy changes in version 1.24.0 (unrelease)
|
|||||||
|
|
||||||
* Add information about designated revocation keys. [T7118]
|
* Add information about designated revocation keys. [T7118]
|
||||||
|
|
||||||
|
* New context flag "import-options". [T7152]
|
||||||
|
|
||||||
* cpp: Provide information about designated revocation keys for a Key.
|
* cpp: Provide information about designated revocation keys for a Key.
|
||||||
[T7118]
|
[T7118]
|
||||||
|
|
||||||
|
* cpp: Add safer member function returning text describing an error.
|
||||||
|
[T5960]
|
||||||
|
|
||||||
|
* qt: Build QGpgME for Qt 5 and Qt 6 simultaneously. [T7205]
|
||||||
|
|
||||||
|
* qt: Install headers for Qt 5 and Qt 6 in separate folders. [T7161]
|
||||||
|
|
||||||
* qt: Allow reading the data to decrypt/encrypt/sign/verify directly from
|
* qt: Allow reading the data to decrypt/encrypt/sign/verify directly from
|
||||||
files. [T6550]
|
files. [T6550]
|
||||||
|
|
||||||
* qt: Allow writing the decrypted/encrypted/signed/verified data directly
|
* qt: Allow writing the decrypted/encrypted/signed/verified data directly
|
||||||
to files. [T6550]
|
to files. [T6550]
|
||||||
|
|
||||||
|
* qt: Allow specifying import options when importing keys. [T7152]
|
||||||
|
|
||||||
|
* qt: Allow appending a detached signature to an existing file. [T6867]
|
||||||
|
|
||||||
* Interface changes relative to the 1.23.2 release:
|
* Interface changes relative to the 1.23.2 release:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
GPGME_ENCRYPT_FILE NEW.
|
GPGME_ENCRYPT_FILE NEW.
|
||||||
GPGME_SIG_MODE_FILE NEW.
|
GPGME_SIG_MODE_FILE NEW.
|
||||||
gpgme_key_t EXTENDED: New field 'revkeys'.
|
gpgme_key_t EXTENDED: New field 'revkeys'.
|
||||||
gpgme_revocation_key_t NEW.
|
gpgme_revocation_key_t NEW.
|
||||||
|
gpgme_set_ctx_flag EXTENDED: New flag 'import-options'.
|
||||||
cpp: Context::EncryptFile NEW.
|
cpp: Context::EncryptFile NEW.
|
||||||
cpp: SignatureMode::SignFile NEW.
|
cpp: SignatureMode::SignFile NEW.
|
||||||
cpp: RevocationKey NEW.
|
cpp: RevocationKey NEW.
|
||||||
cpp: Key::revocationKey NEW.
|
cpp: Key::revocationKey NEW.
|
||||||
cpp: Key::numRevocationKeys NEW.
|
cpp: Key::numRevocationKeys NEW.
|
||||||
cpp: Key::revocationKeys NEW.
|
cpp: Key::revocationKeys NEW.
|
||||||
|
cpp: Error::asStdString NEW.
|
||||||
|
cpp: Error::asString DEPRECATED.
|
||||||
qt: DecryptVerifyJob::setInputFile NEW.
|
qt: DecryptVerifyJob::setInputFile NEW.
|
||||||
qt: DecryptVerifyJob::inputFile NEW.
|
qt: DecryptVerifyJob::inputFile NEW.
|
||||||
qt: DecryptVerifyJob::setOutputFile NEW.
|
qt: DecryptVerifyJob::setOutputFile NEW.
|
||||||
@ -60,6 +76,8 @@ Noteworthy changes in version 1.24.0 (unrelease)
|
|||||||
qt: SignJob::outputFile NEW.
|
qt: SignJob::outputFile NEW.
|
||||||
qt: SignJob::setSigningFlags NEW.
|
qt: SignJob::setSigningFlags NEW.
|
||||||
qt: SignJob::signingFlags NEW.
|
qt: SignJob::signingFlags NEW.
|
||||||
|
qt: SignJob::setAppendSignature NEW.
|
||||||
|
qt: SignJob::appendSignatureEnabled NEW.
|
||||||
qt: VerifyDetachedJob::setSignatureFile NEW.
|
qt: VerifyDetachedJob::setSignatureFile NEW.
|
||||||
qt: VerifyDetachedJob::signatureFile NEW.
|
qt: VerifyDetachedJob::signatureFile NEW.
|
||||||
qt: VerifyDetachedJob::setSignedFile NEW.
|
qt: VerifyDetachedJob::setSignedFile NEW.
|
||||||
@ -68,6 +86,8 @@ Noteworthy changes in version 1.24.0 (unrelease)
|
|||||||
qt: VerifyOpaqueJob::inputFile NEW.
|
qt: VerifyOpaqueJob::inputFile NEW.
|
||||||
qt: VerifyOpaqueJob::setOutputFile NEW.
|
qt: VerifyOpaqueJob::setOutputFile NEW.
|
||||||
qt: VerifyOpaqueJob::outputFile NEW.
|
qt: VerifyOpaqueJob::outputFile NEW.
|
||||||
|
qt: ImportJob::setImportOptions NEW.
|
||||||
|
qt: ImportJob::importOptions NEW.
|
||||||
|
|
||||||
|
|
||||||
Noteworthy changes in version 1.23.2 (2023-11-28)
|
Noteworthy changes in version 1.23.2 (2023-11-28)
|
||||||
|
104
configure.ac
104
configure.ac
@ -257,7 +257,7 @@ have_macos_system=no
|
|||||||
build_w32_glib=no
|
build_w32_glib=no
|
||||||
build_w32_qt=no
|
build_w32_qt=no
|
||||||
available_languages="cl cpp python qt qt5 qt6"
|
available_languages="cl cpp python qt qt5 qt6"
|
||||||
default_languages="cl cpp python qt"
|
default_languages="cl cpp python qt5 qt6"
|
||||||
case "${host}" in
|
case "${host}" in
|
||||||
x86_64-*mingw32*)
|
x86_64-*mingw32*)
|
||||||
have_w64_system=yes
|
have_w64_system=yes
|
||||||
@ -375,8 +375,7 @@ AC_ARG_ENABLE([no-direct-extern-access],
|
|||||||
AC_ARG_ENABLE([languages],
|
AC_ARG_ENABLE([languages],
|
||||||
AS_HELP_STRING([--enable-languages=languages],
|
AS_HELP_STRING([--enable-languages=languages],
|
||||||
[enable only specific language bindings:
|
[enable only specific language bindings:
|
||||||
cl cpp python qt qt5 qt6 (qt selects qt5 or qt6,
|
cl cpp python qt5 qt6]),
|
||||||
and qt5 and qt6 exclude each other)]),
|
|
||||||
[enabled_languages=`echo $enableval | \
|
[enabled_languages=`echo $enableval | \
|
||||||
tr ',:' ' ' | tr '[A-Z]' '[a-z]' | \
|
tr ',:' ' ' | tr '[A-Z]' '[a-z]' | \
|
||||||
sed 's/c++/cpp/'`],
|
sed 's/c++/cpp/'`],
|
||||||
@ -402,76 +401,95 @@ for language in $enabled_languages; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check whether Qt5 and/or Qt6 are enabled explicitly
|
# Check whether qt5 and/or qt6 are enabled
|
||||||
want_qt5="no";
|
want_qt5="no"
|
||||||
LIST_MEMBER("qt5", $enabled_languages)
|
LIST_MEMBER("qt5", $enabled_languages)
|
||||||
if test "$found" = "1"; then
|
if test "$found" = "1"; then
|
||||||
want_qt5="yes";
|
if test "$explicit_languages" = "1"; then
|
||||||
|
want_qt5="yes"
|
||||||
|
else
|
||||||
|
want_qt5="maybe"
|
||||||
|
fi
|
||||||
# Remove qt5; further down qt will be added
|
# Remove qt5; further down qt will be added
|
||||||
enabled_languages=$(echo $enabled_languages | sed 's/qt5//')
|
enabled_languages=$(echo $enabled_languages | sed 's/qt5//')
|
||||||
fi
|
fi
|
||||||
want_qt6="no";
|
want_qt6="no"
|
||||||
LIST_MEMBER("qt6", $enabled_languages)
|
LIST_MEMBER("qt6", $enabled_languages)
|
||||||
if test "$found" = "1"; then
|
if test "$found" = "1"; then
|
||||||
want_qt6="yes";
|
if test "$explicit_languages" = "1"; then
|
||||||
|
want_qt6="yes"
|
||||||
|
else
|
||||||
|
want_qt6="maybe"
|
||||||
|
fi
|
||||||
# Remove qt6; further down qt will be added
|
# Remove qt6; further down qt will be added
|
||||||
enabled_languages=$(echo $enabled_languages | sed 's/qt6//')
|
enabled_languages=$(echo $enabled_languages | sed 's/qt6//')
|
||||||
fi
|
fi
|
||||||
if test "$want_qt5" = "yes" -a "$want_qt6" = "yes"; then
|
|
||||||
AC_MSG_ERROR([[
|
# Check whether qt is enabled; if yes then it has been enabled explicitly
|
||||||
|
want_qt="no"
|
||||||
|
LIST_MEMBER("qt", $enabled_languages)
|
||||||
|
if test "$found" = "1"; then
|
||||||
|
# Ignore qt if specified together with qt5 or qt6
|
||||||
|
if test "$want_qt5" = "no" -a "$want_qt6" = "no"; then
|
||||||
|
want_qt="yes"
|
||||||
|
fi
|
||||||
|
# Remove qt
|
||||||
|
enabled_languages=$(echo $enabled_languages | sed 's/qt//')
|
||||||
|
AC_MSG_WARN([[
|
||||||
***
|
***
|
||||||
*** The bindings for Qt5 and Qt6 cannot be built simultaneously.
|
*** Language binding "qt" is deprecated and will be removed in a future version.
|
||||||
|
*** Use "qt5" and/or "qt6" instead.
|
||||||
***]])
|
***]])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure that pkg-config is available for all calls of FIND_QT5/FIND_QT6
|
# Ensure that pkg-config is available for all calls of FIND_QT5/FIND_QT6
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
|
|
||||||
# If the generic qt is enabled, then check for Qt5 or Qt6 (in this order)
|
# Check for Qt 5 (if qt5 or qt is enabled)
|
||||||
LIST_MEMBER("qt", $enabled_languages)
|
if test "$want_qt" = "yes"; then
|
||||||
if test "$found" = "1"; then
|
want_qt5="maybe"
|
||||||
# Remove the generic qt (qt5 and qt6 have already been removed)
|
fi
|
||||||
enabled_languages=$(echo $enabled_languages | sed 's/qt//')
|
if test "$want_qt5" != "no"; then
|
||||||
FIND_QT5
|
FIND_QT5
|
||||||
if test "$have_qt5_libs" = "yes"; then
|
if test "$have_qt5_libs" = "yes"; then
|
||||||
want_qt5="yes";
|
want_qt5="yes"
|
||||||
else
|
|
||||||
FIND_QT6
|
|
||||||
if test "$have_qt6_libs" = "yes"; then
|
|
||||||
want_qt6="yes";
|
|
||||||
else
|
|
||||||
if test "$explicit_languages" = "1"; then
|
|
||||||
AC_MSG_ERROR([[
|
|
||||||
***
|
|
||||||
*** Qt5 (Qt5Core) or Qt6 (Qt6Core) is required for the Qt binding.
|
|
||||||
***]])
|
|
||||||
else
|
|
||||||
AC_MSG_WARN([[
|
|
||||||
***
|
|
||||||
*** Qt5 (Qt5Core) and Qt6 (Qt6Core) not found. Qt Binding will be disabled.
|
|
||||||
***]])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
elif test "$want_qt5" = "yes"; then
|
elif test "$want_qt5" = "yes"; then
|
||||||
FIND_QT5
|
|
||||||
if test "$have_qt5_libs" != "yes"; then
|
|
||||||
AC_MSG_ERROR([[
|
AC_MSG_ERROR([[
|
||||||
***
|
***
|
||||||
*** Qt5 (Qt5Core) is required for the Qt 5 binding.
|
*** Qt5 (Qt5Core) is required for the Qt 5 binding.
|
||||||
***]])
|
***]])
|
||||||
|
else
|
||||||
|
want_qt5="no"
|
||||||
fi
|
fi
|
||||||
elif test "$want_qt6" = "yes"; then
|
fi
|
||||||
|
|
||||||
|
# Check for Qt 6 (if qt6 is enabled or if qt is enabled and Qt 5 wasn't found)
|
||||||
|
if test "$want_qt" = "yes" -a "$have_qt5_libs" != "yes"; then
|
||||||
|
want_qt6="maybe"
|
||||||
|
fi
|
||||||
|
if test "$want_qt6" != "no"; then
|
||||||
FIND_QT6
|
FIND_QT6
|
||||||
if test "$have_qt6_libs" != "yes"; then
|
if test "$have_qt6_libs" = "yes"; then
|
||||||
|
want_qt6="yes";
|
||||||
|
elif test "$want_qt6" = "yes"; then
|
||||||
AC_MSG_ERROR([[
|
AC_MSG_ERROR([[
|
||||||
***
|
***
|
||||||
*** Qt6 (Qt6Core) is required for the Qt 6 binding.
|
*** Qt6 (Qt6Core) is required for the Qt 6 binding.
|
||||||
***]])
|
***]])
|
||||||
|
else
|
||||||
|
want_qt6="no"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that cpp is enabled if qt5 or qt6 is enabled
|
# Check if any Qt was found (if qt is enabled)
|
||||||
|
if test "$want_qt" = "yes" -a "$have_qt5_libs" != "yes" -a "$have_qt6_libs" != "yes"; then
|
||||||
|
AC_MSG_ERROR([[
|
||||||
|
***
|
||||||
|
*** Qt5 (Qt5Core) or Qt6 (Qt6Core) is required for the Qt bindings.
|
||||||
|
***]])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check that cpp is enabled if qt5 or qt6 is enabled and was found
|
||||||
if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
|
if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
|
||||||
LIST_MEMBER("cpp", $enabled_languages)
|
LIST_MEMBER("cpp", $enabled_languages)
|
||||||
if test "$found" = "0"; then
|
if test "$found" = "0"; then
|
||||||
@ -522,7 +540,7 @@ if test "$found" = "1" -a "$HAVE_CXX17" != "1"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Now append qt to the list of language bindings
|
# Now append qt to the list of language bindings (to enable the subdir in lang)
|
||||||
if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
|
if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
|
||||||
enabled_languages=$(echo $enabled_languages qt)
|
enabled_languages=$(echo $enabled_languages qt)
|
||||||
fi
|
fi
|
||||||
@ -1145,7 +1163,9 @@ AC_CONFIG_FILES([lang/python/Makefile
|
|||||||
AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
|
AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
if test "$want_qt5" = "yes"; then
|
if test "$want_qt5" = "yes" -a "$want_qt6" = "yes"; then
|
||||||
|
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 5, Qt 6)/")
|
||||||
|
elif test "$want_qt5" = "yes"; then
|
||||||
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 5)/")
|
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 5)/")
|
||||||
elif test "$want_qt6" = "yes"; then
|
elif test "$want_qt6" = "yes"; then
|
||||||
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 6)/")
|
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 6)/")
|
||||||
|
@ -3279,6 +3279,12 @@ The string given in @var{value} is passed to the GnuPG engine to use as
|
|||||||
filter when importing keys. Valid values are documented in the GnuPG
|
filter when importing keys. Valid values are documented in the GnuPG
|
||||||
manual and the gpg man page under the option @option{--import-filter}.
|
manual and the gpg man page under the option @option{--import-filter}.
|
||||||
|
|
||||||
|
@item "import-options"
|
||||||
|
@since{1.24.0}
|
||||||
|
The string given in @var{value} is passed to the GnuPG engine to use as
|
||||||
|
options when importing keys. Valid values are documented in the GnuPG
|
||||||
|
manual and the gpg man page under the option @option{--import-options}.
|
||||||
|
|
||||||
@item "no-auto-check-trustdb"
|
@item "no-auto-check-trustdb"
|
||||||
@since{1.19.0}
|
@since{1.19.0}
|
||||||
Setting the @var{value} to "1" forces the GPG backend to disable the
|
Setting the @var{value} to "1" forces the GPG backend to disable the
|
||||||
|
@ -88,6 +88,14 @@ else
|
|||||||
libsuffix=.so
|
libsuffix=.so
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
copied_headers = $(gpgmepp_headers:%=gpgme++/%) $(interface_headers:%=gpgme++/%)
|
||||||
|
|
||||||
|
$(copied_headers): Makefile.am
|
||||||
|
mkdir -p $(builddir)/gpgme++/interfaces
|
||||||
|
echo -n "#include \"$(abs_srcdir)" > "$@"
|
||||||
|
echo -n "$@" | sed "s/gpgme++//" >> "$@"
|
||||||
|
echo "\"" >> "$@"
|
||||||
|
|
||||||
if HAVE_W32_SYSTEM
|
if HAVE_W32_SYSTEM
|
||||||
GpgmeppConfig.cmake: GpgmeppConfig-w32.cmake.in
|
GpgmeppConfig.cmake: GpgmeppConfig-w32.cmake.in
|
||||||
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
||||||
@ -115,5 +123,8 @@ install-data-local: install-cmake-files
|
|||||||
|
|
||||||
uninstall-local: uninstall-cmake-files
|
uninstall-local: uninstall-cmake-files
|
||||||
|
|
||||||
|
BUILT_SOURCES = $(copied_headers)
|
||||||
|
|
||||||
CLEANFILES = GpgmeppConfig.cmake GpgmeppConfigVersion.cmake \
|
CLEANFILES = GpgmeppConfig.cmake GpgmeppConfigVersion.cmake \
|
||||||
gpgmepp_version.h GpgmeppConfig.cmake.in
|
gpgmepp_version.h GpgmeppConfig.cmake.in \
|
||||||
|
$(copied_headers)
|
||||||
|
@ -130,6 +130,13 @@ const char *Error::asString() const
|
|||||||
return mMessage.c_str();
|
return mMessage.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Error::asStdString() const
|
||||||
|
{
|
||||||
|
std::string message;
|
||||||
|
format_error(static_cast<gpgme_error_t>(mErr), message);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
int Error::code() const
|
int Error::code() const
|
||||||
{
|
{
|
||||||
return gpgme_err_code(mErr);
|
return gpgme_err_code(mErr);
|
||||||
@ -188,7 +195,7 @@ Error Error::fromCode(unsigned int err, unsigned int src)
|
|||||||
|
|
||||||
std::ostream &operator<<(std::ostream &os, const Error &err)
|
std::ostream &operator<<(std::ostream &os, const Error &err)
|
||||||
{
|
{
|
||||||
return os << "GpgME::Error(" << err.encodedError() << " (" << err.asString() << "))";
|
return os << "GpgME::Error(" << err.encodedError() << " (" << err.asStdString() << "))";
|
||||||
}
|
}
|
||||||
|
|
||||||
Context::KeyListModeSaver::KeyListModeSaver(Context *ctx)
|
Context::KeyListModeSaver::KeyListModeSaver(Context *ctx)
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
context_glib.cpp - wraps a gpgme key context, gpgme-glib-specific functions
|
|
||||||
Copyright (C) 2007 Klarälvdalens Datakonsult AB
|
|
||||||
2016 Bundesamt für Sicherheit in der Informationstechnik
|
|
||||||
Software engineering by Intevation GmbH
|
|
||||||
|
|
||||||
This file is part of GPGME++.
|
|
||||||
|
|
||||||
GPGME++ is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Library General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
GPGME++ is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public License
|
|
||||||
along with GPGME++; see the file COPYING.LIB. If not, write to the
|
|
||||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <global.h>
|
|
||||||
|
|
||||||
extern "C" GIOChannel *gpgme_get_fdptr(int);
|
|
||||||
|
|
||||||
GIOChannel *GpgME::getGIOChannel(int fd)
|
|
||||||
{
|
|
||||||
return gpgme_get_fdptr(fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
QIODevice *GpgME::getQIODevice(int fd)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
context_qt.cpp - wraps a gpgme key context, gpgme-qt-specific functions
|
|
||||||
Copyright (C) 2007 Klarälvdalens Datakonsult AB
|
|
||||||
2016 Bundesamt für Sicherheit in der Informationstechnik
|
|
||||||
Software engineering by Intevation GmbH
|
|
||||||
|
|
||||||
This file is part of GPGME++.
|
|
||||||
|
|
||||||
GPGME++ is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Library General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
GPGME++ is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public License
|
|
||||||
along with GPGME++; see the file COPYING.LIB. If not, write to the
|
|
||||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <global.h>
|
|
||||||
|
|
||||||
extern "C" QIODevice *gpgme_get_fdptr(int);
|
|
||||||
|
|
||||||
GIOChannel *GpgME::getGIOChannel(int)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
QIODevice *GpgME::getQIODevice(int fd)
|
|
||||||
{
|
|
||||||
return gpgme_get_fdptr(fd);
|
|
||||||
}
|
|
@ -138,7 +138,7 @@ public:
|
|||||||
if (writeAll(fd, result, len) != len) {
|
if (writeAll(fd, result, len) != len) {
|
||||||
err = Error::fromSystemError();
|
err = Error::fromSystemError();
|
||||||
if (ei->debug) {
|
if (ei->debug) {
|
||||||
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asString());
|
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asStdString().c_str());
|
||||||
}
|
}
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ public:
|
|||||||
if (writeAll(fd, "\n", 1) != 1) {
|
if (writeAll(fd, "\n", 1) != 1) {
|
||||||
err = Error::fromSystemError();
|
err = Error::fromSystemError();
|
||||||
if (ei->debug) {
|
if (ei->debug) {
|
||||||
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asString());
|
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asStdString().c_str());
|
||||||
}
|
}
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,11 @@ public:
|
|||||||
explicit Error(unsigned int e) : mErr(e), mMessage() {}
|
explicit Error(unsigned int e) : mErr(e), mMessage() {}
|
||||||
|
|
||||||
const char *source() const;
|
const char *source() const;
|
||||||
const char *asString() const;
|
/* This function is deprecated. Use asStdString() instead. asString() may
|
||||||
|
* return wrongly encoded (i.e. not UTF-8) results on Windows for the main
|
||||||
|
* thread if the function was first called from a secondary thread. */
|
||||||
|
GPGMEPP_DEPRECATED const char *asString() const;
|
||||||
|
std::string asStdString() const;
|
||||||
|
|
||||||
int code() const;
|
int code() const;
|
||||||
int sourceID() const;
|
int sourceID() const;
|
||||||
|
@ -150,7 +150,7 @@ main (int argc, char **argv)
|
|||||||
const GpgME::Key key = ctx->key (*argv, err, only_secret);
|
const GpgME::Key key = ctx->key (*argv, err, only_secret);
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|
||||||
ss << "Key " << key << " Err: " << err.asString() << "\n";
|
ss << "Key " << key << " Err: " << err.asStdString() << "\n";
|
||||||
|
|
||||||
std::cout << ss.str();
|
std::cout << ss.str();
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
Error err = ctx->startKeyListing (*argv, only_secret);
|
Error err = ctx->startKeyListing (*argv, only_secret);
|
||||||
if (err) {
|
if (err) {
|
||||||
std::cout << "Error: " << err.asString() << "\n";
|
std::cout << "Error: " << err.asStdString() << "\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
GpgME::Key key;
|
GpgME::Key key;
|
||||||
|
@ -75,31 +75,31 @@ main (int argc, char **argv)
|
|||||||
Error err;
|
Error err;
|
||||||
auto ctx = std::unique_ptr<Context>{Context::createForEngine(AssuanEngine, &err)};
|
auto ctx = std::unique_ptr<Context>{Context::createForEngine(AssuanEngine, &err)};
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
std::cerr << "Failed to get context (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to get context (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string dirmngrSocket = GpgME::dirInfo("dirmngr-socket");
|
const std::string dirmngrSocket = GpgME::dirInfo("dirmngr-socket");
|
||||||
if ((err = ctx->setEngineFileName(dirmngrSocket.c_str()))) {
|
if ((err = ctx->setEngineFileName(dirmngrSocket.c_str()))) {
|
||||||
std::cerr << "Failed to set engine file name (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to set engine file name (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ((err = ctx->setEngineHomeDirectory(""))) {
|
if ((err = ctx->setEngineHomeDirectory(""))) {
|
||||||
std::cerr << "Failed to set engine home directory (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to set engine home directory (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to connect to dirmngr
|
// try to connect to dirmngr
|
||||||
err = ctx->assuanTransact("GETINFO version");
|
err = ctx->assuanTransact("GETINFO version");
|
||||||
if (err && err.code() != GPG_ERR_ASS_CONNECT_FAILED) {
|
if (err && err.code() != GPG_ERR_ASS_CONNECT_FAILED) {
|
||||||
std::cerr << "Failed to start assuan transaction (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to start assuan transaction (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (err.code() == GPG_ERR_ASS_CONNECT_FAILED) {
|
if (err.code() == GPG_ERR_ASS_CONNECT_FAILED) {
|
||||||
std::cerr << "Starting dirmngr ...\n";
|
std::cerr << "Starting dirmngr ...\n";
|
||||||
auto spawnCtx = std::unique_ptr<Context>{Context::createForEngine(SpawnEngine, &err)};
|
auto spawnCtx = std::unique_ptr<Context>{Context::createForEngine(SpawnEngine, &err)};
|
||||||
if (!spawnCtx) {
|
if (!spawnCtx) {
|
||||||
std::cerr << "Failed to get context for spawn engine (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to get context for spawn engine (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ main (int argc, char **argv)
|
|||||||
ignoreIO, ignoreIO, ignoreIO,
|
ignoreIO, ignoreIO, ignoreIO,
|
||||||
Context::SpawnDetached);
|
Context::SpawnDetached);
|
||||||
if (err) {
|
if (err) {
|
||||||
std::cerr << "Failed to start dirmngr (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to start dirmngr (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ main (int argc, char **argv)
|
|||||||
const auto cmd = std::string{"WKD_GET "} + email;
|
const auto cmd = std::string{"WKD_GET "} + email;
|
||||||
err = ctx->assuanTransact(cmd.c_str());
|
err = ctx->assuanTransact(cmd.c_str());
|
||||||
if (err && err.code() != GPG_ERR_NO_NAME && err.code() != GPG_ERR_NO_DATA) {
|
if (err && err.code() != GPG_ERR_NO_NAME && err.code() != GPG_ERR_NO_DATA) {
|
||||||
std::cerr << "Error: WKD_GET returned " << err.asString() << "\n";
|
std::cerr << "Error: WKD_GET returned " << err.asStdString() << "\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ To use QGpgME first you need to obtain a Protocol class
|
|||||||
either for CMS (S/MIME) or OpenPGP. This Protocol class
|
either for CMS (S/MIME) or OpenPGP. This Protocol class
|
||||||
can then be used to create a Job.
|
can then be used to create a Job.
|
||||||
|
|
||||||
Each Job can be started asynchronusly and emits a result
|
Each Job can be started asynchronously and emits a result
|
||||||
signal when done. The jobs are deleted automatically
|
signal when done. The jobs are deleted automatically
|
||||||
with QObject::deleteLater so they can be started without
|
with QObject::deleteLater so they can be started without
|
||||||
result handlers.
|
result handlers.
|
||||||
@ -53,7 +53,7 @@ in the result signal.
|
|||||||
Jobs also provide progress signal whenever GnuPG emits
|
Jobs also provide progress signal whenever GnuPG emits
|
||||||
a progress status line.
|
a progress status line.
|
||||||
|
|
||||||
Most jobs also provide a way synchronusly execute them.
|
Most jobs also provide a way synchronously execute them.
|
||||||
Please not that synchronous use does not cause the autodeletion
|
Please not that synchronous use does not cause the autodeletion
|
||||||
to take place so you have to manually delete them.
|
to take place so you have to manually delete them.
|
||||||
|
|
||||||
|
@ -20,11 +20,12 @@
|
|||||||
# 02111-1307, USA
|
# 02111-1307, USA
|
||||||
|
|
||||||
if WANT_QT5
|
if WANT_QT5
|
||||||
lib_LTLIBRARIES = libqgpgme.la
|
libqgpgme_la = libqgpgme.la
|
||||||
endif
|
endif
|
||||||
if WANT_QT6
|
if WANT_QT6
|
||||||
lib_LTLIBRARIES = libqgpgmeqt6.la
|
libqgpgmeqt6_la = libqgpgmeqt6.la
|
||||||
endif
|
endif
|
||||||
|
lib_LTLIBRARIES = $(libqgpgme_la) $(libqgpgmeqt6_la)
|
||||||
|
|
||||||
EXTRA_DIST = QGpgmeConfig.cmake.in.in QGpgmeConfigVersion.cmake.in \
|
EXTRA_DIST = QGpgmeConfig.cmake.in.in QGpgmeConfigVersion.cmake.in \
|
||||||
qgpgme_debug.h qgpgme_version.h.in \
|
qgpgme_debug.h qgpgme_version.h.in \
|
||||||
@ -319,33 +320,84 @@ qgpgme_moc_sources = \
|
|||||||
gpgcardjob.moc \
|
gpgcardjob.moc \
|
||||||
qgpgmegpgcardjob.moc
|
qgpgmegpgcardjob.moc
|
||||||
|
|
||||||
qgpgmeincludedir = $(includedir)/qgpgme
|
if WANT_QT5
|
||||||
qgpgmeinclude_HEADERS = $(qgpgme_headers)
|
includeprefix5 = qgpgme-qt5
|
||||||
camelcaseincludedir = $(includedir)/QGpgME
|
qgpgme5includedir = $(includedir)/$(includeprefix5)/qgpgme
|
||||||
camelcaseinclude_HEADERS = $(camelcase_headers)
|
qgpgme5include_HEADERS = $(qgpgme_headers)
|
||||||
nodist_qgpgmeinclude_HEADERS = qgpgme_version.h
|
nodist_qgpgme5include_HEADERS = qgpgme_version.h
|
||||||
|
camelcase5includedir = $(includedir)/$(includeprefix5)/QGpgME
|
||||||
|
nodist_camelcase5include_HEADERS = $(camelcase_headers)
|
||||||
|
endif
|
||||||
|
if WANT_QT6
|
||||||
|
includeprefix6 = qgpgme-qt6
|
||||||
|
qgpgme6includedir = $(includedir)/$(includeprefix6)/qgpgme
|
||||||
|
qgpgme6include_HEADERS = $(qgpgme_headers)
|
||||||
|
nodist_qgpgme6include_HEADERS = qgpgme_version.h
|
||||||
|
camelcase6includedir = $(includedir)/$(includeprefix6)/QGpgME
|
||||||
|
nodist_camelcase6include_HEADERS = $(camelcase_headers)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# generate the moc files in two steps:
|
||||||
|
# 1. generate Qt 5/6-specific moc files in builddir with extension .moc5/.moc6;
|
||||||
|
# this ensures correct dependencies on the source files
|
||||||
|
# 2. generate forwarding headers in subfolders moc5/moc6 with extension .moc;
|
||||||
|
# this ensures that the "foo.moc" includes in the source files work and
|
||||||
|
# include the correct version of the generated moc files for Qt 5/6
|
||||||
|
# GNU make's pattern rules would make this easier, but we don't want to use them
|
||||||
|
if WANT_QT5
|
||||||
|
moc5_dir = moc5
|
||||||
|
qgpgme_moc5_sources = $(qgpgme_moc_sources:%.moc=%.moc5)
|
||||||
|
qgpgme_moc5_forward_headers = $(qgpgme_moc_sources:%=$(moc5_dir)/%)
|
||||||
|
|
||||||
|
.h.moc5:
|
||||||
|
$(MOC5) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
|
||||||
|
|
||||||
|
$(moc5_dir):
|
||||||
|
mkdir $(moc5_dir)
|
||||||
|
|
||||||
|
$(qgpgme_moc5_forward_headers): Makefile.am | $(moc5_dir)
|
||||||
|
echo "#include \"../$(notdir $@)5\"" > "$@"
|
||||||
|
endif
|
||||||
|
if WANT_QT6
|
||||||
|
moc6_dir = moc6
|
||||||
|
qgpgme_moc6_sources = $(qgpgme_moc_sources:%.moc=%.moc6)
|
||||||
|
qgpgme_moc6_forward_headers = $(qgpgme_moc_sources:%=$(moc6_dir)/%)
|
||||||
|
|
||||||
|
.h.moc6:
|
||||||
|
$(MOC6) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
|
||||||
|
|
||||||
|
$(moc6_dir):
|
||||||
|
mkdir $(moc6_dir)
|
||||||
|
|
||||||
|
$(qgpgme_moc6_forward_headers): Makefile.am | $(moc6_dir)
|
||||||
|
echo "#include \"../$(notdir $@)6\"" > "$@"
|
||||||
|
endif
|
||||||
|
|
||||||
if WANT_QT5
|
if WANT_QT5
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
|
libqgpgme_la_CPPFLAGS = -I./moc5 -I$(top_builddir)/lang/cpp/src -I$(top_builddir)/src \
|
||||||
@GPGME_QT5_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
|
@GPGME_QT5_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
|
||||||
-DBUILDING_QGPGME -Wsuggest-override \
|
-DBUILDING_QGPGME -Wsuggest-override \
|
||||||
-Wzero-as-null-pointer-constant
|
-Wzero-as-null-pointer-constant
|
||||||
|
|
||||||
libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers)
|
libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers)
|
||||||
|
|
||||||
|
nodist_libqgpgme_la_SOURCES = $(qgpgme_moc5_sources) $(qgpgme_moc5_forward_headers)
|
||||||
|
|
||||||
libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \
|
libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \
|
||||||
@LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT5_LIBS@
|
@LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT5_LIBS@
|
||||||
libqgpgme_la_LDFLAGS = -no-undefined -version-info \
|
libqgpgme_la_LDFLAGS = -no-undefined -version-info \
|
||||||
@LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@
|
@LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@
|
||||||
endif
|
endif
|
||||||
if WANT_QT6
|
if WANT_QT6
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
|
libqgpgmeqt6_la_CPPFLAGS = -I./moc6 -I$(top_builddir)/lang/cpp/src -I$(top_builddir)/src \
|
||||||
@GPGME_QT6_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
|
@GPGME_QT6_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
|
||||||
-DBUILDING_QGPGME -Wsuggest-override \
|
-DBUILDING_QGPGME -Wsuggest-override \
|
||||||
-Wzero-as-null-pointer-constant
|
-Wzero-as-null-pointer-constant
|
||||||
|
|
||||||
libqgpgmeqt6_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers)
|
libqgpgmeqt6_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers)
|
||||||
|
|
||||||
|
nodist_libqgpgmeqt6_la_SOURCES = $(qgpgme_moc6_sources) $(qgpgme_moc6_forward_headers)
|
||||||
|
|
||||||
libqgpgmeqt6_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \
|
libqgpgmeqt6_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \
|
||||||
@LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT6_LIBS@
|
@LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT6_LIBS@
|
||||||
libqgpgmeqt6_la_LDFLAGS = -no-undefined -version-info \
|
libqgpgmeqt6_la_LDFLAGS = -no-undefined -version-info \
|
||||||
@ -363,12 +415,12 @@ if HAVE_W32_SYSTEM
|
|||||||
QGpgmeConfig.cmake: QGpgmeConfig-w32.cmake.in
|
QGpgmeConfig.cmake: QGpgmeConfig-w32.cmake.in
|
||||||
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
||||||
sed -e 's|[@]resolved_libdir@|$(libdir)|g' | \
|
sed -e 's|[@]resolved_libdir@|$(libdir)|g' | \
|
||||||
sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
|
sed -e 's|[@]resolved_includedir@|$(includedir)/$(includeprefix5)|g' > $@
|
||||||
else
|
else
|
||||||
QGpgmeConfig.cmake: QGpgmeConfig.cmake.in
|
QGpgmeConfig.cmake: QGpgmeConfig.cmake.in
|
||||||
sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
|
sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
|
||||||
sed -e 's|[@]libsuffix@|$(libsuffix)|g' | \
|
sed -e 's|[@]libsuffix@|$(libsuffix)|g' | \
|
||||||
sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
|
sed -e 's|[@]resolved_includedir@|$(includedir)/$(includeprefix5)|g' > $@
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if WANT_QT6
|
if WANT_QT6
|
||||||
@ -376,12 +428,12 @@ if HAVE_W32_SYSTEM
|
|||||||
QGpgmeQt6Config.cmake: QGpgmeQt6Config-w32.cmake.in
|
QGpgmeQt6Config.cmake: QGpgmeQt6Config-w32.cmake.in
|
||||||
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
||||||
sed -e 's|[@]resolved_libdir@|$(libdir)|g' | \
|
sed -e 's|[@]resolved_libdir@|$(libdir)|g' | \
|
||||||
sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
|
sed -e 's|[@]resolved_includedir@|$(includedir)/$(includeprefix6)|g' > $@
|
||||||
else
|
else
|
||||||
QGpgmeQt6Config.cmake: QGpgmeQt6Config.cmake.in
|
QGpgmeQt6Config.cmake: QGpgmeQt6Config.cmake.in
|
||||||
sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
|
sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
|
||||||
sed -e 's|[@]libsuffix@|$(libsuffix)|g' | \
|
sed -e 's|[@]libsuffix@|$(libsuffix)|g' | \
|
||||||
sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
|
sed -e 's|[@]resolved_includedir@|$(includedir)/$(includeprefix6)|g' > $@
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -391,50 +443,65 @@ $(camelcase_headers): Makefile.am
|
|||||||
echo ".h\"" >> "$@"
|
echo ".h\"" >> "$@"
|
||||||
|
|
||||||
if WANT_QT5
|
if WANT_QT5
|
||||||
install-cmake-files: QGpgmeConfig.cmake QGpgmeConfigVersion.cmake
|
install-cmake-files-qt5: QGpgmeConfig.cmake QGpgmeConfigVersion.cmake
|
||||||
-$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgme
|
-$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgme
|
||||||
$(INSTALL) -m 644 QGpgmeConfig.cmake \
|
$(INSTALL) -m 644 QGpgmeConfig.cmake \
|
||||||
$(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake
|
$(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake
|
||||||
$(INSTALL) -m 644 QGpgmeConfigVersion.cmake \
|
$(INSTALL) -m 644 QGpgmeConfigVersion.cmake \
|
||||||
$(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake
|
$(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake
|
||||||
|
install_cmake_files_qt5 = install-cmake-files-qt5
|
||||||
|
|
||||||
uninstall-cmake-files:
|
uninstall-cmake-files-qt5:
|
||||||
-rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake
|
-rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake
|
||||||
-rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake
|
-rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake
|
||||||
-rmdir $(DESTDIR)$(libdir)/cmake/QGpgme/
|
-rmdir $(DESTDIR)$(libdir)/cmake/QGpgme/
|
||||||
|
uninstall_cmake_files_qt5 = uninstall-cmake-files-qt5
|
||||||
|
|
||||||
|
uninstall-include-dirs-qt5:
|
||||||
|
-rmdir $(DESTDIR)$(qgpgme5includedir)
|
||||||
|
-rmdir $(DESTDIR)$(camelcase5includedir)
|
||||||
|
-rmdir $(DESTDIR)$(includedir)/$(includeprefix5)
|
||||||
|
uninstall_include_dirs_qt5 = uninstall-include-dirs-qt5
|
||||||
endif
|
endif
|
||||||
if WANT_QT6
|
if WANT_QT6
|
||||||
install-cmake-files: QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake
|
install-cmake-files-qt6: QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake
|
||||||
-$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgmeQt6
|
-$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgmeQt6
|
||||||
$(INSTALL) -m 644 QGpgmeQt6Config.cmake \
|
$(INSTALL) -m 644 QGpgmeQt6Config.cmake \
|
||||||
$(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6Config.cmake
|
$(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6Config.cmake
|
||||||
$(INSTALL) -m 644 QGpgmeQt6ConfigVersion.cmake \
|
$(INSTALL) -m 644 QGpgmeQt6ConfigVersion.cmake \
|
||||||
$(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6ConfigVersion.cmake
|
$(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6ConfigVersion.cmake
|
||||||
|
install_cmake_files_qt6 = install-cmake-files-qt6
|
||||||
|
|
||||||
uninstall-cmake-files:
|
uninstall-cmake-files-qt6:
|
||||||
-rm $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6ConfigVersion.cmake
|
-rm $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6ConfigVersion.cmake
|
||||||
-rm $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6Config.cmake
|
-rm $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6Config.cmake
|
||||||
-rmdir $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/
|
-rmdir $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/
|
||||||
|
uninstall_cmake_files_qt6 = uninstall-cmake-files-qt6
|
||||||
|
|
||||||
|
uninstall-include-dirs-qt6:
|
||||||
|
-rmdir $(DESTDIR)$(qgpgme6includedir)
|
||||||
|
-rmdir $(DESTDIR)$(camelcase6includedir)
|
||||||
|
-rmdir $(DESTDIR)$(includedir)/$(includeprefix6)
|
||||||
|
uninstall_include_dirs_qt6 = uninstall-include-dirs-qt6
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install-data-local: install-cmake-files
|
install-data-local: $(install_cmake_files_qt5) $(install_cmake_files_qt6)
|
||||||
|
|
||||||
uninstall-local: uninstall-cmake-files
|
uninstall-hook: $(uninstall_cmake_files_qt5) $(uninstall_cmake_files_qt6) \
|
||||||
|
$(uninstall_include_dirs_qt5) $(uninstall_include_dirs_qt6)
|
||||||
|
|
||||||
BUILT_SOURCES = $(qgpgme_moc_sources) $(camelcase_headers)
|
BUILT_SOURCES = $(qgpgme_moc5_sources) $(qgpgme_moc5_forward_headers) \
|
||||||
|
$(qgpgme_moc6_sources) $(qgpgme_moc6_forward_headers) \
|
||||||
|
$(camelcase_headers)
|
||||||
|
|
||||||
CLEANFILES = $(qgpgme_moc_sources) $(camelcase_headers) QGpgmeConfig.cmake \
|
CLEANFILES = $(qgpgme_moc5_sources) $(qgpgme_moc5_forward_headers) \
|
||||||
|
$(qgpgme_moc6_sources) $(qgpgme_moc6_forward_headers) \
|
||||||
|
$(camelcase_headers) QGpgmeConfig.cmake \
|
||||||
qgpgme_version.h QGpgmeConfig.cmake.in \
|
qgpgme_version.h QGpgmeConfig.cmake.in \
|
||||||
QGpgmeConfig-w32.cmake.in QGpgmeConfigVersion.cmake \
|
QGpgmeConfig-w32.cmake.in QGpgmeConfigVersion.cmake \
|
||||||
QGpgmeQt6Config.cmake.in QGpgmeQt6Config-w32.cmake.in \
|
QGpgmeQt6Config.cmake.in QGpgmeQt6Config-w32.cmake.in \
|
||||||
QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake
|
QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake
|
||||||
|
|
||||||
if WANT_QT5
|
clean-local:
|
||||||
nodist_libqgpgme_la_SOURCES = $(qgpgme_moc_sources)
|
-test -z "$(moc5_dir)" || rm -rf $(moc5_dir)
|
||||||
endif
|
-test -z "$(moc6_dir)" || rm -rf $(moc6_dir)
|
||||||
if WANT_QT6
|
|
||||||
nodist_libqgpgmeqt6_la_SOURCES = $(qgpgme_moc_sources)
|
|
||||||
endif
|
|
||||||
|
|
||||||
.h.moc:
|
|
||||||
$(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "changeexpiryjob.h"
|
#include "changeexpiryjob.h"
|
||||||
#include "changeexpiryjob_p.h"
|
#include "changeexpiryjob_p.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
|
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
|
@ -37,11 +37,7 @@
|
|||||||
|
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -37,11 +37,7 @@
|
|||||||
|
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include <dataprovider.h>
|
#include <dataprovider.h>
|
||||||
|
|
||||||
#include <error.h>
|
#include <gpgme++/error.h>
|
||||||
|
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
@ -26,11 +26,7 @@
|
|||||||
|
|
||||||
#include "qgpgme_export.h"
|
#include "qgpgme_export.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
#include <interfaces/dataprovider.h>
|
|
||||||
#else
|
|
||||||
#include <gpgme++/interfaces/dataprovider.h>
|
#include <gpgme++/interfaces/dataprovider.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "error.h"
|
#include <gpgme++/error.h>
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@ -44,9 +44,9 @@ QDebug operator<<(QDebug debug, const GpgME::Error &err)
|
|||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// On Windows, we tell libgpg-error to return (translated) error messages as UTF-8
|
// On Windows, we tell libgpg-error to return (translated) error messages as UTF-8
|
||||||
const auto errAsString = QString::fromUtf8(err.asString());
|
const auto errAsString = QString::fromStdString(err.asStdString());
|
||||||
#else
|
#else
|
||||||
const auto errAsString = QString::fromLocal8Bit(err.asString());
|
const auto errAsString = QString::fromLocal8Bit(err.asStdString().c_str());
|
||||||
#endif
|
#endif
|
||||||
const bool oldSetting = debug.autoInsertSpaces();
|
const bool oldSetting = debug.autoInsertSpaces();
|
||||||
debug.nospace() << errAsString << " (code: " << err.code() << ", source: " << err.source() << ")";
|
debug.nospace() << errAsString << " (code: " << err.code() << ", source: " << err.source() << ")";
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "decryptverifyarchivejob.h"
|
#include "decryptverifyarchivejob.h"
|
||||||
#include "decryptverifyarchivejob_p.h"
|
#include "decryptverifyarchivejob_p.h"
|
||||||
|
|
||||||
#include <engineinfo.h>
|
#include <gpgme++/engineinfo.h>
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
|
|
||||||
|
@ -36,11 +36,7 @@
|
|||||||
|
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "context.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/context.h>
|
#include <gpgme++/context.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace GpgME
|
namespace GpgME
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "encryptarchivejob.h"
|
#include "encryptarchivejob.h"
|
||||||
#include "encryptarchivejob_p.h"
|
#include "encryptarchivejob_p.h"
|
||||||
|
|
||||||
#include <engineinfo.h>
|
#include <gpgme++/engineinfo.h>
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
|
|
||||||
|
@ -36,11 +36,7 @@
|
|||||||
|
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "context.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/context.h>
|
#include <gpgme++/context.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace GpgME
|
namespace GpgME
|
||||||
{
|
{
|
||||||
|
@ -38,16 +38,12 @@
|
|||||||
#define __KLEO_ENCRYPTJOB_H__
|
#define __KLEO_ENCRYPTJOB_H__
|
||||||
|
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "context.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/context.h>
|
#include <gpgme++/context.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
class QByteArray;
|
class QByteArray;
|
||||||
class QIODevice;
|
class QIODevice;
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
#include "job_p.h"
|
#include "job_p.h"
|
||||||
|
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
#include <key.h>
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include <error.h>
|
#include <gpgme++/error.h>
|
||||||
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
|
@ -36,11 +36,7 @@
|
|||||||
|
|
||||||
#include "qgpgme_export.h"
|
#include "qgpgme_export.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
#include <interfaces/dataprovider.h>
|
|
||||||
#else
|
|
||||||
#include <gpgme++/interfaces/dataprovider.h>
|
#include <gpgme++/interfaces/dataprovider.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -39,11 +39,7 @@
|
|||||||
#include "keylistjob.h"
|
#include "keylistjob.h"
|
||||||
#include "cryptobackend.h"
|
#include "cryptobackend.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "keylistresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/keylistresult.h>
|
#include <gpgme++/keylistresult.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "importjob.h"
|
#include "importjob.h"
|
||||||
#include "importjob_p.h"
|
#include "importjob_p.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
|
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
@ -55,6 +55,18 @@ QString QGpgME::ImportJob::importFilter() const
|
|||||||
return d->m_importFilter;
|
return d->m_importFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QGpgME::ImportJob::setImportOptions(const QStringList &options)
|
||||||
|
{
|
||||||
|
const auto d = jobPrivate<ImportJobPrivate>(this);
|
||||||
|
d->m_importOptions = options;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList QGpgME::ImportJob::importOptions() const
|
||||||
|
{
|
||||||
|
const auto d = jobPrivate<ImportJobPrivate>(this);
|
||||||
|
return d->m_importOptions;
|
||||||
|
}
|
||||||
|
|
||||||
void ImportJob::setKeyOrigin(GpgME::Key::Origin origin, const QString &url)
|
void ImportJob::setKeyOrigin(GpgME::Key::Origin origin, const QString &url)
|
||||||
{
|
{
|
||||||
const auto d = jobPrivate<ImportJobPrivate>(this);
|
const auto d = jobPrivate<ImportJobPrivate>(this);
|
||||||
|
@ -40,11 +40,7 @@
|
|||||||
#include "abstractimportjob.h"
|
#include "abstractimportjob.h"
|
||||||
#include "qgpgme_export.h"
|
#include "qgpgme_export.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include <key.h>
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace GpgME
|
namespace GpgME
|
||||||
{
|
{
|
||||||
@ -79,6 +75,9 @@ public:
|
|||||||
void setImportFilter(const QString &filter);
|
void setImportFilter(const QString &filter);
|
||||||
QString importFilter() const;
|
QString importFilter() const;
|
||||||
|
|
||||||
|
void setImportOptions(const QStringList &options);
|
||||||
|
QStringList importOptions() const;
|
||||||
|
|
||||||
void setKeyOrigin(GpgME::Key::Origin origin, const QString &url = {});
|
void setKeyOrigin(GpgME::Key::Origin origin, const QString &url = {});
|
||||||
GpgME::Key::Origin keyOrigin() const;
|
GpgME::Key::Origin keyOrigin() const;
|
||||||
QString keyOriginUrl() const;
|
QString keyOriginUrl() const;
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include "job_p.h"
|
#include "job_p.h"
|
||||||
|
|
||||||
#include <key.h>
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
@ -44,6 +44,7 @@ namespace QGpgME
|
|||||||
struct ImportJobPrivate : public JobPrivate
|
struct ImportJobPrivate : public JobPrivate
|
||||||
{
|
{
|
||||||
QString m_importFilter;
|
QString m_importFilter;
|
||||||
|
QStringList m_importOptions;
|
||||||
GpgME::Key::Origin m_keyOrigin = GpgME::Key::OriginUnknown;
|
GpgME::Key::Origin m_keyOrigin = GpgME::Key::OriginUnknown;
|
||||||
QString m_keyOriginUrl;
|
QString m_keyOriginUrl;
|
||||||
};
|
};
|
||||||
|
@ -41,11 +41,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "error.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/error.h>
|
#include <gpgme++/error.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
|
@ -37,11 +37,7 @@
|
|||||||
|
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace GpgME
|
namespace GpgME
|
||||||
{
|
{
|
||||||
|
@ -38,11 +38,7 @@
|
|||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "qgpgme_export.h"
|
#include "qgpgme_export.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
|
@ -40,11 +40,7 @@
|
|||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "qgpgme_export.h"
|
#include "qgpgme_export.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@
|
|||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
#include "deletejob.h"
|
#include "deletejob.h"
|
||||||
|
|
||||||
#include <key.h>
|
#include <gpgme++/key.h>
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
|
@ -41,10 +41,10 @@
|
|||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
#include "gpgaddexistingsubkeyeditinteractor.h"
|
#include <gpgme++/gpgaddexistingsubkeyeditinteractor.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <gpg-error.h>
|
#include <gpg-error.h>
|
||||||
|
|
||||||
|
@ -40,10 +40,10 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
#include "gpgadduserideditinteractor.h"
|
#include <gpgme++/gpgadduserideditinteractor.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -40,8 +40,8 @@
|
|||||||
|
|
||||||
#include "qgpgmegpgcardjob.h"
|
#include "qgpgmegpgcardjob.h"
|
||||||
|
|
||||||
#include "error.h"
|
#include <gpgme++/error.h>
|
||||||
#include "engineinfo.h"
|
#include <gpgme++/engineinfo.h>
|
||||||
|
|
||||||
#include "protocol_p.h"
|
#include "protocol_p.h"
|
||||||
|
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
|
|
||||||
#include "changeexpiryjob_p.h"
|
#include "changeexpiryjob_p.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
|
@ -40,10 +40,10 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
#include "gpgsetownertrusteditinteractor.h"
|
#include <gpgme++/gpgsetownertrusteditinteractor.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -40,9 +40,9 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -40,9 +40,9 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "decryptionresult.h"
|
#include <gpgme++/decryptionresult.h>
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
|
|
||||||
|
@ -39,11 +39,7 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "decryptionresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/decryptionresult.h>
|
#include <gpgme++/decryptionresult.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#include <decryptionresult.h>
|
#include <gpgme++/decryptionresult.h>
|
||||||
#include <verificationresult.h>
|
#include <gpgme++/verificationresult.h>
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -39,13 +39,14 @@
|
|||||||
#include "qgpgmedecryptverifyjob.h"
|
#include "qgpgmedecryptverifyjob.h"
|
||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
#include "debug.h"
|
||||||
#include "decryptverifyjob_p.h"
|
#include "decryptverifyjob_p.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
#include <decryptionresult.h>
|
#include <gpgme++/decryptionresult.h>
|
||||||
#include <verificationresult.h>
|
#include <gpgme++/verificationresult.h>
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "qgpgme_debug.h"
|
#include "qgpgme_debug.h"
|
||||||
@ -118,7 +119,7 @@ static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread
|
|||||||
const std::pair<DecryptionResult, VerificationResult> res = ctx->decryptAndVerify(indata, outdata);
|
const std::pair<DecryptionResult, VerificationResult> res = ctx->decryptAndVerify(indata, outdata);
|
||||||
Error ae;
|
Error ae;
|
||||||
const QString log = _detail::audit_log_as_html(ctx, ae);
|
const QString log = _detail::audit_log_as_html(ctx, ae);
|
||||||
qCDebug(QGPGME_LOG) << __func__ << "- End no plainText. Error:" << ae.asString();
|
qCDebug(QGPGME_LOG) << __func__ << "- End no plainText. Error:" << ae;
|
||||||
return std::make_tuple(res.first, res.second, out.data(), log, ae);
|
return std::make_tuple(res.first, res.second, out.data(), log, ae);
|
||||||
} else {
|
} else {
|
||||||
QGpgME::QIODeviceDataProvider out(plainText);
|
QGpgME::QIODeviceDataProvider out(plainText);
|
||||||
@ -127,7 +128,7 @@ static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread
|
|||||||
const std::pair<DecryptionResult, VerificationResult> res = ctx->decryptAndVerify(indata, outdata);
|
const std::pair<DecryptionResult, VerificationResult> res = ctx->decryptAndVerify(indata, outdata);
|
||||||
Error ae;
|
Error ae;
|
||||||
const QString log = _detail::audit_log_as_html(ctx, ae);
|
const QString log = _detail::audit_log_as_html(ctx, ae);
|
||||||
qCDebug(QGPGME_LOG) << __func__ << "- End plainText. Error:" << ae.asString();
|
qCDebug(QGPGME_LOG) << __func__ << "- End plainText. Error:" << ae;
|
||||||
return std::make_tuple(res.first, res.second, QByteArray(), log, ae);
|
return std::make_tuple(res.first, res.second, QByteArray(), log, ae);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,16 +39,8 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "decryptionresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/decryptionresult.h>
|
#include <gpgme++/decryptionresult.h>
|
||||||
#endif
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "verificationresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/verificationresult.h>
|
#include <gpgme++/verificationresult.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
|
|
||||||
#include "qgpgmedeletejob.h"
|
#include "qgpgmedeletejob.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#include <encryptionresult.h>
|
#include <gpgme++/encryptionresult.h>
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -44,9 +44,9 @@
|
|||||||
#include "encryptjob_p.h"
|
#include "encryptjob_p.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
#include <encryptionresult.h>
|
#include <gpgme++/encryptionresult.h>
|
||||||
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
@ -39,16 +39,8 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "encryptionresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/encryptionresult.h>
|
#include <gpgme++/encryptionresult.h>
|
||||||
#endif
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -42,9 +42,9 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
@ -40,9 +40,9 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
@ -39,11 +39,7 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "importresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/importresult.h>
|
#include <gpgme++/importresult.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -44,9 +44,9 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
#include <key.h>
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
@ -106,11 +106,15 @@ static const char *originToString(Key::Origin origin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static QGpgMEImportJob::result_type import_qba(Context *ctx, const QByteArray &certData, const QString &importFilter,
|
static QGpgMEImportJob::result_type import_qba(Context *ctx, const QByteArray &certData, const QString &importFilter,
|
||||||
Key::Origin keyOrigin, const QString &keyOriginUrl)
|
const QStringList &importOptions, Key::Origin keyOrigin,
|
||||||
|
const QString &keyOriginUrl)
|
||||||
{
|
{
|
||||||
if (!importFilter.isEmpty()) {
|
if (!importFilter.isEmpty()) {
|
||||||
ctx->setFlag("import-filter", importFilter.toStdString().c_str());
|
ctx->setFlag("import-filter", importFilter.toStdString().c_str());
|
||||||
}
|
}
|
||||||
|
if (!importOptions.empty()) {
|
||||||
|
ctx->setFlag("import-options", importOptions.join(QLatin1Char{','}).toStdString().c_str());
|
||||||
|
}
|
||||||
if (keyOrigin != Key::OriginUnknown) {
|
if (keyOrigin != Key::OriginUnknown) {
|
||||||
if (const auto origin = originToString(keyOrigin)) {
|
if (const auto origin = originToString(keyOrigin)) {
|
||||||
std::string value{origin};
|
std::string value{origin};
|
||||||
@ -149,19 +153,19 @@ static QGpgMEImportJob::result_type import_qba(Context *ctx, const QByteArray &c
|
|||||||
|
|
||||||
Error QGpgMEImportJob::start(const QByteArray &certData)
|
Error QGpgMEImportJob::start(const QByteArray &certData)
|
||||||
{
|
{
|
||||||
run(std::bind(&import_qba, std::placeholders::_1, certData, importFilter(), keyOrigin(), keyOriginUrl()));
|
run(std::bind(&import_qba, std::placeholders::_1, certData, importFilter(), importOptions(), keyOrigin(), keyOriginUrl()));
|
||||||
return Error();
|
return Error();
|
||||||
}
|
}
|
||||||
|
|
||||||
GpgME::ImportResult QGpgME::QGpgMEImportJob::exec(const QByteArray &keyData)
|
GpgME::ImportResult QGpgME::QGpgMEImportJob::exec(const QByteArray &keyData)
|
||||||
{
|
{
|
||||||
const result_type r = import_qba(context(), keyData, importFilter(), keyOrigin(), keyOriginUrl());
|
const result_type r = import_qba(context(), keyData, importFilter(), importOptions(), keyOrigin(), keyOriginUrl());
|
||||||
return std::get<0>(r);
|
return std::get<0>(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
Error QGpgMEImportJob::startLater(const QByteArray &certData)
|
Error QGpgMEImportJob::startLater(const QByteArray &certData)
|
||||||
{
|
{
|
||||||
setWorkerFunction(std::bind(&import_qba, std::placeholders::_1, certData, importFilter(), keyOrigin(), keyOriginUrl()));
|
setWorkerFunction(std::bind(&import_qba, std::placeholders::_1, certData, importFilter(), importOptions(), keyOrigin(), keyOriginUrl()));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,11 +41,7 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "importresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/importresult.h>
|
#include <gpgme++/importresult.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -39,13 +39,8 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "keylistresult.h"
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/keylistresult.h>
|
#include <gpgme++/keylistresult.h>
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -40,8 +40,8 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
@ -39,11 +39,7 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "keygenerationresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/keygenerationresult.h>
|
#include <gpgme++/keygenerationresult.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -38,9 +38,9 @@
|
|||||||
|
|
||||||
#include "qgpgmekeylistjob.h"
|
#include "qgpgmekeylistjob.h"
|
||||||
|
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "keylistresult.h"
|
#include <gpgme++/keylistresult.h>
|
||||||
#include <gpg-error.h>
|
#include <gpg-error.h>
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
@ -39,16 +39,8 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "keylistresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/keylistresult.h>
|
#include <gpgme++/keylistresult.h>
|
||||||
#endif
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -43,11 +43,11 @@
|
|||||||
#include "listallkeysjob_p.h"
|
#include "listallkeysjob_p.h"
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "engineinfo.h"
|
#include <gpgme++/engineinfo.h>
|
||||||
#include "global.h"
|
#include <gpgme++/global.h>
|
||||||
#include "keylistresult.h"
|
#include <gpgme++/keylistresult.h>
|
||||||
#include "qgpgme_debug.h"
|
#include "qgpgme_debug.h"
|
||||||
|
|
||||||
#include <gpg-error.h>
|
#include <gpg-error.h>
|
||||||
|
@ -39,16 +39,8 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "keylistresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/keylistresult.h>
|
#include <gpgme++/keylistresult.h>
|
||||||
#endif
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -45,8 +45,8 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
#include "global.h"
|
#include <gpgme++/global.h>
|
||||||
#include "error.h"
|
#include <gpgme++/error.h>
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -211,7 +211,7 @@ void QGpgMENewCryptoConfigComponent::sync(bool runtime)
|
|||||||
if (const Error err = m_component.save()) {
|
if (const Error err = m_component.save()) {
|
||||||
qCWarning(QGPGME_LOG) << ":"
|
qCWarning(QGPGME_LOG) << ":"
|
||||||
<< "Error from gpgconf while saving configuration: %1"
|
<< "Error from gpgconf while saving configuration: %1"
|
||||||
<< QString::fromLocal8Bit(err.asString());
|
<< err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,12 +42,7 @@
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "configuration.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/configuration.h>
|
#include <gpgme++/configuration.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
@ -37,8 +37,9 @@
|
|||||||
|
|
||||||
#include "qgpgmequickjob.h"
|
#include "qgpgmequickjob.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
|
@ -38,11 +38,7 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "importresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/importresult.h>
|
#include <gpgme++/importresult.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -44,8 +44,8 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "qgpgme_debug.h"
|
#include "qgpgme_debug.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include <key.h>
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QMetaObject>
|
#include <QMetaObject>
|
||||||
|
@ -36,11 +36,8 @@
|
|||||||
#define __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__
|
#define __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__
|
||||||
|
|
||||||
#include "refreshkeysjob.h"
|
#include "refreshkeysjob.h"
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#else
|
|
||||||
#include "gpgme++/context.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
#include <gpgrevokekeyeditinteractor.h>
|
#include <gpgme++/gpgrevokekeyeditinteractor.h>
|
||||||
#include <key.h>
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <gpg-error.h>
|
#include <gpg-error.h>
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include <engineinfo.h>
|
#include <gpgme++/engineinfo.h>
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#include <signingresult.h>
|
#include <gpgme++/signingresult.h>
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#include <encryptionresult.h>
|
#include <gpgme++/encryptionresult.h>
|
||||||
#include <signingresult.h>
|
#include <gpgme++/signingresult.h>
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -44,10 +44,10 @@
|
|||||||
#include "signencryptjob_p.h"
|
#include "signencryptjob_p.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
#include <exception.h>
|
#include <gpgme++/exception.h>
|
||||||
#include <key.h>
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
@ -39,21 +39,9 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "signingresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/signingresult.h>
|
#include <gpgme++/signingresult.h>
|
||||||
#endif
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "encryptionresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/encryptionresult.h>
|
#include <gpgme++/encryptionresult.h>
|
||||||
#endif
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@
|
|||||||
#include "signjob_p.h"
|
#include "signjob_p.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
#include <signingresult.h>
|
#include <gpgme++/signingresult.h>
|
||||||
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -170,7 +170,8 @@ static QGpgMESignJob::result_type sign_to_filename(Context *ctx,
|
|||||||
const std::vector<Key> &signers,
|
const std::vector<Key> &signers,
|
||||||
const QString &inputFilePath,
|
const QString &inputFilePath,
|
||||||
const QString &outputFilePath,
|
const QString &outputFilePath,
|
||||||
SignatureMode flags)
|
SignatureMode flags,
|
||||||
|
bool appendSignature)
|
||||||
{
|
{
|
||||||
Data indata;
|
Data indata;
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
@ -206,13 +207,42 @@ static QGpgMESignJob::result_type sign_to_filename(Context *ctx,
|
|||||||
flags = static_cast<SignatureMode>(flags | SignFile);
|
flags = static_cast<SignatureMode>(flags | SignFile);
|
||||||
const auto signingResult = ctx->sign(indata, outdata, flags);
|
const auto signingResult = ctx->sign(indata, outdata, flags);
|
||||||
|
|
||||||
if (!signingResult.error().code()) {
|
|
||||||
// the operation succeeded -> save the result under the requested file name
|
|
||||||
partFileGuard.commit();
|
|
||||||
}
|
|
||||||
|
|
||||||
Error ae;
|
Error ae;
|
||||||
const QString log = _detail::audit_log_as_html(ctx, ae);
|
const QString log = _detail::audit_log_as_html(ctx, ae);
|
||||||
|
|
||||||
|
if (!signingResult.error().code()) {
|
||||||
|
// the operation succeeded
|
||||||
|
const bool appendSignatureToExistingFile = appendSignature && (flags & Detached) && QFile::exists(outputFilePath);
|
||||||
|
if (appendSignatureToExistingFile) {
|
||||||
|
// append the result to the existing file
|
||||||
|
QFile newSignatureFile{partFileGuard.tempFileName()};
|
||||||
|
if (!newSignatureFile.open(QIODevice::ReadOnly)) {
|
||||||
|
qCDebug(QGPGME_LOG) << "Failed to open detached signature file" << newSignatureFile.fileName() << "(" << newSignatureFile.errorString() << ")";
|
||||||
|
return std::make_tuple(SigningResult{Error::fromCode(GPG_ERR_GENERAL)}, QByteArray{}, log, ae);
|
||||||
|
}
|
||||||
|
const QByteArray newSigData = newSignatureFile.readAll();
|
||||||
|
if (newSigData.isEmpty()) {
|
||||||
|
qCDebug(QGPGME_LOG) << "Failed to read detached signature from file" << newSignatureFile.fileName() << "(" << newSignatureFile.errorString() << ")";
|
||||||
|
return std::make_tuple(SigningResult{Error::fromCode(GPG_ERR_GENERAL)}, QByteArray{}, log, ae);
|
||||||
|
}
|
||||||
|
newSignatureFile.close();
|
||||||
|
|
||||||
|
QFile existingSignatureFile{outputFilePath};
|
||||||
|
if (!existingSignatureFile.open(QIODevice::WriteOnly | QIODevice::Append)) {
|
||||||
|
qCDebug(QGPGME_LOG) << "Failed to open existing detached signature file for appending" << existingSignatureFile.fileName() << "(" << existingSignatureFile.errorString() << ")";
|
||||||
|
return std::make_tuple(SigningResult{Error::fromCode(GPG_ERR_GENERAL)}, QByteArray{}, log, ae);
|
||||||
|
}
|
||||||
|
const auto bytesWritten = existingSignatureFile.write(newSigData);
|
||||||
|
if (bytesWritten != newSigData.size()) {
|
||||||
|
qCDebug(QGPGME_LOG) << "Failed to write new signature to existing detached signature file" << existingSignatureFile.fileName() << "(" << existingSignatureFile.errorString() << ")";
|
||||||
|
return std::make_tuple(SigningResult{Error::fromCode(GPG_ERR_GENERAL)}, QByteArray{}, log, ae);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// save the result under the requested file name
|
||||||
|
partFileGuard.commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return std::make_tuple(signingResult, QByteArray{}, log, ae);
|
return std::make_tuple(signingResult, QByteArray{}, log, ae);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,7 +271,7 @@ GpgME::Error QGpgMESignJobPrivate::startIt()
|
|||||||
}
|
}
|
||||||
|
|
||||||
q->run([=](Context *ctx) {
|
q->run([=](Context *ctx) {
|
||||||
return sign_to_filename(ctx, m_signers, m_inputFilePath, m_outputFilePath, m_signingFlags);
|
return sign_to_filename(ctx, m_signers, m_inputFilePath, m_outputFilePath, m_signingFlags, m_appendSignature);
|
||||||
});
|
});
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
|
@ -39,16 +39,8 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "signingresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/signingresult.h>
|
#include <gpgme++/signingresult.h>
|
||||||
#endif
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -43,9 +43,9 @@
|
|||||||
|
|
||||||
#include "dataprovider.h"
|
#include "dataprovider.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "data.h"
|
#include <gpgme++/data.h>
|
||||||
#include "gpgsignkeyeditinteractor.h"
|
#include <gpgme++/gpgsignkeyeditinteractor.h>
|
||||||
|
|
||||||
#include "qgpgme_debug.h"
|
#include "qgpgme_debug.h"
|
||||||
|
|
||||||
|
@ -35,9 +35,9 @@
|
|||||||
|
|
||||||
#include "qgpgmetofupolicyjob.h"
|
#include "qgpgmetofupolicyjob.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
#include "tofuinfo.h"
|
#include <gpgme++/tofuinfo.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
|
@ -44,9 +44,9 @@
|
|||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
#include <verificationresult.h>
|
#include <gpgme++/verificationresult.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
@ -39,11 +39,7 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "verificationresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/verificationresult.h>
|
#include <gpgme++/verificationresult.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -42,9 +42,9 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "verifyopaquejob_p.h"
|
#include "verifyopaquejob_p.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
#include <verificationresult.h>
|
#include <gpgme++/verificationresult.h>
|
||||||
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
@ -39,11 +39,7 @@
|
|||||||
|
|
||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "verificationresult.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/verificationresult.h>
|
#include <gpgme++/verificationresult.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -37,11 +37,12 @@
|
|||||||
|
|
||||||
#include "qgpgmewkdlookupjob.h"
|
#include "qgpgmewkdlookupjob.h"
|
||||||
|
|
||||||
|
#include "debug.h"
|
||||||
#include "qgpgme_debug.h"
|
#include "qgpgme_debug.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
#include <data.h>
|
#include <gpgme++/data.h>
|
||||||
#include <defaultassuantransaction.h>
|
#include <gpgme++/defaultassuantransaction.h>
|
||||||
|
|
||||||
#include <gpg-error.h>
|
#include <gpg-error.h>
|
||||||
|
|
||||||
@ -62,7 +63,7 @@ static GpgME::Error startDirmngr(Context *assuanCtx)
|
|||||||
|
|
||||||
auto spawnCtx = std::unique_ptr<Context>{Context::createForEngine(SpawnEngine, &err)};
|
auto spawnCtx = std::unique_ptr<Context>{Context::createForEngine(SpawnEngine, &err)};
|
||||||
if (err) {
|
if (err) {
|
||||||
qCDebug(QGPGME_LOG) << "Error: Failed to get context for spawn engine (" << err.asString() << ")";
|
qCDebug(QGPGME_LOG) << "Error: Failed to get context for spawn engine (" << err << ")";
|
||||||
}
|
}
|
||||||
const auto gpgconfProgram = GpgME::dirInfo("gpgconf-name");
|
const auto gpgconfProgram = GpgME::dirInfo("gpgconf-name");
|
||||||
// replace backslashes with forward slashes in homedir to work around bug T6833
|
// replace backslashes with forward slashes in homedir to work around bug T6833
|
||||||
@ -132,11 +133,11 @@ static GpgME::Error run_wkd_get(Context *ctx, const std::string &email)
|
|||||||
// no key for email is available via WKD or that the domain doesn't
|
// no key for email is available via WKD or that the domain doesn't
|
||||||
// support WKD or that the domain doesn't exist (on subsequent requests
|
// support WKD or that the domain doesn't exist (on subsequent requests
|
||||||
// using dirmngr's internal cache)
|
// using dirmngr's internal cache)
|
||||||
qCDebug(QGPGME_LOG) << "WKD_GET returned" << err.asString() << "; ignoring...";
|
qCDebug(QGPGME_LOG) << "WKD_GET returned" << err << "; ignoring...";
|
||||||
err = {};
|
err = {};
|
||||||
}
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
qCDebug(QGPGME_LOG) << "WKD_GET failed with" << err.asString();
|
qCDebug(QGPGME_LOG) << "WKD_GET failed with" << err;
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include "qgpgmekeylistjob.h"
|
#include "qgpgmekeylistjob.h"
|
||||||
#include "wkdrefreshjob_p.h"
|
#include "wkdrefreshjob_p.h"
|
||||||
|
|
||||||
#include <context.h>
|
#include <gpgme++/context.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include "threadedjobmixin.h"
|
#include "threadedjobmixin.h"
|
||||||
#include "wkdrefreshjob.h"
|
#include "wkdrefreshjob.h"
|
||||||
|
|
||||||
#include <importresult.h>
|
#include <gpgme++/importresult.h>
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
@ -35,8 +35,9 @@
|
|||||||
|
|
||||||
#include "qgpgmewkspublishjob.h"
|
#include "qgpgmewkspublishjob.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include <gpgme++/context.h>
|
||||||
#include "key.h"
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
@ -39,11 +39,7 @@
|
|||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "key.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/key.h>
|
#include <gpgme++/key.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
class QString;
|
class QString;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "signarchivejob.h"
|
#include "signarchivejob.h"
|
||||||
#include "signarchivejob_p.h"
|
#include "signarchivejob_p.h"
|
||||||
|
|
||||||
#include <engineinfo.h>
|
#include <gpgme++/engineinfo.h>
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
|
|
||||||
|
@ -36,11 +36,7 @@
|
|||||||
|
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "context.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/context.h>
|
#include <gpgme++/context.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace GpgME
|
namespace GpgME
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "signencryptarchivejob.h"
|
#include "signencryptarchivejob.h"
|
||||||
#include "signencryptarchivejob_p.h"
|
#include "signencryptarchivejob_p.h"
|
||||||
|
|
||||||
#include <engineinfo.h>
|
#include <gpgme++/engineinfo.h>
|
||||||
|
|
||||||
using namespace QGpgME;
|
using namespace QGpgME;
|
||||||
|
|
||||||
|
@ -36,11 +36,7 @@
|
|||||||
|
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "context.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/context.h>
|
#include <gpgme++/context.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace GpgME
|
namespace GpgME
|
||||||
{
|
{
|
||||||
|
@ -40,13 +40,8 @@
|
|||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "qgpgme_export.h"
|
#include "qgpgme_export.h"
|
||||||
|
|
||||||
#ifdef BUILDING_QGPGME
|
|
||||||
# include "global.h"
|
|
||||||
# include "context.h"
|
|
||||||
#else
|
|
||||||
#include <gpgme++/global.h>
|
#include <gpgme++/global.h>
|
||||||
#include <gpgme++/context.h>
|
#include <gpgme++/context.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include "job_p.h"
|
#include "job_p.h"
|
||||||
|
|
||||||
#include <key.h>
|
#include <gpgme++/key.h>
|
||||||
|
|
||||||
namespace QGpgME
|
namespace QGpgME
|
||||||
{
|
{
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user