Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package qtkeychain-qt5 for openSUSE:Factory checked in at 2021-12-13 20:41:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qtkeychain-qt5 (Old) and /work/SRC/openSUSE:Factory/.qtkeychain-qt5.new.2520 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qtkeychain-qt5" Mon Dec 13 20:41:40 2021 rev:11 rq:939587 version:0.13.2 Changes: -------- --- /work/SRC/openSUSE:Factory/qtkeychain-qt5/qtkeychain-qt5.changes 2021-01-10 19:46:37.174119490 +0100 +++ /work/SRC/openSUSE:Factory/.qtkeychain-qt5.new.2520/qtkeychain-qt5.changes 2021-12-13 20:45:49.720495606 +0100 @@ -1,0 +2,12 @@ +Fri Dec 10 16:55:43 UTC 2021 - Christophe Giboudeaux <[email protected]> + +- Update to 0.13.2 + * Linux: Require libsecret if not explicitly disabled + * Unify implementations for macOS and iOS + * CMake: lots of fixes + * KWallet: Fix deletion of entries + * CMake: Deprecate QTKEYCHAIN_STATIC in favor of + BUILD_SHARED_LIBS +- Drop the unneeded baselibs.conf. + +------------------------------------------------------------------- Old: ---- baselibs.conf qtkeychain-qt5-0.12.0.tar.gz New: ---- qtkeychain-qt5-0.13.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qtkeychain-qt5.spec ++++++ --- /var/tmp/diff_new_pack.J5Bitb/_old 2021-12-13 20:45:50.368495685 +0100 +++ /var/tmp/diff_new_pack.J5Bitb/_new 2021-12-13 20:45:50.376495686 +0100 @@ -16,16 +16,15 @@ # -%define lname libqt5keychain1 +%define sover 1 Name: qtkeychain-qt5 -Version: 0.12.0 +Version: 0.13.2 Release: 0 Summary: A password store library License: BSD-2-Clause Group: Development/Libraries/C and C++ URL: https://github.com/frankosterfeld/qtkeychain Source: https://github.com/frankosterfeld/qtkeychain/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -Source1: baselibs.conf BuildRequires: cmake BuildRequires: pkgconfig BuildRequires: cmake(Qt5Core) @@ -36,25 +35,25 @@ %description qtkeychain can be used to store passwords. -%package -n %{lname} +%package -n libqt5keychain%{sover} Summary: A password store library Group: System/Libraries -Recommends: %{lname}-lang +Recommends: libqt5keychain%{sover}-lang -%description -n %{lname} +%description -n libqt5keychain%{sover} qtkeychain can be used to store passwords. %package devel Summary: Development files for the qtkeychain library Group: Development/Libraries/C and C++ -Requires: %{lname} = %{version} +Requires: libqt5keychain%{sover} = %{version} %description devel qtkeychain can be used to store passwords. This package contains development files for libqtkeychain. -%lang_package -n %{lname} +%lang_package -n libqt5keychain%{sover} %prep %autosetup -p1 -n qtkeychain-%{version} @@ -67,12 +66,13 @@ %cmake_install %find_lang qtkeychain --with-qt -%post -n %{lname} -p /sbin/ldconfig -%postun -n %{lname} -p /sbin/ldconfig +%post -n libqt5keychain%{sover} -p /sbin/ldconfig +%postun -n libqt5keychain%{sover} -p /sbin/ldconfig -%files -n %{lname} +%files -n libqt5keychain%{sover} %license COPYING -%{_libdir}/libqt5keychain.so.* +%{_libdir}/libqt5keychain.so.%{sover} +%{_libdir}/libqt5keychain.so.%{version} %files devel %license COPYING @@ -81,7 +81,7 @@ %{_libdir}/libqt5keychain.so %{_libdir}/qt5/mkspecs/modules/qt_Qt5Keychain.pri -%files -n %{lname}-lang -f qtkeychain.lang +%files -n libqt5keychain%{sover}-lang -f qtkeychain.lang %license COPYING %dir %{_datadir}/qt5keychain %dir %{_datadir}/qt5keychain/translations ++++++ qtkeychain-qt6.spec ++++++ --- /var/tmp/diff_new_pack.J5Bitb/_old 2021-12-13 20:45:50.404495689 +0100 +++ /var/tmp/diff_new_pack.J5Bitb/_new 2021-12-13 20:45:50.408495690 +0100 @@ -18,7 +18,7 @@ %define sover 1 Name: qtkeychain-qt6 -Version: 0.12.0 +Version: 0.13.2 Release: 0 Summary: Platform-independent Qt API for storing passwords securely License: BSD-2-Clause ++++++ qtkeychain-qt5-0.12.0.tar.gz -> qtkeychain-qt5-0.13.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/.gitignore new/qtkeychain-0.13.2/.gitignore --- old/qtkeychain-0.12.0/.gitignore 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/.gitignore 2021-11-18 16:34:13.000000000 +0100 @@ -47,4 +47,4 @@ *.sw? *~ - +/build-*/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/CMakeLists.txt new/qtkeychain-0.13.2/CMakeLists.txt --- old/qtkeychain-0.12.0/CMakeLists.txt 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/CMakeLists.txt 2021-11-18 16:34:13.000000000 +0100 @@ -1,9 +1,9 @@ -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.16) -set(QTKEYCHAIN_VERSION 0.12.0) +set(QTKEYCHAIN_VERSION 0.13.2) set(QTKEYCHAIN_SOVERSION 1) -project(qtkeychain VERSION ${QTKEYCHAIN_VERSION}) +project(qtkeychain VERSION ${QTKEYCHAIN_VERSION} LANGUAGES CXX) # Enable C++11 SET(CMAKE_CXX_STANDARD 11) @@ -20,9 +20,13 @@ include(ECMGeneratePriFile) option(BUILD_WITH_QT6 "Build qtkeychain with Qt 6" OFF) -option(BUILD_TEST_APPLICATION "Build test application" ON) +option(BUILD_TEST_APPLICATION "Build test application" OFF) option(BUILD_TRANSLATIONS "Build translations" ON) -option(QTKEYCHAIN_STATIC "Build static library" OFF) +option(BUILD_SHARED_LIBS "Build dynamic library" ON) +if(QTKEYCHAIN_STATIC) + set(BUILD_SHARED_LIBS OFF) + message(WARNING "QTKEYCHAIN_STATIC is deprecated. Use BUILD_SHARED_LIBS=OFF instead.") +endif() if(CMAKE_SYSTEM_NAME STREQUAL Android) set(ANDROID 1) @@ -139,7 +143,7 @@ endif() else() # MSVC's STL / Qt headers are not MSVC -Wall clean, so don't enable it there - add_definitions( -Wall ) + add_definitions( -Wall -Werror=return-type ) endif() if(WIN32) @@ -155,12 +159,7 @@ endif() if(APPLE) - if(IOS) - list(APPEND qtkeychain_SOURCES keychain_ios.mm) - else() - list(APPEND qtkeychain_SOURCES keychain_mac.cpp) - endif() - + list(APPEND qtkeychain_SOURCES keychain_apple.mm) list(APPEND qtkeychain_LIBRARIES "-framework Foundation" "-framework Security") endif() @@ -175,12 +174,10 @@ option(LIBSECRET_SUPPORT "Build with libsecret support" ON) if(LIBSECRET_SUPPORT) - pkg_check_modules(LIBSECRET libsecret-1) - - if (LIBSECRET_FOUND) - add_definitions(-DHAVE_LIBSECRET=1) - endif() + pkg_check_modules(LIBSECRET REQUIRED libsecret-1) + add_definitions(-DHAVE_LIBSECRET=1) INCLUDE_DIRECTORIES(${LIBSECRET_INCLUDE_DIRS}) + LINK_DIRECTORIES(${LIBSECRET_LIBRARY_DIRS}) list(APPEND qtkeychain_LIBRARIES_PRIVATE ${LIBSECRET_LIBRARIES}) endif() @@ -192,7 +189,7 @@ if(ANDROID) list(APPEND qtkeychain_SOURCES keychain_android.cpp androidkeystore.cpp plaintextstore.cpp) - list(APPEND qtkeychain_LIBRARIES ${QTANDROIDEXTRAS_LIBRARIES} ) + list(APPEND qtkeychain_LIBRARIES_PRIVATE ${QTANDROIDEXTRAS_LIBRARIES} ) endif() QT_WRAP_CPP(qtkeychain_MOC_OUTFILES keychain.h keychain_p.h gnomekeyring_p.h) @@ -205,12 +202,20 @@ translations/qtkeychain_zh.ts ) +set(QTKEYCHAIN_TARGET_NAME qt${QTKEYCHAIN_VERSION_INFIX}keychain) +add_library(${QTKEYCHAIN_TARGET_NAME} ${qtkeychain_SOURCES} ${qtkeychain_MOC_OUTFILES} ${qtkeychain_QM_FILES}) +if(WIN32) + set_target_properties( ${QTKEYCHAIN_TARGET_NAME} PROPERTIES DEBUG_POSTFIX "d" ) +endif() + file(GLOB qtkeychain_TR_SOURCES *.cpp *.h *.ui) if ( BUILD_TRANSLATIONS ) qt_create_translation(qtkeychain_MESSAGES ${qtkeychain_TR_SOURCES} ${qtkeychain_TR_FILES}) qt_add_translation(qtkeychain_QM_FILES ${qtkeychain_TR_FILES}) add_custom_target(messages DEPENDS ${qtkeychain_MESSAGES}) - add_custom_target(translations DEPENDS ${qtkeychain_QM_FILES}) + add_custom_target(translations DEPENDS ${qtkeychain_QM_FILES} messages) + # https://github.com/frankosterfeld/qtkeychain/issues/185 + add_dependencies(${QTKEYCHAIN_TARGET_NAME} translations) if(QTKEYCHAIN_VERSION_INFIX EQUAL 5 AND QT_TRANSLATIONS_DIR AND NOT QTKEYCHAIN_TRANSLATIONS_DIR) # Back compatibility with pre-0.11 versions @@ -223,20 +228,9 @@ CACHE PATH "The location of the QtKeychain translations" ) endif() - install(FILES ${qtkeychain_QM_FILES} - DESTINATION ${QTKEYCHAIN_TRANSLATIONS_DIR}) + install(FILES ${qtkeychain_QM_FILES} DESTINATION ${QTKEYCHAIN_TRANSLATIONS_DIR}) endif( BUILD_TRANSLATIONS ) -set(QTKEYCHAIN_TARGET_NAME qt${QTKEYCHAIN_VERSION_INFIX}keychain) -if(NOT QTKEYCHAIN_STATIC) - add_library(${QTKEYCHAIN_TARGET_NAME} SHARED ${qtkeychain_SOURCES} ${qtkeychain_MOC_OUTFILES} ${qtkeychain_QM_FILES}) -else() - add_library(${QTKEYCHAIN_TARGET_NAME} STATIC ${qtkeychain_SOURCES} ${qtkeychain_MOC_OUTFILES} ${qtkeychain_QM_FILES}) -endif() -if(WIN32) - set_target_properties( ${QTKEYCHAIN_TARGET_NAME} PROPERTIES DEBUG_POSTFIX "d" ) -endif() - target_link_libraries(${QTKEYCHAIN_TARGET_NAME} PUBLIC ${qtkeychain_LIBRARIES} PRIVATE ${qtkeychain_LIBRARIES_PRIVATE}) if(NOT INTERFACE_INCLUDE_SUFFIX) set(INTERFACE_INCLUDE_SUFFIX include) @@ -251,11 +245,15 @@ set_target_properties(${QTKEYCHAIN_TARGET_NAME} PROPERTIES VERSION ${QTKEYCHAIN_VERSION} SOVERSION ${QTKEYCHAIN_SOVERSION} - MACOSX_RPATH 1 - INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" INSTALL_RPATH_USE_LINK_PATH TRUE ) +if (NOT APPLE) + set_target_properties(${QTKEYCHAIN_TARGET_NAME} PROPERTIES + INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" + ) +endif() + install(FILES keychain.h ${CMAKE_CURRENT_BINARY_DIR}/qkeychain_export.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qt${QTKEYCHAIN_VERSION_INFIX}keychain/ ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/COPYING new/qtkeychain-0.13.2/COPYING --- old/qtkeychain-0.12.0/COPYING 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/COPYING 2021-11-18 16:34:13.000000000 +0100 @@ -7,6 +7,9 @@ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to + endorse or promote products derived from this software without + specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/ChangeLog new/qtkeychain-0.13.2/ChangeLog --- old/qtkeychain-0.12.0/ChangeLog 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/ChangeLog 2021-11-18 16:34:13.000000000 +0100 @@ -1,6 +1,20 @@ ChangeLog ========= +version 0.13.2 (release 2021-11-18) + + - CMake: Deprecate QTKEYCHAIN_STATIC in favor of BUILD_SHARED_LIBS ([email protected]) + +version 0.13.1 (release 2021-11-08) + + - KWallet: Fix deletion of entries (Issue #199) + +version 0.13.0 (release 2021-11-07) + + - Linux: Require libsecret if not explicitly disabled + - Unify implementations for macOS and iOS + - CMake: lots of fixes + version 0.12.0 (release 2020-12-16) * Add Qt 6 support, drop Qt 4 support diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/QtKeychainConfig.cmake.in new/qtkeychain-0.13.2/QtKeychainConfig.cmake.in --- old/qtkeychain-0.12.0/QtKeychainConfig.cmake.in 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/QtKeychainConfig.cmake.in 2021-11-18 16:34:13.000000000 +0100 @@ -2,6 +2,9 @@ # It defines the following variables # QTKEYCHAIN_INCLUDE_DIRS - include directories for QtKeychain # QTKEYCHAIN_LIBRARIES - libraries to link against +# as well as the following imported targets +# qt5keychain / qt6keychain +# Qt5Keychain::Qt5Keychain / Qt6Keychain::Qt6Keychain @PACKAGE_INIT@ @@ -9,15 +12,13 @@ include(CMakeFindDependencyMacro) -if("@QTKEYCHAIN_VERSION_INFIX@" STREQUAL "5") - find_dependency(Qt5Core) - - if(UNIX AND NOT APPLE) - find_dependency(Qt5DBus) - endif() -else() - find_dependency(Qt4 COMPONENTS QtCore) +find_dependency(Qt@QTKEYCHAIN_VERSION_INFIX@Core) + +if(UNIX AND NOT APPLE AND NOT ANDROID) + find_dependency(Qt@QTKEYCHAIN_VERSION_INFIX@DBus) endif() set(QTKEYCHAIN_LIBRARIES "@QTKEYCHAIN_TARGET_NAME@") get_target_property(QTKEYCHAIN_INCLUDE_DIRS "@QTKEYCHAIN_TARGET_NAME@" INTERFACE_INCLUDE_DIRECTORIES) + +add_library(Qt@QTKEYCHAIN_VERSION_INFIX@Keychain::Qt@QTKEYCHAIN_VERSION_INFIX@Keychain ALIAS qt@QTKEYCHAIN_VERSION_INFIX@keychain) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/androidkeystore.cpp new/qtkeychain-0.13.2/androidkeystore.cpp --- old/qtkeychain-0.12.0/androidkeystore.cpp 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/androidkeystore.cpp 2021-11-18 16:34:13.000000000 +0100 @@ -55,7 +55,7 @@ QByteArray fromArray(const jbyteArray array) { QAndroidJniEnvironment env; - jbyte *const bytes = env->GetByteArrayElements(array, Q_NULLPTR); + jbyte *const bytes = env->GetByteArrayElements(array, nullptr); const QByteArray result(reinterpret_cast<const char *>(bytes), env->GetArrayLength(array)); env->ReleaseByteArrayElements(array, bytes, JNI_ABORT); return result; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/androidkeystore_p.h new/qtkeychain-0.13.2/androidkeystore_p.h --- old/qtkeychain-0.12.0/androidkeystore_p.h 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/androidkeystore_p.h 2021-11-18 16:34:13.000000000 +0100 @@ -236,8 +236,8 @@ bool containsAlias(const QString &alias) const; bool deleteEntry(const QString &alias) const; static KeyStore getInstance(const QString &type); - Entry getEntry(const QString &alias, const ProtectionParameter ¶m = Q_NULLPTR) const; - bool load(const LoadStoreParameter ¶m = Q_NULLPTR) const; + Entry getEntry(const QString &alias, const ProtectionParameter ¶m = nullptr) const; + bool load(const LoadStoreParameter ¶m = nullptr) const; }; namespace interfaces { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/cmake/Modules/GNUInstallDirs.cmake new/qtkeychain-0.13.2/cmake/Modules/GNUInstallDirs.cmake --- old/qtkeychain-0.12.0/cmake/Modules/GNUInstallDirs.cmake 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/cmake/Modules/GNUInstallDirs.cmake 1970-01-01 01:00:00.000000000 +0100 @@ -1,188 +0,0 @@ -# - Define GNU standard installation directories -# Provides install directory variables as defined for GNU software: -# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html -# Inclusion of this module defines the following variables: -# CMAKE_INSTALL_<dir> - destination for files of a given type -# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path -# where <dir> is one of: -# BINDIR - user executables (bin) -# SBINDIR - system admin executables (sbin) -# LIBEXECDIR - program executables (libexec) -# SYSCONFDIR - read-only single-machine data (etc) -# SHAREDSTATEDIR - modifiable architecture-independent data (com) -# LOCALSTATEDIR - modifiable single-machine data (var) -# LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian) -# INCLUDEDIR - C header files (include) -# OLDINCLUDEDIR - C header files for non-gcc (/usr/include) -# DATAROOTDIR - read-only architecture-independent data root (share) -# DATADIR - read-only architecture-independent data (DATAROOTDIR) -# INFODIR - info documentation (DATAROOTDIR/info) -# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale) -# MANDIR - man documentation (DATAROOTDIR/man) -# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME) -# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of -# install() commands for the corresponding file type. If the includer does -# not define a value the above-shown default will be used and the value will -# appear in the cache for editing by the user. -# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed -# from the corresponding destination by prepending (if necessary) the value -# of CMAKE_INSTALL_PREFIX. - -#============================================================================= -# Copyright 2011 Nikita Krupen'ko <[email protected]> -# Copyright 2011 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# Installation directories -# -if(NOT DEFINED CMAKE_INSTALL_BINDIR) - set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)") -endif() - -if(NOT DEFINED CMAKE_INSTALL_SBINDIR) - set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)") -endif() - -if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR) - set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)") -endif() - -if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR) - set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)") -endif() - -if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR) - set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)") -endif() - -if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR) - set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)") -endif() - -if(NOT DEFINED CMAKE_INSTALL_LIBDIR) - set(_LIBDIR_DEFAULT "lib") - # Override this default 'lib' with 'lib64' iff: - # - we are on Linux system but NOT cross-compiling - # - we are NOT on debian - # - we are on a 64 bits system - # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf - # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if - # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu" - # See http://wiki.debian.org/Multiarch - if(CMAKE_SYSTEM_NAME MATCHES "Linux" - AND NOT CMAKE_CROSSCOMPILING) - if (EXISTS "/etc/debian_version") # is this a debian system ? - if(CMAKE_LIBRARY_ARCHITECTURE) - set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}") - endif() - else() # not debian, rely on CMAKE_SIZEOF_VOID_P: - if(NOT DEFINED CMAKE_SIZEOF_VOID_P) - message(AUTHOR_WARNING - "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " - "Please enable at least one language before including GNUInstallDirs.") - else() - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - set(_LIBDIR_DEFAULT "lib64") - endif() - endif() - endif() - endif() - set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})") -endif() - -if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR) - set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)") -endif() - -if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR) - set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)") -endif() - -if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR) - set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)") -endif() - -#----------------------------------------------------------------------------- -# Values whose defaults are relative to DATAROOTDIR. Store empty values in -# the cache and store the defaults in local variables if the cache values are -# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes. - -if(NOT CMAKE_INSTALL_DATADIR) - set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)") - set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}") -endif() - -if(NOT CMAKE_INSTALL_INFODIR) - set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)") - set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info") -endif() - -if(NOT CMAKE_INSTALL_LOCALEDIR) - set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)") - set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale") -endif() - -if(NOT CMAKE_INSTALL_MANDIR) - set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)") - set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man") -endif() - -if(NOT CMAKE_INSTALL_DOCDIR) - set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)") - set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}") -endif() - -#----------------------------------------------------------------------------- - -mark_as_advanced( - CMAKE_INSTALL_BINDIR - CMAKE_INSTALL_SBINDIR - CMAKE_INSTALL_LIBEXECDIR - CMAKE_INSTALL_SYSCONFDIR - CMAKE_INSTALL_SHAREDSTATEDIR - CMAKE_INSTALL_LOCALSTATEDIR - CMAKE_INSTALL_LIBDIR - CMAKE_INSTALL_INCLUDEDIR - CMAKE_INSTALL_OLDINCLUDEDIR - CMAKE_INSTALL_DATAROOTDIR - CMAKE_INSTALL_DATADIR - CMAKE_INSTALL_INFODIR - CMAKE_INSTALL_LOCALEDIR - CMAKE_INSTALL_MANDIR - CMAKE_INSTALL_DOCDIR - ) - -# Result directories -# -foreach(dir - BINDIR - SBINDIR - LIBEXECDIR - SYSCONFDIR - SHAREDSTATEDIR - LOCALSTATEDIR - LIBDIR - INCLUDEDIR - OLDINCLUDEDIR - DATAROOTDIR - DATADIR - INFODIR - LOCALEDIR - MANDIR - DOCDIR - ) - if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}}) - set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") - else() - set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") - endif() -endforeach() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/gnomekeyring.cpp new/qtkeychain-0.13.2/gnomekeyring.cpp --- old/qtkeychain-0.12.0/gnomekeyring.cpp 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/gnomekeyring.cpp 2021-11-18 16:34:13.000000000 +0100 @@ -1,6 +1,6 @@ #include "gnomekeyring_p.h" -const char* GnomeKeyring::GNOME_KEYRING_DEFAULT = NULL; +const char* GnomeKeyring::GNOME_KEYRING_DEFAULT = nullptr; bool GnomeKeyring::isAvailable() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/keychain_apple.mm new/qtkeychain-0.13.2/keychain_apple.mm --- old/qtkeychain-0.12.0/keychain_apple.mm 1970-01-01 01:00:00.000000000 +0100 +++ new/qtkeychain-0.13.2/keychain_apple.mm 2021-11-18 16:34:13.000000000 +0100 @@ -0,0 +1,146 @@ +/****************************************************************************** + * Copyright (C) 2016 Mathias Hasselmann <[email protected]> * + * * + * This program 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. For licensing and distribution * + * details, check the accompanying file 'COPYING'. * + *****************************************************************************/ + +#include "keychain_p.h" + +#import <Foundation/Foundation.h> +#import <Security/Security.h> + +using namespace QKeychain; + +struct ErrorDescription +{ + QKeychain::Error code; + QString message; + + ErrorDescription(QKeychain::Error code, const QString &message) + : code(code), message(message) {} + + static ErrorDescription fromStatus(OSStatus status) + { + switch(status) { + case errSecSuccess: + return ErrorDescription(QKeychain::NoError, Job::tr("No error")); + case errSecItemNotFound: + return ErrorDescription(QKeychain::EntryNotFound, Job::tr("The specified item could not be found in the keychain")); + case errSecUserCanceled: + return ErrorDescription(QKeychain::AccessDeniedByUser, Job::tr("User canceled the operation")); + case errSecInteractionNotAllowed: + return ErrorDescription(QKeychain::AccessDenied, Job::tr("User interaction is not allowed")); + case errSecNotAvailable: + return ErrorDescription(QKeychain::AccessDenied, Job::tr("No keychain is available. You may need to restart your computer")); + case errSecAuthFailed: + return ErrorDescription(QKeychain::AccessDenied, Job::tr("The user name or passphrase you entered is not correct")); + case errSecVerifyFailed: + return ErrorDescription(QKeychain::AccessDenied, Job::tr("A cryptographic verification failure has occurred")); + case errSecUnimplemented: + return ErrorDescription(QKeychain::NotImplemented, Job::tr("Function or operation not implemented")); + case errSecIO: + return ErrorDescription(QKeychain::OtherError, Job::tr("I/O error")); + case errSecOpWr: + return ErrorDescription(QKeychain::OtherError, Job::tr("Already open with with write permission")); + case errSecParam: + return ErrorDescription(QKeychain::OtherError, Job::tr("Invalid parameters passed to a function")); + case errSecAllocate: + return ErrorDescription(QKeychain::OtherError, Job::tr("Failed to allocate memory")); + case errSecBadReq: + return ErrorDescription(QKeychain::OtherError, Job::tr("Bad parameter or invalid state for operation")); + case errSecInternalComponent: + return ErrorDescription(QKeychain::OtherError, Job::tr("An internal component failed")); + case errSecDuplicateItem: + return ErrorDescription(QKeychain::OtherError, Job::tr("The specified item already exists in the keychain")); + case errSecDecode: + return ErrorDescription(QKeychain::OtherError, Job::tr("Unable to decode the provided data")); + } + + return ErrorDescription(QKeychain::OtherError, Job::tr("Unknown error")); + } +}; + +void ReadPasswordJobPrivate::scheduledStart() +{ + NSDictionary *const query = @{ + (__bridge id) kSecClass: (__bridge id) kSecClassGenericPassword, + (__bridge id) kSecAttrService: (__bridge NSString *) service.toCFString(), + (__bridge id) kSecAttrAccount: (__bridge NSString *) key.toCFString(), + (__bridge id) kSecReturnData: @YES, + }; + + CFTypeRef dataRef = nil; + const OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef) query, &dataRef); + + data.clear(); + mode = Binary; + + if (status == errSecSuccess) { + if (dataRef) + data = QByteArray::fromCFData((CFDataRef) dataRef); + + q->emitFinished(); + } else { + const ErrorDescription error = ErrorDescription::fromStatus(status); + q->emitFinishedWithError(error.code, Job::tr("Could not retrieve private key from keystore: %1").arg(error.message)); + } + + if (dataRef) + CFRelease(dataRef); +} + +void WritePasswordJobPrivate::scheduledStart() +{ + NSDictionary *const query = @{ + (__bridge id) kSecClass: (__bridge id) kSecClassGenericPassword, + (__bridge id) kSecAttrService: (__bridge NSString *) service.toCFString(), + (__bridge id) kSecAttrAccount: (__bridge NSString *) key.toCFString(), + }; + + OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef) query, nil); + + if (status == errSecSuccess) { + NSDictionary *const update = @{ + (__bridge id) kSecValueData: (__bridge NSData *) data.toCFData(), + }; + + status = SecItemUpdate((__bridge CFDictionaryRef) query, (__bridge CFDictionaryRef) update); + } else { + NSDictionary *const insert = @{ + (__bridge id) kSecClass: (__bridge id) kSecClassGenericPassword, + (__bridge id) kSecAttrService: (__bridge NSString *) service.toCFString(), + (__bridge id) kSecAttrAccount: (__bridge NSString *) key.toCFString(), + (__bridge id) kSecValueData: (__bridge NSData *) data.toCFData(), + }; + + status = SecItemAdd((__bridge CFDictionaryRef) insert, nil); + } + + if (status == errSecSuccess) { + q->emitFinished(); + } else { + const ErrorDescription error = ErrorDescription::fromStatus(status); + q->emitFinishedWithError(error.code, tr("Could not store data in settings: %1").arg(error.message)); + } +} + +void DeletePasswordJobPrivate::scheduledStart() +{ + const NSDictionary *const query = @{ + (__bridge id) kSecClass: (__bridge id) kSecClassGenericPassword, + (__bridge id) kSecAttrService: (__bridge NSString *) service.toCFString(), + (__bridge id) kSecAttrAccount: (__bridge NSString *) key.toCFString(), + }; + + const OSStatus status = SecItemDelete((__bridge CFDictionaryRef) query); + + if (status == errSecSuccess) { + q->emitFinished(); + } else { + const ErrorDescription error = ErrorDescription::fromStatus(status); + q->emitFinishedWithError(error.code, Job::tr("Could not remove private key from keystore: %1").arg(error.message)); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/keychain_haiku.cpp new/qtkeychain-0.13.2/keychain_haiku.cpp --- old/qtkeychain-0.12.0/keychain_haiku.cpp 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/keychain_haiku.cpp 2021-11-18 16:34:13.000000000 +0100 @@ -29,9 +29,9 @@ AutoApp::AutoApp() - : app(NULL) + : app(nullptr) { - if (be_app != NULL) + if (be_app) return; // no BApplication object, probably using QCoreApplication diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/keychain_ios.mm new/qtkeychain-0.13.2/keychain_ios.mm --- old/qtkeychain-0.12.0/keychain_ios.mm 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/keychain_ios.mm 1970-01-01 01:00:00.000000000 +0100 @@ -1,146 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2016 Mathias Hasselmann <[email protected]> * - * * - * This program 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. For licensing and distribution * - * details, check the accompanying file 'COPYING'. * - *****************************************************************************/ - -#include "keychain_p.h" - -#import <Foundation/Foundation.h> -#import <Security/Security.h> - -using namespace QKeychain; - -struct ErrorDescription -{ - QKeychain::Error code; - QString message; - - ErrorDescription(QKeychain::Error code, const QString &message) - : code(code), message(message) {} - - static ErrorDescription fromStatus(OSStatus status) - { - switch(status) { - case errSecSuccess: - return ErrorDescription(QKeychain::NoError, Job::tr("No error")); - case errSecItemNotFound: - return ErrorDescription(QKeychain::EntryNotFound, Job::tr("The specified item could not be found in the keychain")); - case errSecUserCanceled: - return ErrorDescription(QKeychain::AccessDeniedByUser, Job::tr("User canceled the operation")); - case errSecInteractionNotAllowed: - return ErrorDescription(QKeychain::AccessDenied, Job::tr("User interaction is not allowed")); - case errSecNotAvailable: - return ErrorDescription(QKeychain::AccessDenied, Job::tr("No keychain is available. You may need to restart your computer")); - case errSecAuthFailed: - return ErrorDescription(QKeychain::AccessDenied, Job::tr("The user name or passphrase you entered is not correct")); - case errSecVerifyFailed: - return ErrorDescription(QKeychain::AccessDenied, Job::tr("A cryptographic verification failure has occurred")); - case errSecUnimplemented: - return ErrorDescription(QKeychain::NotImplemented, Job::tr("Function or operation not implemented")); - case errSecIO: - return ErrorDescription(QKeychain::OtherError, Job::tr("I/O error")); - case errSecOpWr: - return ErrorDescription(QKeychain::OtherError, Job::tr("Already open with with write permission")); - case errSecParam: - return ErrorDescription(QKeychain::OtherError, Job::tr("Invalid parameters passed to a function")); - case errSecAllocate: - return ErrorDescription(QKeychain::OtherError, Job::tr("Failed to allocate memory")); - case errSecBadReq: - return ErrorDescription(QKeychain::OtherError, Job::tr("Bad parameter or invalid state for operation")); - case errSecInternalComponent: - return ErrorDescription(QKeychain::OtherError, Job::tr("An internal component failed")); - case errSecDuplicateItem: - return ErrorDescription(QKeychain::OtherError, Job::tr("The specified item already exists in the keychain")); - case errSecDecode: - return ErrorDescription(QKeychain::OtherError, Job::tr("Unable to decode the provided data")); - } - - return ErrorDescription(QKeychain::OtherError, Job::tr("Unknown error")); - } -}; - -void ReadPasswordJobPrivate::scheduledStart() -{ - NSDictionary *const query = @{ - (__bridge id) kSecClass: (__bridge id) kSecClassGenericPassword, - (__bridge id) kSecAttrService: (__bridge NSString *) service.toCFString(), - (__bridge id) kSecAttrAccount: (__bridge NSString *) key.toCFString(), - (__bridge id) kSecReturnData: @YES, - }; - - CFTypeRef dataRef = nil; - const OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef) query, &dataRef); - - data.clear(); - mode = Binary; - - if (status == errSecSuccess) { - if (dataRef) - data = QByteArray::fromCFData((CFDataRef) dataRef); - - q->emitFinished(); - } else { - const ErrorDescription error = ErrorDescription::fromStatus(status); - q->emitFinishedWithError(error.code, Job::tr("Could not retrieve private key from keystore: %1").arg(error.message)); - } - - if (dataRef) - [dataRef release]; -} - -void WritePasswordJobPrivate::scheduledStart() -{ - NSDictionary *const query = @{ - (__bridge id) kSecClass: (__bridge id) kSecClassGenericPassword, - (__bridge id) kSecAttrService: (__bridge NSString *) service.toCFString(), - (__bridge id) kSecAttrAccount: (__bridge NSString *) key.toCFString(), - }; - - OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef) query, nil); - - if (status == errSecSuccess) { - NSDictionary *const update = @{ - (__bridge id) kSecValueData: (__bridge NSData *) data.toCFData(), - }; - - status = SecItemUpdate((__bridge CFDictionaryRef) query, (__bridge CFDictionaryRef) update); - } else { - NSDictionary *const insert = @{ - (__bridge id) kSecClass: (__bridge id) kSecClassGenericPassword, - (__bridge id) kSecAttrService: (__bridge NSString *) service.toCFString(), - (__bridge id) kSecAttrAccount: (__bridge NSString *) key.toCFString(), - (__bridge id) kSecValueData: (__bridge NSData *) data.toCFData(), - }; - - status = SecItemAdd((__bridge CFDictionaryRef) insert, nil); - } - - if (status == errSecSuccess) { - q->emitFinished(); - } else { - const ErrorDescription error = ErrorDescription::fromStatus(status); - q->emitFinishedWithError(error.code, tr("Could not store data in settings: %1").arg(error.message)); - } -} - -void DeletePasswordJobPrivate::scheduledStart() -{ - const NSDictionary *const query = @{ - (__bridge id) kSecClass: (__bridge id) kSecClassGenericPassword, - (__bridge id) kSecAttrService: (__bridge NSString *) service.toCFString(), - (__bridge id) kSecAttrAccount: (__bridge NSString *) key.toCFString(), - }; - - const OSStatus status = SecItemDelete((__bridge CFDictionaryRef) query); - - if (status == errSecSuccess) { - q->emitFinished(); - } else { - const ErrorDescription error = ErrorDescription::fromStatus(status); - q->emitFinishedWithError(error.code, Job::tr("Could not remove private key from keystore: %1").arg(error.message)); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/keychain_mac.cpp new/qtkeychain-0.13.2/keychain_mac.cpp --- old/qtkeychain-0.12.0/keychain_mac.cpp 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/keychain_mac.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,163 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2011-2015 Frank Osterfeld <[email protected]> * - * * - * This program 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. For licensing and distribution * - * details, check the accompanying file 'COPYING'. * - *****************************************************************************/ -#include "keychain_p.h" - -#include <CoreFoundation/CoreFoundation.h> -#include <Security/Security.h> -#include <QDebug> - -using namespace QKeychain; - -template <typename T> -struct Releaser { - explicit Releaser( const T& v ) : value( v ) {} - ~Releaser() { - CFRelease( value ); - } - - const T value; -}; - -static QString strForStatus( OSStatus os ) { - const Releaser<CFStringRef> str( SecCopyErrorMessageString( os, 0 ) ); - const char * const buf = CFStringGetCStringPtr( str.value, kCFStringEncodingUTF8 ); - if ( !buf ) - return QObject::tr( "OS X Keychain error (OSStatus %1)" ).arg( os ); - return QObject::tr( "%1 (OSStatus %2)" ) - .arg( QString::fromUtf8( buf, strlen( buf ) ) ).arg( os ); -} - -static OSStatus readPw( QByteArray* pw, - const QString& service, - const QString& account, - SecKeychainItemRef* ref ) { - Q_ASSERT( pw ); - pw->clear(); - const QByteArray serviceData = service.toUtf8(); - const QByteArray accountData = account.toUtf8(); - - void* data = 0; - UInt32 len = 0; - - const OSStatus ret = SecKeychainFindGenericPassword( NULL, // default keychain - serviceData.size(), - serviceData.constData(), - accountData.size(), - accountData.constData(), - &len, - &data, - ref ); - if ( ret == noErr ) { - *pw = QByteArray( reinterpret_cast<const char*>( data ), len ); - const OSStatus ret2 = SecKeychainItemFreeContent ( 0, data ); - if ( ret2 != noErr ) - qWarning() << "Could not free item content: " << strForStatus( ret2 ); - } - return ret; -} - -void ReadPasswordJobPrivate::scheduledStart() -{ - QString errorString; - Error error = NoError; - const OSStatus ret = readPw( &data, q->service(), q->key(), 0 ); - - switch ( ret ) { - case noErr: - break; - case errSecItemNotFound: - errorString = tr("Password not found"); - error = EntryNotFound; - break; - default: - errorString = strForStatus( ret ); - error = OtherError; - break; - } - q->emitFinishedWithError( error, errorString ); -} - - -static QKeychain::Error deleteEntryImpl( const QString& service, const QString& account, QString* err ) { - SecKeychainItemRef ref; - QByteArray pw; - const OSStatus ret1 = readPw( &pw, service, account, &ref ); - if ( ret1 == errSecItemNotFound ) - return NoError; // No item stored, we're done - if ( ret1 != noErr ) { - *err = strForStatus( ret1 ); - //TODO map error code, set errstr - return OtherError; - } - const Releaser<SecKeychainItemRef> releaser( ref ); - - const OSStatus ret2 = SecKeychainItemDelete( ref ); - - if ( ret2 == noErr ) - return NoError; - //TODO map error code - *err = strForStatus( ret2 ); - return CouldNotDeleteEntry; -} - -static QKeychain::Error writeEntryImpl( const QString& service, - const QString& account, - const QByteArray& data, - QString* err ) { - Q_ASSERT( err ); - err->clear(); - const QByteArray serviceData = service.toUtf8(); - const QByteArray accountData = account.toUtf8(); - const OSStatus ret = SecKeychainAddGenericPassword( NULL, //default keychain - serviceData.size(), - serviceData.constData(), - accountData.size(), - accountData.constData(), - data.size(), - data.constData(), - NULL //item reference - ); - if ( ret != noErr ) { - switch ( ret ) { - case errSecDuplicateItem: - { - Error derr = deleteEntryImpl( service, account, err ); - if ( derr != NoError ) - return CouldNotDeleteEntry; - else - return writeEntryImpl( service, account, data, err ); - } - default: - *err = strForStatus( ret ); - return OtherError; - } - } - - return NoError; -} - -void WritePasswordJobPrivate::scheduledStart() -{ - QString errorString; - Error error = NoError; - - error = writeEntryImpl( q->service(), key, data, &errorString ); - q->emitFinishedWithError( error, errorString ); -} - -void DeletePasswordJobPrivate::scheduledStart() -{ - QString errorString; - Error error = NoError; - - const Error derr = deleteEntryImpl( q->service(), key, &errorString ); - if ( derr != NoError ) - error = CouldNotDeleteEntry; - q->emitFinishedWithError( error, errorString ); -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/keychain_p.h new/qtkeychain-0.13.2/keychain_p.h --- old/qtkeychain-0.12.0/keychain_p.h 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/keychain_p.h 2021-11-18 16:34:13.000000000 +0100 @@ -94,17 +94,17 @@ void scheduledStart() override; #if defined(KEYCHAIN_DBUS) - void fallbackOnError(const QDBusError& err); + void fallbackOnError(const QDBusError& err) override; private Q_SLOTS: - void kwalletOpenFinished( QDBusPendingCallWatcher* watcher ); + void kwalletOpenFinished( QDBusPendingCallWatcher* watcher ) override; void kwalletEntryTypeFinished( QDBusPendingCallWatcher* watcher ); - void kwalletFinished( QDBusPendingCallWatcher* watcher ); + void kwalletFinished( QDBusPendingCallWatcher* watcher ) override; #else //moc's too dumb to respect above macros, so just define empty slot implementations private Q_SLOTS: - void kwalletOpenFinished( QDBusPendingCallWatcher* ) {} + void kwalletOpenFinished( QDBusPendingCallWatcher* ) override {} void kwalletEntryTypeFinished( QDBusPendingCallWatcher* ) {} - void kwalletFinished( QDBusPendingCallWatcher* ) {} + void kwalletFinished( QDBusPendingCallWatcher* ) override {} #endif friend class ReadPasswordJob; @@ -117,7 +117,7 @@ void scheduledStart() override; #if defined(KEYCHAIN_DBUS) - void fallbackOnError(const QDBusError& err); + void fallbackOnError(const QDBusError& err) override; #endif friend class WritePasswordJob; @@ -131,7 +131,7 @@ void scheduledStart() override; #if defined(KEYCHAIN_DBUS) - void fallbackOnError(const QDBusError& err); + void fallbackOnError(const QDBusError& err) override; #endif protected: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/keychain_unix.cpp new/qtkeychain-0.13.2/keychain_unix.cpp --- old/qtkeychain-0.12.0/keychain_unix.cpp 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/keychain_unix.cpp 2021-11-18 16:34:13.000000000 +0100 @@ -512,12 +512,16 @@ QDBusPendingReply<int> nextReply; - if ( mode == Text ) - nextReply = iface->writePassword( handle, q->service(), key, QString::fromUtf8(data), q->service() ); - else if ( mode == Binary ) - nextReply = iface->writeEntry( handle, q->service(), key, data, q->service() ); - else + if ( !data.isNull() ) { + if ( mode == Text ) { + nextReply = iface->writePassword( handle, q->service(), key, QString::fromUtf8(data), q->service() ); + } else { + Q_ASSERT( mode == Binary ); + nextReply = iface->writeEntry( handle, q->service(), key, data, q->service() ); + } + } else { nextReply = iface->removeEntry( handle, q->service(), key, q->service() ); + } QDBusPendingCallWatcher* nextWatcher = new QDBusPendingCallWatcher( nextReply, this ); connect( nextWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletFinished(QDBusPendingCallWatcher*)) ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/keychain_win.cpp new/qtkeychain-0.13.2/keychain_win.cpp --- old/qtkeychain-0.12.0/keychain_win.cpp 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/keychain_win.cpp 2021-11-18 16:34:13.000000000 +0100 @@ -129,10 +129,10 @@ blob_in.cbData = encrypted.size(); const BOOL ret = CryptUnprotectData( &blob_in, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, 0, &blob_out ); if ( !ret ) { @@ -153,9 +153,9 @@ blob_in.cbData = data.size(); const BOOL res = CryptProtectData( &blob_in, L"QKeychain-encrypted data", - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, 0, &blob_out ); if ( !res ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/libsecret.cpp new/qtkeychain-0.13.2/libsecret.cpp --- old/qtkeychain-0.12.0/libsecret.cpp 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/libsecret.cpp 2021-11-18 16:34:13.000000000 +0100 @@ -5,7 +5,6 @@ #include "libsecret_p.h" #include <QLibrary> -#include <QDebug> #if defined(HAVE_LIBSECRET) const SecretSchema* qtkeychainSchema(void) { @@ -54,14 +53,14 @@ typedef void (*secret_password_free_t) (gchar *password); typedef GQuark (*secret_error_get_quark_t) (void) G_GNUC_CONST; -static secret_password_lookup_t secret_password_lookup_fn = NULL; -static secret_password_lookup_finish_t secret_password_lookup_finish_fn = NULL; -static secret_password_store_t secret_password_store_fn = NULL; -static secret_password_store_finish_t secret_password_store_finish_fn = NULL; -static secret_password_clear_t secret_password_clear_fn = NULL; -static secret_password_clear_finish_t secret_password_clear_finish_fn = NULL; -static secret_password_free_t secret_password_free_fn = NULL; -static secret_error_get_quark_t secret_error_get_quark_fn = NULL; +static secret_password_lookup_t secret_password_lookup_fn = nullptr; +static secret_password_lookup_finish_t secret_password_lookup_finish_fn = nullptr; +static secret_password_store_t secret_password_store_fn = nullptr; +static secret_password_store_finish_t secret_password_store_finish_fn = nullptr; +static secret_password_clear_t secret_password_clear_fn = nullptr; +static secret_password_clear_finish_t secret_password_clear_finish_fn = nullptr; +static secret_password_free_t secret_password_free_fn = nullptr; +static secret_error_get_quark_t secret_error_get_quark_fn = nullptr; static QKeychain::Error gerrorToCode(const GError *error) { if (error->domain != secret_error_get_quark_fn()) { @@ -83,7 +82,7 @@ GAsyncResult *result, gpointer inst) { - GError *error = NULL; + GError *error = nullptr; callbackArg *arg = (callbackArg*)inst; gchar *password = secret_password_lookup_finish_fn (result, &error); @@ -95,7 +94,7 @@ arg->self->q->emitFinishedWithError( code, QString::fromUtf8(error->message) ); } else { - if (password != NULL) { + if (password) { QByteArray raw = QByteArray(password); switch(arg->self->mode) { case QKeychain::JobPrivate::Binary: @@ -109,12 +108,12 @@ arg->self->q->emitFinished(); } else if (arg->self->mode == QKeychain::JobPrivate::Text) { arg->self->mode = QKeychain::JobPrivate::Binary; - secret_password_lookup_fn (qtkeychainSchema(), NULL, + secret_password_lookup_fn (qtkeychainSchema(), nullptr, on_password_lookup, arg, "user", arg->user.toUtf8().constData(), "server", arg->server.toUtf8().constData(), "type", "base64", - NULL); + nullptr); return; } else { arg->self->q->emitFinishedWithError( QKeychain::EntryNotFound, QObject::tr("Entry not found") ); @@ -139,7 +138,7 @@ GAsyncResult *result, gpointer inst) { - GError *error = NULL; + GError *error = nullptr; QKeychain::JobPrivate *self = (QKeychain::JobPrivate*)inst; Q_UNUSED(source); @@ -147,14 +146,14 @@ secret_password_store_finish_fn (result, &error); if (self) { - if (error != NULL) { + if (error) { self->q->emitFinishedWithError( gerrorToCode(error), QString::fromUtf8(error->message) ); } else { self->q->emitFinished(); } } - if (error != NULL) { + if (error) { g_error_free (error); } } @@ -164,7 +163,7 @@ GAsyncResult *result, gpointer inst) { - GError *error = NULL; + GError *error = nullptr; QKeychain::JobPrivate *self = (QKeychain::JobPrivate*)inst; gboolean removed = secret_password_clear_finish_fn (result, &error); @@ -178,7 +177,7 @@ self->q->emitFinished(); } } - if (error != NULL) { + if (error) { g_error_free (error); } } @@ -198,21 +197,21 @@ const LibSecretKeyring& keyring = instance(); if (!keyring.isLoaded()) return false; - if (secret_password_lookup_fn == NULL) + if (secret_password_lookup_fn == nullptr) return false; - if (secret_password_lookup_finish_fn == NULL) + if (secret_password_lookup_finish_fn == nullptr) return false; - if (secret_password_store_fn == NULL) + if (secret_password_store_fn == nullptr) return false; - if (secret_password_store_finish_fn == NULL) + if (secret_password_store_finish_fn == nullptr) return false; - if (secret_password_clear_fn == NULL) + if (secret_password_clear_fn == nullptr) return false; - if (secret_password_clear_finish_fn == NULL) + if (secret_password_clear_finish_fn == nullptr) return false; - if (secret_password_free_fn == NULL) + if (secret_password_free_fn == nullptr) return false; - if (secret_error_get_quark_fn == NULL) + if (secret_error_get_quark_fn == nullptr) return false; return true; #else @@ -236,12 +235,11 @@ arg->user = user; arg->server = server; - qDebug() << Q_FUNC_INFO; - secret_password_lookup_fn (qtkeychainSchema(), NULL, on_password_lookup, arg, + secret_password_lookup_fn (qtkeychainSchema(), nullptr, on_password_lookup, arg, "user", user.toUtf8().constData(), "server", server.toUtf8().constData(), "type", "plaintext", - NULL); + nullptr); return true; #else Q_UNUSED(user) @@ -274,14 +272,13 @@ break; } - qDebug() << Q_FUNC_INFO; secret_password_store_fn (qtkeychainSchema(), SECRET_COLLECTION_DEFAULT, display_name.toUtf8().constData(), - pwd.constData(), NULL, on_password_stored, self, + pwd.constData(), nullptr, on_password_stored, self, "user", user.toUtf8().constData(), "server", server.toUtf8().constData(), "type", type.toUtf8().constData(), - NULL); + nullptr); return true; #else Q_UNUSED(display_name) @@ -302,11 +299,10 @@ return false; } - qDebug() << Q_FUNC_INFO; - secret_password_clear_fn (qtkeychainSchema(), NULL, on_password_cleared, self, + secret_password_clear_fn (qtkeychainSchema(), nullptr, on_password_cleared, self, "user", key.toUtf8().constData(), "server", service.toUtf8().constData(), - NULL); + nullptr); return true; #else Q_UNUSED(key) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/qt5keychain.pri new/qtkeychain-0.13.2/qt5keychain.pri --- old/qtkeychain-0.12.0/qt5keychain.pri 2020-12-16 16:43:48.000000000 +0100 +++ new/qtkeychain-0.13.2/qt5keychain.pri 1970-01-01 01:00:00.000000000 +0100 @@ -1,95 +0,0 @@ -# Minimal qmake support. -# This file is provided as is without any warranty. -# It can break at anytime or be removed without notice. - -QT5KEYCHAIN_PWD = $$PWD - -CONFIG += depend_includepath -DEFINES += QTKEYCHAIN_NO_EXPORT - -INCLUDEPATH += \ - $$PWD/.. \ - $$QT5KEYCHAIN_PWD - -HEADERS += \ - $$QT5KEYCHAIN_PWD/keychain_p.h \ - $$QT5KEYCHAIN_PWD/keychain.h - -SOURCES += \ - $$QT5KEYCHAIN_PWD/keychain.cpp - -unix:!android:!macx:!ios { - # Remove the following LIBSECRET_SUPPORT line - # to build without libsecret support. - DEFINES += LIBSECRET_SUPPORT - contains(DEFINES, LIBSECRET_SUPPORT) { - packagesExist(libsecret-1) { - !build_pass:message("Libsecret support: on") - CONFIG += link_pkgconfig - PKGCONFIG += libsecret-1 - DEFINES += HAVE_LIBSECRET - } else { - !build_pass:warning("Libsecret not found.") - !build_pass:message("Libsecret support: off") - } - } else { - !build_pass:message("Libsecret support: off") - } - - # Generate D-Bus interface: - QT += dbus - kwallet_interface.files = $$PWD/org.kde.KWallet.xml - DBUS_INTERFACES += kwallet_interface - - HEADERS += \ - $$QT5KEYCHAIN_PWD/gnomekeyring_p.h \ - $$QT5KEYCHAIN_PWD/plaintextstore_p.h \ - $$QT5KEYCHAIN_PWD/libsecret_p.h - SOURCES += \ - $$QT5KEYCHAIN_PWD/keychain_unix.cpp \ - $$QT5KEYCHAIN_PWD/plaintextstore.cpp \ - $$QT5KEYCHAIN_PWD/gnomekeyring.cpp \ - $$QT5KEYCHAIN_PWD/libsecret.cpp -} - -android { - QT += androidextras - - HEADERS += \ - $$QT5KEYCHAIN_PWD/androidkeystore_p.h \ - $$QT5KEYCHAIN_PWD/plaintextstore_p.h - SOURCES += \ - $$QT5KEYCHAIN_PWD/androidkeystore.cpp \ - $$QT5KEYCHAIN_PWD/keychain_android.cpp \ - $$QT5KEYCHAIN_PWD/plaintextstore.cpp -} - -win32 { - # Remove the following USE_CREDENTIAL_STORE line - # to use the CryptProtectData Windows API function - # instead of the Windows Credential Store. - DEFINES += USE_CREDENTIAL_STORE - contains(DEFINES, USE_CREDENTIAL_STORE) { - !build_pass:message("Windows Credential Store support: on") - LIBS += -ladvapi32 - } else { - !build_pass:message("Windows Credential Store support: off") - LIBS += -lcrypt32 - HEADERS += $$QT5KEYCHAIN_PWD/plaintextstore_p.h - SOURCES += $$QT5KEYCHAIN_PWD/plaintextstore.cpp - } - HEADERS += $$QT5KEYCHAIN_PWD/libsecret_p.h - SOURCES += \ - $$QT5KEYCHAIN_PWD/keychain_win.cpp \ - $$QT5KEYCHAIN_PWD/libsecret.cpp -} - -macx:!ios { - LIBS += -framework Security -framework Foundation - SOURCES += $$QT5KEYCHAIN_PWD/keychain_mac.cpp -} - -ios { - LIBS += -framework Security -framework Foundation - OBJECTIVE_SOURCES += $$QT5KEYCHAIN_PWD/keychain_ios.mm -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtkeychain-0.12.0/qtkeychain.pri new/qtkeychain-0.13.2/qtkeychain.pri --- old/qtkeychain-0.12.0/qtkeychain.pri 1970-01-01 01:00:00.000000000 +0100 +++ new/qtkeychain-0.13.2/qtkeychain.pri 2021-11-18 16:34:13.000000000 +0100 @@ -0,0 +1,95 @@ +# Minimal qmake support. +# This file is provided as is without any warranty. +# It can break at anytime or be removed without notice. + +lessThan(QT_MAJOR_VERSION, 5) { + error("qtkeychain requires Qt 5 or later") +} + +QTKEYCHAIN_PWD = $$PWD + +CONFIG += depend_includepath +DEFINES += QTKEYCHAIN_NO_EXPORT + +INCLUDEPATH += \ + $$PWD/.. \ + $$QTKEYCHAIN_PWD + +HEADERS += \ + $$QTKEYCHAIN_PWD/keychain_p.h \ + $$QTKEYCHAIN_PWD/keychain.h + +SOURCES += \ + $$QTKEYCHAIN_PWD/keychain.cpp + +unix:!android:!macx:!ios { + # Remove the following LIBSECRET_SUPPORT line + # to build without libsecret support. + DEFINES += LIBSECRET_SUPPORT + contains(DEFINES, LIBSECRET_SUPPORT) { + packagesExist(libsecret-1) { + !build_pass:message("Libsecret support: on") + CONFIG += link_pkgconfig + PKGCONFIG += libsecret-1 + DEFINES += HAVE_LIBSECRET + } else { + !build_pass:warning("Libsecret not found.") + !build_pass:message("Libsecret support: off") + } + } else { + !build_pass:message("Libsecret support: off") + } + + # Generate D-Bus interface: + DEFINES += KEYCHAIN_DBUS + QT += dbus + kwallet_interface.files = $$PWD/org.kde.KWallet.xml + DBUS_INTERFACES += kwallet_interface + + HEADERS += \ + $$QTKEYCHAIN_PWD/gnomekeyring_p.h \ + $$QTKEYCHAIN_PWD/plaintextstore_p.h \ + $$QTKEYCHAIN_PWD/libsecret_p.h + SOURCES += \ + $$QTKEYCHAIN_PWD/keychain_unix.cpp \ + $$QTKEYCHAIN_PWD/plaintextstore.cpp \ + $$QTKEYCHAIN_PWD/gnomekeyring.cpp \ + $$QTKEYCHAIN_PWD/libsecret.cpp +} + +android { + QT += androidextras + + HEADERS += \ + $$QTKEYCHAIN_PWD/androidkeystore_p.h \ + $$QTKEYCHAIN_PWD/plaintextstore_p.h + SOURCES += \ + $$QTKEYCHAIN_PWD/androidkeystore.cpp \ + $$QTKEYCHAIN_PWD/keychain_android.cpp \ + $$QTKEYCHAIN_PWD/plaintextstore.cpp +} + +win32 { + # Remove the following USE_CREDENTIAL_STORE line + # to use the CryptProtectData Windows API function + # instead of the Windows Credential Store. + DEFINES += USE_CREDENTIAL_STORE + contains(DEFINES, USE_CREDENTIAL_STORE) { + !build_pass:message("Windows Credential Store support: on") + LIBS += -ladvapi32 + } else { + !build_pass:message("Windows Credential Store support: off") + LIBS += -lcrypt32 + HEADERS += $$QTKEYCHAIN_PWD/plaintextstore_p.h + SOURCES += $$QTKEYCHAIN_PWD/plaintextstore.cpp + } + HEADERS += $$QTKEYCHAIN_PWD/libsecret_p.h + SOURCES += \ + $$QTKEYCHAIN_PWD/keychain_win.cpp \ + $$QTKEYCHAIN_PWD/libsecret.cpp +} + +macx|ios { + LIBS += -framework Security -framework Foundation + OBJECTIVE_SOURCES += $$QTKEYCHAIN_PWD/keychain_apple.mm +}
