This code was broken on ARM and other architectures where "char" is unsigned by
default.
First, it breaks with newer compilers with errors like:
.../src/qca_textfilter.cpp:314:2: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
Second, if the compiler would just allow this conversion then the unsigned char
would hold 255, which would not be sign extended when cast to an int later, so
all the checks "< 0" will never trigger, and so invalid input characters cannot
be detected.
REVIEW:128295
BUG:364495
The cmake find file was missing, but CoreFoundation being a system
framework, no need to search for it.
Update code to not use deprecated functions/data structure
CSSM_DATA and SecCertificateGetData have been deprecated since 10.7.
This patch uses SecCertificateCopyData which is the official
replacement.
Reviewed at https://git.reviewboard.kde.org/r/125800/
On Windows gpg uses ANSI codepage to output homedir and keyrings
paths. No way to output in utf-8. Gpg returns utf-8 strings output
only when --with-colons option is used.
When no keys 'gpg --list-keys' doesn't return path to keyring file.
Path is needest for watching to know when keys added or removed.
Use default keyrings path based on GnuPG home directory. This
directory gets with output 'gpg --version'. Line which starts with
'Home: ' contains GnuPG home directory. I believe it is correct
for GnuPG always and won't be changed in the future.
LibreSSL >= 2.3.0 removed support for SHA-0, so there's no EVP_sha
anymore.
Wikipedia says about SHA-0: "160-bit hash function published in 1993
under the name SHA. It was withdrawn shortly after publication due to
an undisclosed "significant flaw" and replaced by the slightly revised
version SHA-1.'
REVIEW: 125387
This fixes building with LibreSSL >= 2.3.0 which has removed support
for SSLv3 completely. As far as I know OpenSSL can be configured to
build without it, so it might be helpful there as well.
REVIEW: 125386
Currently qca links to the Carbon framework for building however the mac
specific code don't use any Carbon classes but CoreFoundation. This patch
aims to update the code and build script to link to the more generic
CoreFoundation framework which may also allow to build it on iOS (not
verified).
REVIEW: 121703
This solves a build failure with compilers such as GCC 4.2:
/usr/local/include/QtCrypto/qca_basic.h:598: error: comma at end of enumerator list
REVIEW: 122107
The previous code (present since the file was created) mixed different
checks that required different expansions:
* `if (ENV{foo})' will always evaluate to false even if $ENV{foo} is
set, and may even be a CMake bug.
* `if (EXISTS ...)' expects an actual string, not an variable that has
not been expanded.
It is not clear why the code expects QC_CERTSTORE_PATH to be an
environment variable instead of a regular variable passed to CMake in
the first place, but that can be changed in another commit.
REVIEW: 122062
It's not properly. Martin Klapetek is not QCA developer. So it's not
correct that he said "Ship it!".
Properly way
cmake -DQCA_SUFFIX=qt5 ...
and in CMakeLists.txt of your project.
find_package(Qca NAMES Qca-qt5)
This reverts commit c32bc6f1bc9befe5f89d3572eb28e0d591a2e3b2.
- if QT4_BUILD is not defined *and* Qt5Core is found build with soname
qca-qt5
- rename cmake package to reflect the suffix i.e. with a Qt5 build it is
find_package(Qca-qt5) rather than find_package(Qca)
- the imported cmake target also reflects suffix so "Qca-qt5" is the
cmake link target for qt5 and "Qca" for qt4 builds
this retains 100% compatibility with regular qca while also offering 100%
coinstallability of the qt5 build.
REVIEW: 121633
(this also fixes the flaky filewatch test that would fail for example on
ubuntu launchpad builds)
it can happen that (supposedly for filesystem reasons) there are two
changes signals arriving in the watcher code, by the time the first arrives
the file would however already be deleted, by the time the second arrives
it would thus notify of changes to a file that does not exist which is
silly and causes problems with the filewatchtest as it uses signal emission
counting to verify the behavior.
to prevent this problem from popping up there is an additional save guard
in the file_changed slot that will ignore a change if the path in question
doesn't exist AND there is no file being watched by the watcher.
REVIEW: 121588