diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a016c1..9f3dda0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) +CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) IF(POLICY CMP0020) CMAKE_POLICY(SET CMP0020 NEW) @@ -20,6 +20,10 @@ IF(POLICY CMP0063) CMAKE_POLICY(SET CMP0063 NEW) ENDIF() +IF(POLICY CMP0071) + CMAKE_POLICY(SET CMP0071 NEW) +ENDIF() + # "tools.only" can be defined to disable the normal build and enable # cmdline "tools" only. For example: "make format" or "make package_source" IF(tools.only) @@ -29,7 +33,7 @@ ELSE() ENDIF() -PROJECT(AusweisApp2 VERSION 1.12.2 LANGUAGES ${LANGUAGES}) +PROJECT(AusweisApp2 VERSION 1.12.3 LANGUAGES ${LANGUAGES}) # Set TWEAK if not defined in PROJECT_VERSION above to # have a valid tweak version without propagating it @@ -63,6 +67,11 @@ MESSAGE(STATUS "VENDOR: ${VENDOR}") MESSAGE(STATUS "VERSION: ${PROJECT_VERSION}") IF(ANDROID) + IF(NOT BUILD_PREVIEW) + SET(BUILD_PREVIEW false) + ENDIF() + MESSAGE(STATUS "BUILD_PREVIEW: ${BUILD_PREVIEW}") + IF(NOT ANDROID_VERSION_CODE) SET(ANDROID_VERSION_CODE 0) ENDIF() diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index b341d82..e3381eb 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -47,7 +47,6 @@ Lizenz Wir benötigen eine persönliche CLA (contributor license agreement) für die eingereichten Änderungen. -Siehe `LICENSE.AusweisApp2.German.txt`_ oder `LICENSE.AusweisApp2.English.txt`_ für Details. +Siehe `Governikus_CLA.pdf`_ für Details. -.. _`LICENSE.AusweisApp2.German.txt`: LICENSE.AusweisApp2.German.txt -.. _`LICENSE.AusweisApp2.English.txt`: LICENSE.AusweisApp2.English.txt +.. _`Governikus_CLA.pdf`: Governikus_CLA.pdf diff --git a/Governikus_CLA.pdf b/Governikus_CLA.pdf new file mode 100644 index 0000000..c297a44 Binary files /dev/null and b/Governikus_CLA.pdf differ diff --git a/LICENSE.officially.txt b/LICENSE.officially.txt new file mode 100644 index 0000000..4790228 --- /dev/null +++ b/LICENSE.officially.txt @@ -0,0 +1,686 @@ +Nutzungsbedingungen + +Allgemeines zur Installation + +Bitte lesen Sie zunächst die Allgemeinen Geschäftsbedingungen so wie die Lizenzbedingungen für die Überlassung und Nutzung der AusweisApp2 durch. Nachdem Sie zugestimmt haben, können Sie die Installation fortsetzen. + + + Allgemeine Geschäftsbedingungen + +§ 1 Nutzungsbedingungen und Datenschutzhinweis +(1) Diese Allgemeine Geschäftsbedingungen (AGB) des Bundes, vertreten durch das Bundesministerium des Innern (nachfolgend "Bund") und dem Nutzer gelten für die Überlassung und Nutzung der Software AusweisApp2 (nachfolgend AusweisApp2) und deren neue Versionen, die auf der Grundlage dieser Bedingungen überlassen werden. +(2) "Nutzer" im Sinne dieses Vertrages sind natürliche Personen. + +§ 2 Vertragsgegenstand und Unentgeltlichkeit +(1) Die AusweisApp2 wird regelmäßig hinsichtlich ihrer Konformität zu den Technischen Richtlinien des Bundesamtes für Sicherheit in der Informationstechnik [TR-03124-2] zertifiziert sowie hinsichtlich ihrer Nutzerfreundlichkeit [EN ISO 9241 Teil 110 Ergonomie Mensch-System-Integration zur Prüfung der Benutzbarkeit und Funktionalität und Trusted Design Guidelines zur Prüfung der Vertrauenswürdigkeit] und auf Barrierefreiheit [BITV 2.0] überprüft. +(2) Die AusweisApp2 wird in maschinenlesbarer Form unentgeltlich überlassen. Der Quellcode der AusweisApp2 wird ebenfalls unentgeltlich veröffentlicht. Eine Auflistung der verwendeten Open Source-Bestandteile der AusweisApp2 findet sich im Anhang. +(3) Die AusweisApp2 wird von der Governikus GmbH & Co. KG (Governikus) als Erfüllungsgehilfe des Bundes überlassen. + +§ 3 Verwendungszweck +Die AusweisApp2 und alle ihre Bestandteile dienen ausschließlich dazu, im Zusammenhang mit der Nutzung der Online-Ausweisfunktion des Personalausweises bzw. des elektronischen Aufenthaltstitels und der Übermittlung der damit verbundenen Daten gemäß den gesetzlichen Vorgaben verwendet zu werden. + +§ 4 Pflichten und Obliegenheiten des Nutzers +(1) Der Nutzer verpflichtet sich, die AusweisApp2 entsprechend des in § 3 genannten Verwendungszweckes zu nutzen. Es liegt in seinem Interesse, dass in Verbindung mit der AusweisApp2 genutzte Hard- und Software des Nutzers immer auf dem neuesten Stand der Sicherheitstechnik (System- und Firmware Update, Virenscanner, Firewall usw.) sind. +(2) Es liegt im eigenen Interesse des Nutzers aber auch des Bundes, dass stets nur die neueste Version der AusweisApp2 (siehe § 5) verwendet wird. + +§ 5 Pflege und Support +(1) Der Bund bietet nach eigenem Ermessen und ohne hierzu verpflichtet zu sein für Teile der AusweisApp2 zusätzliche kostenfreie Supportleistungen in Form von Dokumentationen und online Hilfen auf dem AusweisApp2-Portal im Internet unter der Adresse www.ausweisapp.bund.de an, sowie über die Hotline des Herstellers Governikus unter der E-Mail-Adresse: support@ausweisapp.de und der Tel.-Nr.: +49 1805 348 743. Auch stellt er verfügbare neue Versionen der AusweisApp2 zur Verfügung. Hieraus erwächst jedoch kein zusätzlicher Anspruch auf Mängelbeseitigung, auf Zertifizierung, auf Beibehaltung der Supportleistungen oder der Hotline und auf Überlassung neuer Versionen. +(2) Verfügbare neue Versionen der AusweisApp2 können im Internet kostenfrei auf dem AusweisApp2-Portal unter der Adresse www.ausweisapp.bund.de sowie über allgemein zugängliche AppStore heruntergeladen werden. +(3) Eventuelle Mängel der AusweisApp2 werden grundsätzlich dadurch behoben, dass der Bund jeweils eine neue Version der AusweisApp2 zum Herunterladen zur Verfügung stellt (siehe § 5 Absatz 1). Eine Pflicht zur Bereitstellung von neuen Versionen ergibt sich daraus grundsätzlich nicht. + +§ 6 Hinweis auf gewerbliche und urheberrechtliche Schutzrechte +Die Zeichen AusweisApp2 und die entsprechenden Grafiken sowie das Signet zur Online-Ausweisfunktion sind für den Bund als Marken geschützt. + +§ 7 Datenschutzhinweis +(1) Mit dieser Software werden personenbezogene Daten im Sinne des § 3 Absatz 1 des Bundesdatenschutzgesetzes (BDSG) zum Zwecke der Verarbeitung grundsätzlich nicht erhoben. +(2) Personenbezogene Daten aus dem Ausweischip werden ausschließlich zum Zweck des elektronischen Identitätsnachweises im Umfang der erteilten Berechtigung nach Einwilligung des Nutzers mit seiner Ausweis-PIN-Eingabe und auf dem Transportweg zwischen dem Ausweischip und dem Diensteanbieter sicher verschlüsselt und auch für Governikus nicht lesbar übertragen. +(3) Neben den reinen Daten, die zur Identifizierung/ Authentisierung benötigt werden, erhebt die Software nur mit Einverständnis des Nutzers Daten über die Art und Version der Anwendungsumgebung (Betriebssystem, Lesegeräte usw.) des Nutzers. Diese Daten kann der Nutzer bei Bedarf an Governikus übermitteln, um die ordnungsgemäße Verarbeitung prüfen zu lassen und Fehlern im Verarbeitungsprozess vorzubeugen. Die Nutzung der Daten erfolgt dann im Rahmen des § 14 BDSG durch Governikus im Auftrag des Bundes und nur für den genannten Zweck. +(4) Die in der AusweisApp2 enthaltene Selbstauskunft über die im Chip gespeicherten Daten, ist ein Dienst der durch Governikus über das Internet erbracht wird. Die Ausweisdaten werden dabei nur zur Anzeige des Nutzers gebracht und nicht dauerhaft bei Governikus gespeichert oder für andere Zwecke verwendet. + +§ 8 Deutsches Recht +Auf diese Nutzungsbedingungen ist ausschließlich deutsches Recht unter Ausschluss des Übereinkommens der Vereinten Nationen über Verträge über den internationalen Warenkauf (CISG) anwendbar. + + +Anhang + +Eingearbeitete Open Source-Komponenten +Qt, OpenSSL und http_parser. + + + + Lizenzbedingungen + +Der Quellcode der AusweisApp2 wird unter der EUPL v1.2 bereitgestellt, mit Ausnahme der Bibliothek OpenSSL, die unter der OpenSSL License / SSLeay License lizensiert ist. + + + + + + + OPEN-SOURCE-LIZENZ FÜR DIE EUROPÄISCHE UNION v. 1.2 + EUPL © Europäische Union 2007, 2016 + + +Diese Open-Source-Lizenz für die Europäische Union („EUPL“) gilt für Werke (im Sinne der nachfolgenden Begriffsbestimmung), +die unter EUPL-Bedingungen zur Verfügung gestellt werden. Das Werk darf nur in der durch diese Lizenz +gestatteten Form genutzt werden (insoweit eine solche Nutzung dem Urheber vorbehalten ist). + +Das Werk wird unter den Bedingungen dieser Lizenz zur Verfügung gestellt, wenn der Lizenzgeber (im Sinne der +nachfolgenden Begriffsbestimmung) den folgenden Hinweis unmittelbar hinter dem Urheberrechtshinweis dieses Werks +anbringt: + +Lizenziert unter der EUPL + +oder in einer anderen Form zum Ausdruck bringt, dass er es unter der EUPL lizenzieren möchte. + + + 1. Begriffsbestimmungen + +Für diese Lizenz gelten folgende Begriffsbestimmungen: + +- „Lizenz“: diese Lizenz. + +- „Originalwerk“: das Werk oder die Software, die vom Lizenzgeber unter dieser Lizenz verbreitet oder zugänglich + gemacht wird, und zwar als Quellcode und gegebenenfalls auch als ausführbarer Code. + +- „Bearbeitungen“: die Werke oder Software, die der Lizenznehmer auf der Grundlage des Originalwerks oder seiner + Bearbeitungen schaffen kann. In dieser Lizenz wird nicht festgelegt, wie umfangreich die Änderung oder wie stark die + Abhängigkeit vom Originalwerk für eine Einstufung als Bearbeitung sein muss; dies bestimmt sich nach dem + Urheberrecht, das in dem unter Artikel 15 aufgeführten Land anwendbar ist. + +- „Werk“: das Originalwerk oder seine Bearbeitungen. + +- „Quellcode“: diejenige Form des Werkes, die zur Auffassung durch den Menschen bestimmt ist und die am besten + geeignet ist, um vom Menschen verstanden und verändert zu werden. + +- „Ausführbarer Code“: die — üblicherweise — kompilierte Form des Werks, die von einem Computer als Programm + ausgeführt werden soll. + +- „Lizenzgeber“: die natürliche oder juristische Person, die das Werk unter der Lizenz verbreitet oder zugänglich + macht. + +- „Bearbeiter“: jede natürliche oder juristische Person, die das Werk unter der Lizenz verändert oder auf andere Weise + zur Schaffung einer Bearbeitung beiträgt. + +- „Lizenznehmer“ („Sie“): jede natürliche oder juristische Person, die das Werk unter den Lizenzbedingungen nutzt. + +- „Verbreitung“ oder „Zugänglichmachung“: alle Formen von Verkauf, Überlassung, Verleih, Vermietung, Verbreitung, + Weitergabe, Übermittlung oder anderweitiger Online- oder Offline-Bereitstellung von Vervielfältigungen des Werks + oder Zugänglichmachung seiner wesentlichen Funktionen für dritte natürliche oder juristische Personen. + + + 2. Umfang der Lizenzrechte + +Der Lizenzgeber erteilt Ihnen hiermit für die Gültigkeitsdauer der am Originalwerk bestehenden Urheberrechte eine +weltweite, unentgeltliche, nicht ausschließliche, unterlizenzierbare Lizenz, die Sie berechtigt: + +- das Werk uneingeschränkt zu nutzen, + +- das Werk zu vervielfältigen, + +- das Werk zu verändern und Bearbeitungen auf der Grundlage des Werks zu schaffen, + +- das Werk öffentlich zugänglich zu machen, was das Recht einschließt, das Werk oder Vervielfältigungsstücke davon + öffentlich bereitzustellen oder wahrnehmbar zu machen oder das Werk, soweit möglich, öffentlich aufzuführen, + +- das Werk oder Vervielfältigungen davon zu verbreiten, + +- das Werk oder Vervielfältigungen davon zu vermieten oder zu verleihen, + +- das Werk oder Vervielfältigungen davon weiter zu lizenzieren. + +Für die Wahrnehmung dieser Rechte können beliebige, derzeit bekannte oder künftige Medien, Träger und Formate +verwendet werden, soweit das geltende Recht dem nicht entgegensteht. + +Für die Länder, in denen Urheberpersönlichkeitsrechte an dem Werk bestehen, verzichtet der Lizenzgeber im gesetzlich +zulässigen Umfang auf seine Urheberpersönlichkeitsrechte, um die Lizenzierung der oben aufgeführten +Verwertungsrechte wirksam durchführen zu können. + +Der Lizenzgeber erteilt dem Lizenznehmer ein nicht ausschließliches, unentgeltliches Nutzungsrecht an seinen Patenten, +sofern dies zur Ausübung der durch die Lizenz erteilten Nutzungsrechte am Werk notwendig ist. + + + 3. Zugänglichmachung des Quellcodes + + +Der Lizenzgeber kann das Werk entweder als Quellcode oder als ausführbaren Code zur Verfügung stellen. Stellt er es als +ausführbaren Code zur Verfügung, so stellt er darüber hinaus eine maschinenlesbare Kopie des Quellcodes für jedes von +ihm verbreitete Vervielfältigungsstück des Werks zur Verfügung, oder er verweist in einem Vermerk im Anschluss an den +dem Werk beigefügten Urheberrechtshinweis auf einen Speicherort, an dem problemlos und unentgeltlich auf den +Quellcode zugegriffen werden kann, solange der Lizenzgeber das Werk verbreitet oder zugänglich macht. + + + 4. Einschränkungen des Urheberrechts + + +Es ist nicht Zweck dieser Lizenz, Ausnahmen oder Schranken der ausschließlichen Rechte des Urhebers am Werk, die +dem Lizenznehmer zugutekommen, einzuschränken. Auch die Erschöpfung dieser Rechte bleibt von dieser Lizenz +unberührt. + + + 5. Pflichten des Lizenznehmers + + +Die Einräumung der oben genannten Rechte ist an mehrere Beschränkungen und Pflichten für den Lizenznehmer +gebunden: + +Urheberrechtshinweis, Lizenztext, Nennung des Bearbeiters: Der Lizenznehmer muss alle Urheberrechts-, Patent- +oder Markenrechtshinweise und alle Hinweise auf die Lizenz und den Haftungsausschluss unverändert lassen. Jedem von +ihm verbreiteten oder zugänglich gemachten Vervielfältigungsstück des Werks muss der Lizenznehmer diese Hinweise +sowie diese Lizenz beifügen. Der Lizenznehmer muss auf jedem abgeleiteten Werk deutlich darauf hinweisen, dass das +Werk geändert wurde, und das Datum der Bearbeitung angeben. + +„Copyleft“-Klausel: Der Lizenznehmer darf Vervielfältigungen des Originalwerks oder Bearbeitungen nur unter den +Bedingungen dieser EUPL oder einer neueren Version dieser Lizenz verbreiten oder zugänglich machen, außer wenn das +Originalwerk ausdrücklich nur unter dieser Lizenzversion — z. B. mit der Angabe „Nur EUPL V. 1.2“ — verbreitet +werden darf. Der Lizenznehmer (der zum Lizenzgeber wird) darf für das Werk oder die Bearbeitung keine zusätzlichen +Bedingungen anbieten oder vorschreiben, die die Bedingungen dieser Lizenz verändern oder einschränken. + +Kompatibilitäts-Klausel: Wenn der Lizenznehmer Bearbeitungen, die auf dem Werk und einem anderen Werk, das +unter einer kompatiblen Lizenz lizenziert wurde, basieren, oder die Kopien dieser Bearbeitungen verbreitet oder +zugänglich macht, kann dies unter den Bedingungen dieser kompatiblen Lizenz erfolgen. Unter „kompatibler Lizenz“ ist +eine im Anhang dieser Lizenz angeführte Lizenz zu verstehen. Sollten die Verpflichtungen des Lizenznehmers aus der +kompatiblen Lizenz mit denjenigen aus der vorliegenden Lizenz (EUPL) in Konflikt stehen, werden die Verpflichtungen +aus der kompatiblen Lizenz Vorrang haben. + +Bereitstellung des Quellcodes: Wenn der Lizenznehmer Vervielfältigungsstücke des Werks verbreitet oder zugänglich +macht, muss er eine maschinenlesbare Fassung des Quellcodes mitliefern oder einen Speicherort angeben, über den +problemlos und unentgeltlich so lange auf diesen Quellcode zugegriffen werden kann, wie der Lizenznehmer das Werk +verbreitet oder zugänglich macht. + +Rechtsschutz: Diese Lizenz erlaubt nicht die Benutzung von Kennzeichen, Marken oder geschützten Namensrechten des +Lizenzgebers, soweit dies nicht für die angemessene und übliche Beschreibung der Herkunft des Werks und der +inhaltlichen Wiedergabe des Urheberrechtshinweises erforderlich ist. + + + 6. Urheber und Bearbeiter + +Der ursprüngliche Lizenzgeber gewährleistet, dass er das Urheberrecht am Originalwerk innehat oder dieses an ihn +lizenziert wurde und dass er befugt ist, diese Lizenz zu erteilen. + +Jeder Bearbeiter gewährleistet, dass er das Urheberrecht an den von ihm vorgenommenen Änderungen des Werks besitzt +und befugt ist, diese Lizenz zu erteilen. + +Jedes Mal, wenn Sie die Lizenz annehmen, erteilen Ihnen der ursprüngliche Lizenzgeber und alle folgenden Bearbeiter +eine Befugnis zur Nutzung ihrer Beiträge zum Werk unter den Bedingungen dieser Lizenz. + + + 7. Gewährleistungsausschluss + +Die Arbeit an diesem Werk wird laufend fortgeführt; es wird durch unzählige Bearbeiter ständig verbessert. Das Werk ist +nicht vollendet und kann daher Fehler („bugs“) enthalten, die dieser Art der Entwicklung inhärent sind. + +Aus den genannten Gründen wird das Werk unter dieser Lizenz „so, wie es ist“ ohne jegliche Gewährleistung zur +Verfügung gestellt. Dies gilt unter anderem — aber nicht ausschließlich — für Marktreife, Verwendbarkeit für einen +bestimmten Zweck, Mängelfreiheit, Richtigkeit sowie Nichtverletzung von anderen Immaterialgüterrechten als dem +Urheberrecht (vgl. dazu Artikel 6 dieser Lizenz). + +Dieser Gewährleistungsausschluss ist wesentlicher Bestandteil der Lizenz und Bedingung für die Einräumung von +Rechten an dem Werk. + + + 8. Haftungsausschluss/Haftungsbeschränkung + +Außer in Fällen von Vorsatz oder der Verursachung von Personenschäden haftet der Lizenzgeber nicht für direkte oder +indirekte, materielle oder immaterielle Schäden irgendwelcher Art, die aus der Lizenz oder der Benutzung des Werks +folgen; dies gilt unter anderem, aber nicht ausschließlich, für Firmenwertverluste, Produktionsausfall, Computerausfall +oder Computerfehler, Datenverlust oder wirtschaftliche Schäden, und zwar auch dann, wenn der Lizenzgeber auf die +Möglichkeit solcher Schäden hingewiesen wurde. Unabhängig davon haftet der Lizenzgeber im Rahmen der gesetzlichen +Produkthaftung, soweit die entsprechenden Regelungen auf das Werk anwendbar sind. + + + 9. Zusatzvereinbarungen + +Wenn Sie das Werk verbreiten, können Sie Zusatzvereinbarungen schließen, in denen Verpflichtungen oder +Dienstleistungen festgelegt werden, die mit dieser Lizenz vereinbar sind. Sie dürfen Verpflichtungen indessen nur in +Ihrem eigenen Namen und auf Ihre eigene Verantwortung eingehen, nicht jedoch im Namen des ursprünglichen +Lizenzgebers oder eines anderen Bearbeiters, und nur, wenn Sie sich gegenüber allen Bearbeitern verpflichten, sie zu +entschädigen, zu verteidigen und von der Haftung freizustellen, falls aufgrund der von Ihnen eingegangenen +Gewährleistungsverpflichtung oder Haftungsübernahme Forderungen gegen sie geltend gemacht werden oder eine +Haftungsverpflichtung entsteht. + + + 10. Annahme der Lizenz + +Sie können den Bestimmungen dieser Lizenz zustimmen, indem Sie das Symbol „Lizenz annehmen“ unter dem Fenster +mit dem Lizenztext anklicken oder indem Sie Ihre Zustimmung auf vergleichbare Weise in einer nach anwendbarem +Recht zulässigen Form geben. Das Anklicken des Symbols gilt als Anzeichen Ihrer eindeutigen und unwiderruflichen +Annahme der Lizenz und der darin enthaltenen Klauseln und Bedingungen. + +In gleicher Weise gilt als Zeichen der eindeutigen und unwiderruflichen Zustimmung die Ausübung eines Rechtes, das in +Artikel 2 dieser Lizenz angeführt ist, wie das Erstellen einer Bearbeitung oder die Verbreitung oder Zugänglichmachung +des Werks oder dessen Vervielfältigungen. + + + 11. Informationspflichten + +Wenn Sie das Werk verbreiten oder zugänglich machen (beispielsweise, indem Sie es zum Herunterladen von einer +Website anbieten), müssen Sie über den Vertriebskanal oder das benutzte Verbreitungsmedium der Öffentlichkeit +zumindest jene Informationen bereitstellen, die nach dem anwendbaren Recht bezüglich der Lizenzgeber, der Lizenz und +ihrer Zugänglichkeit, des Abschlusses des Lizenzvertrags sowie darüber, wie die Lizenz durch den Lizenznehmer +gespeichert und vervielfältigt werden kann, erforderlich sind. + + + 12. Beendigung der Lizenz + +Die Lizenz und die damit eingeräumten Rechte erlöschen automatisch, wenn der Lizenznehmer gegen die Lizenzbedingungen +verstößt. + +Ein solches Erlöschen der Lizenz führt nicht zum Erlöschen der Lizenzen von Personen, denen das Werk vom +Lizenznehmer unter dieser Lizenz zur Verfügung gestellt worden ist, solange diese Personen die Lizenzbedingungen +erfüllen. + + 13. Sonstiges + +Unbeschadet des Artikels 9 stellt die Lizenz die vollständige Vereinbarung der Parteien über das Werk dar. + +Sind einzelne Bestimmungen der Lizenz nach geltendem Recht nichtig oder unwirksam, so berührt dies nicht die +Wirksamkeit oder Durchsetzbarkeit der Lizenz an sich. Solche Bestimmungen werden vielmehr so ausgelegt oder +modifiziert, dass sie wirksam und durchsetzbar sind. + +Die Europäische Kommission kann weitere Sprachfassungen oder neue Versionen dieser Lizenz oder aktualisierte +Fassungen des Anhangs veröffentlichen, soweit dies notwendig und angemessen ist, ohne den Umfang der Lizenzrechte +zu verringern. Neue Versionen werden mit einer eindeutigen Versionsnummer veröffentlicht. + +Alle von der Europäischen Kommission anerkannten Sprachfassungen dieser Lizenz sind gleichwertig. Die Parteien +können sich auf die Sprachfassung ihrer Wahl berufen. + + + 14. Gerichtsstand + +Unbeschadet besonderer Vereinbarungen zwischen den Parteien gilt Folgendes: + +- Für alle Streitigkeiten über die Auslegung dieser Lizenz zwischen den Organen, Einrichtungen und sonstigen Stellen + der Europäischen Union als Lizenzgeber und einem Lizenznehmer ist der Gerichtshof der Europäischen Union + gemäß Artikel 272 des Vertrags über die Arbeitsweise der Europäischen Union zuständig; + +- Gerichtsstand für Streitigkeiten zwischen anderen Parteien über die Auslegung dieser Lizenz ist allein der Ort, an + dem der Lizenzgeber seinen Wohnsitz oder den wirtschaftlichen Mittelpunkt seiner Tätigkeit hat. + + + 15. Anwendbares Recht + +Unbeschadet besonderer Vereinbarungen zwischen den Parteien gilt Folgendes: + +- Diese Lizenz unterliegt dem Recht des Mitgliedstaats der Europäischen Union, in dem der Lizenzgeber seinen Sitz, + Wohnsitz oder eingetragenen Sitz hat; + +- diese Lizenz unterliegt dem belgischen Recht, wenn der Lizenzgeber keinen Sitz, Wohnsitz oder eingetragenen Sitz in + einem Mitgliedstaat der Europäischen Union hat. + + + Anlage + +„Kompatible Lizenzen“ nach Artikel 5 der EUPL sind: + + - GNU General Public License (GPL) v. 2, v. 3 + + - GNU Affero General Public License (AGPL) v. 3 + + - Open Software License (OSL) v. 2.1, v. 3.0 + + - Eclipse Public License (EPL) v. 1.0 + + - CeCILL v. 2.0, v. 2.1 + + - Mozilla Public Licence (MPL) v. 2 + + - GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3 + + - Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) für andere Werke als Software + + - European Union Public Licence (EUPL) v. 1.1, v. 1.2 + + - Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) oder Strong Reciprocity (LiLiQ-R+) + +- Die Europäische Kommission kann diesen Anhang aktualisieren, um neuere Fassungen der obigen Lizenzen + aufzunehmen, ohne hierfür eine neue Fassung der EUPL auszuarbeiten, solange diese Lizenzen die in Artikel 2 + gewährten Rechte gewährleisten und den erfassten Quellcode vor ausschließlicher Aneignung schützen. + +- Alle sonstigen Änderungen oder Ergänzungen dieses Anhangs bedürfen der Ausarbeitung einer neuen Version der + EUPL. + + + + + + +Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +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. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +This product includes cryptographic software written by Eric Young +(eay@cryptsoft.com). This product includes software written by Tim +Hudson (tjh@cryptsoft.com). + + +Original SSLeay License + +Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +All rights reserved. + +This package is an SSL implementation written +by Eric Young (eay@cryptsoft.com). +The implementation was written so as to conform with Netscapes SSL. + +This library is free for commercial and non-commercial use as long as +the following conditions are aheared to. The following conditions +apply to all code found in this distribution, be it the RC4, RSA, +lhash, DES, etc., code; not just the SSL code. The SSL documentation +included with this distribution is covered by the same copyright terms +except that the holder is Tim Hudson (tjh@cryptsoft.com). + +Copyright remains Eric Young's, and as such any Copyright notices in +the code are not to be removed. +If this package is used in a product, Eric Young should be given attribution +as the author of the parts of the library used. +This can be in the form of a textual message at program startup or +in documentation (online or textual) provided with the package. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +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. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] + + + + + + + Ergänzende Linzenzhinweise + +Die verwendeten OpenSource-Bibliotheken unterliegen den folgenden Nutzungsbedingungen: + +Qt + Lizenz: LGPL v3 + Version: 5.8.0 + Adresse: https://www.qt.io/ + +http_parser + Lizenz: MIT + Version: 2.7.1 + Adresse: https://github.com/nodejs/http-parser/ + + +Die Lizenztexte lauten in ihrer originalen Fassung wie folgt: + + + + + + GNU LESSER GENERAL PUBLIC LICENSE + +The Qt Toolkit is Copyright (C) 2016 The Qt Company Ltd. +Contact: http://www.qt.io/licensing/ + +You may use, distribute and copy the Qt Toolkit under the terms of +GNU Lesser General Public License version 3, which is displayed below. +This license makes reference to the version 3 of the GNU General +Public License, which you can find in the LICENSE.GPLv3 file. + +------------------------------------------------------------------------- + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies of this +licensedocument, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + +0. Additional Definitions. + +As used herein, “this License” refers to version 3 of the GNU Lesser +General Public License, and the “GNU GPL” refers to version 3 of the +GNU General Public License. + +“The Library” refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + +An “Application” is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + +A “Combined Work” is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the “Linked +Version”. + +The “Minimal Corresponding Source” for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + +The “Corresponding Application Code” for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + +1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + +2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort + to ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + +3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this + license document. + +4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken +together, effectively do not restrict modification of the portions of +the Library contained in the Combined Work and reverse engineering for +debugging such modifications, if you also do each of the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this + license document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of + this License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with + the Library. A suitable mechanism is one that (a) uses at run + time a copy of the Library already present on the user's + computer system, and (b) will operate properly with a modified + version of the Library that is interface-compatible with the + Linked Version. + + e) Provide Installation Information, but only if you would + otherwise be required to provide such information under section 6 + of the GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the Application + with a modified version of the Linked Version. (If you use option + 4d0, the Installation Information must accompany the Minimal + Corresponding Source and Corresponding Application Code. If you + use option 4d1, you must provide the Installation Information in + the manner specified by section 6 of the GNU GPL for conveying + Corresponding Source.) + +5. Combined Libraries. + +You may place library facilities that are a work based on the Library +side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities, conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of + it is a work based on the Library, and explaining where to find + the accompanying uncombined form of the same work. + +6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +as you received it specifies that a certain numbered version of the +GNU Lesser General Public License “or any later version” applies to +it, you have the option of following the terms and conditions either +of that published version or of any later version published by the +Free Software Foundation. If the Library as you received it does not +specify a version number of the GNU Lesser General Public License, +you may choose any version of the GNU Lesser General Public License +ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the Library. + + + + + + +http_parser.c is based on src/http/ngx_http_parse.c from NGINX copyright +Igor Sysoev. + +Additional changes are licensed under the same terms as NGINX and +copyright Joyent, Inc. and other Node contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/LICENSE.txt b/LICENSE.txt index 3bb7c6e..ff3dee9 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,56 +1,6 @@ -Nutzungsbedingungen - -Allgemeines zur Installation - -Bitte lesen Sie zunächst die Allgemeinen Geschäftsbedingungen so wie die Lizenzbedingungen für die Überlassung und Nutzung der AusweisApp2 durch. Nachdem Sie zugestimmt haben, können Sie die Installation fortsetzen. - - - Allgemeine Geschäftsbedingungen - -§ 1 Nutzungsbedingungen und Datenschutzhinweis -(1) Diese Allgemeine Geschäftsbedingungen (AGB) des Bundes, vertreten durch das Bundesministerium des Innern (nachfolgend "Bund") und dem Nutzer gelten für die Überlassung und Nutzung der Software AusweisApp2 (nachfolgend AusweisApp2) und deren neue Versionen, die auf der Grundlage dieser Bedingungen überlassen werden. -(2) "Nutzer" im Sinne dieses Vertrages sind natürliche Personen. - -§ 2 Vertragsgegenstand und Unentgeltlichkeit -(1) Die AusweisApp2 wird regelmäßig hinsichtlich ihrer Konformität zu den Technischen Richtlinien des Bundesamtes für Sicherheit in der Informationstechnik [TR-03124-2] zertifiziert sowie hinsichtlich ihrer Nutzerfreundlichkeit [EN ISO 9241 Teil 110 Ergonomie Mensch-System-Integration zur Prüfung der Benutzbarkeit und Funktionalität und Trusted Design Guidelines zur Prüfung der Vertrauenswürdigkeit] und auf Barrierefreiheit [BITV 2.0] überprüft. -(2) Die AusweisApp2 wird in maschinenlesbarer Form unentgeltlich überlassen. Der Quellcode der AusweisApp2 wird ebenfalls unentgeltlich veröffentlicht. Eine Auflistung der verwendeten Open Source-Bestandteile der AusweisApp2 findet sich im Anhang. -(3) Die AusweisApp2 wird von der Governikus GmbH & Co. KG (Governikus) als Erfüllungsgehilfe des Bundes überlassen. - -§ 3 Verwendungszweck -Die AusweisApp2 und alle ihre Bestandteile dienen ausschließlich dazu, im Zusammenhang mit der Nutzung der Online-Ausweisfunktion des Personalausweises bzw. des elektronischen Aufenthaltstitels und der Übermittlung der damit verbundenen Daten gemäß den gesetzlichen Vorgaben verwendet zu werden. - -§ 4 Pflichten und Obliegenheiten des Nutzers -(1) Der Nutzer verpflichtet sich, die AusweisApp2 entsprechend des in § 3 genannten Verwendungszweckes zu nutzen. Es liegt in seinem Interesse, dass in Verbindung mit der AusweisApp2 genutzte Hard- und Software des Nutzers immer auf dem neuesten Stand der Sicherheitstechnik (System- und Firmware Update, Virenscanner, Firewall usw.) sind. -(2) Es liegt im eigenen Interesse des Nutzers aber auch des Bundes, dass stets nur die neueste Version der AusweisApp2 (siehe § 5) verwendet wird. - -§ 5 Pflege und Support -(1) Der Bund bietet nach eigenem Ermessen und ohne hierzu verpflichtet zu sein für Teile der AusweisApp2 zusätzliche kostenfreie Supportleistungen in Form von Dokumentationen und online Hilfen auf dem AusweisApp2-Portal im Internet unter der Adresse www.ausweisapp.bund.de an, sowie über die Hotline des Herstellers Governikus unter der E-Mail-Adresse: support@ausweisapp.de und der Tel.-Nr.: +49 1805 348 743. Auch stellt er verfügbare neue Versionen der AusweisApp2 zur Verfügung. Hieraus erwächst jedoch kein zusätzlicher Anspruch auf Mängelbeseitigung, auf Zertifizierung, auf Beibehaltung der Supportleistungen oder der Hotline und auf Überlassung neuer Versionen. -(2) Verfügbare neue Versionen der AusweisApp2 können im Internet kostenfrei auf dem AusweisApp2-Portal unter der Adresse www.ausweisapp.bund.de sowie über allgemein zugängliche AppStore heruntergeladen werden. -(3) Eventuelle Mängel der AusweisApp2 werden grundsätzlich dadurch behoben, dass der Bund jeweils eine neue Version der AusweisApp2 zum Herunterladen zur Verfügung stellt (siehe § 5 Absatz 1). Eine Pflicht zur Bereitstellung von neuen Versionen ergibt sich daraus grundsätzlich nicht. - -§ 6 Hinweis auf gewerbliche und urheberrechtliche Schutzrechte -Die Zeichen AusweisApp2 und die entsprechenden Grafiken sowie das Signet zur Online-Ausweisfunktion sind für den Bund als Marken geschützt. - -§ 7 Datenschutzhinweis -(1) Mit dieser Software werden personenbezogene Daten im Sinne des § 3 Absatz 1 des Bundesdatenschutzgesetzes (BDSG) zum Zwecke der Verarbeitung grundsätzlich nicht erhoben. -(2) Personenbezogene Daten aus dem Ausweischip werden ausschließlich zum Zweck des elektronischen Identitätsnachweises im Umfang der erteilten Berechtigung nach Einwilligung des Nutzers mit seiner Ausweis-PIN-Eingabe und auf dem Transportweg zwischen dem Ausweischip und dem Diensteanbieter sicher verschlüsselt und auch für Governikus nicht lesbar übertragen. -(3) Neben den reinen Daten, die zur Identifizierung/ Authentisierung benötigt werden, erhebt die Software nur mit Einverständnis des Nutzers Daten über die Art und Version der Anwendungsumgebung (Betriebssystem, Lesegeräte usw.) des Nutzers. Diese Daten kann der Nutzer bei Bedarf an Governikus übermitteln, um die ordnungsgemäße Verarbeitung prüfen zu lassen und Fehlern im Verarbeitungsprozess vorzubeugen. Die Nutzung der Daten erfolgt dann im Rahmen des § 14 BDSG durch Governikus im Auftrag des Bundes und nur für den genannten Zweck. -(4) Die in der AusweisApp2 enthaltene Selbstauskunft über die im Chip gespeicherten Daten, ist ein Dienst der durch Governikus über das Internet erbracht wird. Die Ausweisdaten werden dabei nur zur Anzeige des Nutzers gebracht und nicht dauerhaft bei Governikus gespeichert oder für andere Zwecke verwendet. - -§ 8 Deutsches Recht -Auf diese Nutzungsbedingungen ist ausschließlich deutsches Recht unter Ausschluss des Übereinkommens der Vereinten Nationen über Verträge über den internationalen Warenkauf (CISG) anwendbar. - - -Anhang - -Eingearbeitete Open Source-Komponenten -Qt, OpenSSL und http_parser. - - - Lizenzbedingungen -Die AusweisApp2 und ihr Quellcode werden unter der EUPL v1.2 bereitgestellt, mit Ausnahme der Open-Source-Bibliothek OpenSSL, die unter der OpenSSL License / SSLeay License lizensiert ist. +Der Quellcode der AusweisApp2 wird unter der EUPL v1.2 bereitgestellt, mit Ausnahme der Bibliothek OpenSSL, die unter der OpenSSL License / SSLeay License lizensiert ist. diff --git a/README.rst b/README.rst index 20b52dd..6857986 100644 --- a/README.rst +++ b/README.rst @@ -9,6 +9,15 @@ Kontakt | ausweisapp2@governikus.de +Lizenz +------ +Der vorliegende Quellcode wird unter der EUPL v1.2 bereitgestellt, mit +Ausnahme der Bibliothek OpenSSL, die unter der OpenSSL License / SSLeay License +lizensiert ist. Die Datei ``LICENSE.officially.txt`` gilt ausschließlich für +die offizielle Version der AusweisApp2, welche von der Governikus GmbH & Co. KG +im Auftrag des Bundes unter https://www.ausweisapp.bund.de bereitgestellt wird. + + Toolchain / Bibliotheken ------------------------ Die Einrichtung der Toolchain wird im Unterordner ``./libs`` @@ -22,8 +31,8 @@ Derzeit ist es leider noch nicht möglich, die AusweisApp2 ohne Patches an OpenSSL und Qt voll funktionsfähig auszuliefern. Dies liegt unter anderem an dem notwendigen RSA-PSK-Patch für OpenSSL 1.0.2, welcher mit OpenSSL 1.1.0 nicht mehr notwendig ist. -Diese OpenSSL-Version wird allerdings voraussichtlich erst mit Qt 5.10 -bzw. 5.9.2 unterstützt. (siehe https://bugreports.qt.io/browse/QTBUG-52905) +Diese OpenSSL-Version wird allerdings erst mit Qt 5.10 unterstützt. +(siehe https://bugreports.qt.io/browse/QTBUG-52905) OpenSSL 1.1.0 wird mit der AusweisApp2 1.14.0 unterstützt. LibreSSL wird auf Grund des fehlenden RSA-PSK nicht unterstützt. @@ -40,8 +49,8 @@ Dazu kann die Variable *CMAKE_PREFIX_PATH* verwendet werden um die Toolchain CMa bekannt zu machen. Alternativ zu %PATH% bzw. $PATH können alle Ordner, die dort für den Build eingetragen wurden, über diesen Mechanismus an CMake übergeben werden. -Als Generator für Makefiles sollte eine Variante von "MinGW Makefiles" gewählt -werden. +Als Generator für Makefiles sollte unter Windows eine Variante von "MinGW Makefiles" +gewählt werden. Beim Generieren des Makefiles ist zu beachten, dass die AusweisApp2 nur sogenannte "out of source tree"-Builds erlaubt. Daher ist die empfohlene Variante von CMake @@ -76,7 +85,6 @@ Beispiel über die CLI: -- BUILD_SHARED_LIBS: OFF -- Found OpenSSL: C:/Toolchain/lib/libssl.dll.a;C:/Toolchain/lib/libcrypto.dll.a (found suitable version "1.0.1i", minimum required is "1.0.1") -- Found Hg: C:/Program Files/TortoiseHg/hg.exe (found version "3.1.1") - -- PLATFORM_WIDGETS: WINDOWS -- Configuring done -- Generating done -- Build files have been written to: C:/build @@ -124,19 +132,19 @@ eingebettet werden kann. Zu beachten ist vor allem, dass in der Umgebungsvariabl eingerichtet ist. Im Ordner "~/Library/MobileDevice/Provisioning Profiles" sind diese ebenfalls einsehbar. Unter Umständen kann es zu Berechtigungsproblemen mit XCode und den Zugriff auf -die Keys kommen. Dabei ist es oft hilfreich die Keys im MacOS-Schlüsselbund +die Keys kommen. Dabei ist es oft hilfreich die Keys im macOS-Schlüsselbund freizuschalten bzw. den Schlüsselbund freizugeben. security unlock-keychain -pPASSWORD ${HOME}/Library/Keychains/login.keychain -Unter iOS wird die AusweisApp2 mittels XCode gebaut! +Für iOS wird die AusweisApp2 mittels XCode gebaut! :: $ cd build $ cmake -DCMAKE_PREFIX_PATH=/Users/governikus/Toolchain/dist -DCMAKE_TOOLCHAIN_FILE=../AusweisApp2/cmake/iOS.toolchain.cmake -DCMAKE_BUILD_TYPE=release ../AusweisApp2 -GXcode - $ cmakexbuild install -configuration Release - $ cmakexbuild -target ipa + $ xcodebuild -target install -configuration Release + $ xcodebuild -target ipa -configuration Release Im Build-Ordner befindet sich nun eine "AusweisApp2-x.y.z.ipa" Datei, welches das @@ -152,7 +160,7 @@ Nachdem die Build-Umgebung eingerichtet ist, kann je nach System ein Package ers notwendig. Mittels "mingw32-make package" wird die AusweisApp2 gebaut und ein MSI Paket bereitgestellt. -- Unter MacOS wird mittels "make package" die AusweisApp2 gebaut und ein DMG bereitgestellt. +- Unter macOS wird mittels "make package" die AusweisApp2 gebaut und ein DMG bereitgestellt. - Um ein APK für Android zu bauen, sind zwei Schritte notwendig, da CMake das Format bisher nicht unterstützt. Daher sind nach der Konfiguration des Projektes folgende Befehle notwendig @@ -162,72 +170,3 @@ Nachdem die Build-Umgebung eingerichtet ist, kann je nach System ein Package ers $ make install $ make apk - - - -Release -------- -Folgende Schritte sind notwendig um ein Tag bzw. Release zu bauen. - - -Tag anbringen -^^^^^^^^^^^^^ - -#. Mittels "hg update -r stable" auf das jeweilige Changeset wechseln, welches mit einem - Tag versehen werden soll. - -#. Mittels "hg status" überprüfen, dass keine weiteren Änderungen in der Working-Copy - vorhanden sind. - -#. In der Datei CMakeLists.txt die PROJECT_VERSION im PROJECT entsprechend anpassen. - -#. Mittels "hg tag x.y.z" (Beispiel: hg tag 1.0.0) den Tag anbringen. - -#. Mittels "hg bookmark -r x.y.z release" das Bookmark verschieben, damit der Jenkins beim - Release-Build den aktuellen Tag findet. - -#. Mittels "hg push" ins Main-Repository übertragen. - - - -Tag bauen -^^^^^^^^^ -Wichtig: Der Jenkins erstellt das Release anhand des Bookmarks "release". - Die Jobs müssen nach dem Setzen manuell gestartet werden! - Nachdem die Jobs für Windows und MacOS durchgelaufen sind, muss - der Job für den AppCast gestartet werden. - -Für einen sauberen Build sollte folgendes Vorgehen angewandt werden. -Beim Durchlauf von CMake wird, sofern die Versionsverwaltung vorhanden ist, der Mercurial-Tag -angezeigt. - -#. Mittels "hg clone -r x.y.z http://mercurial/AusweisApp2" den Tag ausschecken. - - - **Wichtig:** Wenn ein bestehender Clone mittels "hg update -r x.y.z" benutzt wird, - sollte mit "hg status -i" geprüft werden, ob die Working-Copy vollständig sauber ist! - -#. Einen build-Ordner erstellen und in den Ordner wechseln. Zum Beispiel /tmp/buildTagXYZ - -#. cmake -DCMAKE_BUILD_TYPE=release ../AusweisApp2 - -#. make package_source - -#. make package - - - -Probleme & Lösungen -^^^^^^^^^^^^^^^^^^^ - -- Das gebaute Package beinhaltet einen Hashwert im Namen - - CMake hat erkannt, dass sich die aktuelle Working-Copy nicht auf dem Tag befindet und hängt - somit den Hashwert des Changesets an. Mittels "hg id -t" kann man überprüfen, ob man sich auf - dem Tag befindet. - - - Mittels "hg update -r x.y.z" sollte man auf den Tag wechseln. - -- Hinter dem Hashwert ist ein + - - Das bedeutet, dass "uncommitted changes" während des Builds in der Working-Copy enthalten waren. - - - Dies kann man mittels "hg status" überprüfen. - diff --git a/Releasing.rst b/Releasing.rst new file mode 100644 index 0000000..bcf2d8a --- /dev/null +++ b/Releasing.rst @@ -0,0 +1,49 @@ +Release +======= +Folgende Schritte sind notwendig um ein Tag bzw. Release zu bauen. + + +Tag anbringen +------------- +#. Mittels "hg update -r stable" auf das jeweilige Changeset wechseln, welches mit einem + Tag versehen werden soll. + +#. Mittels "hg status" überprüfen, dass keine weiteren Änderungen in der Working-Copy + vorhanden sind. + +#. In der Datei CMakeLists.txt die PROJECT_VERSION im PROJECT entsprechend anpassen. + +#. Mittels "hg tag x.y.z" (Beispiel: hg tag 1.0.0) den Tag anbringen. + +#. Mittels "hg push" ins Main-Repository übertragen. + + + +Tag bauen +--------- +Die Release-Jobs müssen nach dem Tag manuell gestartet werden! + +Jenkins erstellt das Release anhand des Bookmarks "release" oder des tags/changesets, +welcher als Parameter übergeben wird. +Nachdem die notwendigen Jobs (Windows/macOS/Docs/...) durchgelaufen sind, muss der Job +für den AppCast gestartet werden. + +Im Ordner ``resources/jenkins/dsl`` sind die jeweiligen Konfigurationen der Jenkins-Jobs +hinterlegt. + + + +Probleme & Lösungen +------------------- +- Das gebaute Package beinhaltet einen Hashwert im Namen + - CMake hat erkannt, dass sich die aktuelle Working-Copy nicht auf dem Tag befindet und hängt + somit den Hashwert des Changesets an. Mittels "hg id -t" kann man überprüfen, ob man sich auf + dem Tag befindet. + + - Mittels "hg update -r x.y.z" sollte man auf den Tag wechseln. + +- Hinter dem Hashwert ist ein + + - Das bedeutet, dass "uncommitted changes" während des Builds in der Working-Copy enthalten waren. + + - Dies kann man mittels "hg status" überprüfen. + diff --git a/cmake/DVCS.cmake b/cmake/DVCS.cmake index 9a970cf..11b40c8 100644 --- a/cmake/DVCS.cmake +++ b/cmake/DVCS.cmake @@ -50,7 +50,7 @@ MACRO(CHECK_DVCS) IF(HG_FOUND) DVCS_CALL("tag" "" id -t) ELSEIF(GIT_FOUND) - DVCS_CALL("tag" "" name-rev --tags --name-only HEAD) + DVCS_CALL("tag" "" tag -l --points-at HEAD) ENDIF() IF(NOT "${dvcs_tag}" STREQUAL "tip" AND NOT "${dvcs_tag}" STREQUAL "" AND NOT "${dvcs_tag}" STREQUAL "undefined") IF(NOT dvcs_tag STREQUAL PROJECT_VERSION) @@ -93,8 +93,8 @@ MACRO(GET_DVCS_INFO) DVCS_CALL("revision" "-" id -i) ELSEIF(GIT_FOUND) DVCS_CALL("revision" "-" rev-parse --verify --short HEAD) - DVCS_EXECUTE(dvcs_dirty_wc diff --shortstat) - IF(DEFINED dvcs_dirty_wc) + DVCS_EXECUTE(dvcs_clean_wc diff-index --quiet HEAD) + IF(NOT DEFINED dvcs_clean_wc) MESSAGE(STATUS "DVCS: dirty working copy") SET(dvcs_revision ${dvcs_revision}+) SET(VERSION_DVCS ${VERSION_DVCS}+) diff --git a/cmake/Install.cmake b/cmake/Install.cmake index 0ee00b0..eb8e9c5 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -139,9 +139,12 @@ ELSEIF(ANDROID) INSTALL(TARGETS AusweisApp DESTINATION ${ANDROID_DEST} ${PERMISSIONS} COMPONENT Application) SET(RESOURCES_IMG_ANDROID_DIR ${RESOURCES_DIR}/images/android) - IF(IS_DEVELOPER_VERSION) - SET(ANDROID_LAUNCHER_ICON "npa_beta.png") + IF(BUILD_PREVIEW) + SET(ANDROID_LAUNCHER_ICON "npa_preview.png") SET(ANDROID_PACKAGE_NAME "com.governikus.ausweisapp2.dev") + ELSEIF(IS_DEVELOPER_VERSION) + SET(ANDROID_LAUNCHER_ICON "npa_beta.png") + SET(ANDROID_PACKAGE_NAME "com.governikus.ausweisapp2") ELSE() SET(ANDROID_LAUNCHER_ICON "npa.png") SET(ANDROID_PACKAGE_NAME "com.governikus.ausweisapp2") diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index 203c8e6..ecaa56a 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -35,7 +35,12 @@ SET(CPACK_PACKAGE_CONTACT "info@governikus.com") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Governikus AusweisApp2") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.rst") SET(CPACK_PACKAGE_FILE_NAME ${FILENAME}) -SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt") + +IF(VENDOR_GOVERNIKUS) + SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.officially.txt") +ELSE() + SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt") +ENDIF() IF(APPLE AND NOT IOS) FIND_PROGRAM(ICONV iconv) @@ -55,6 +60,7 @@ SET(CPACK_SOURCE_GENERATOR TGZ) SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${FILENAME} CACHE INTERNAL "tarball basename") SET(CPACK_SOURCE_IGNORE_FILES "\\\\.hgignore" "\\\\.hgtags" "/\\\\.hg/") +LIST(APPEND CPACK_SOURCE_IGNORE_FILES "\\\\.gitignore" "/\\\\.git/") LIST(APPEND CPACK_SOURCE_IGNORE_FILES "vendor.txt") LIST(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR}") LIST(APPEND CPACK_SOURCE_IGNORE_FILES "CMakeCache.txt") @@ -90,11 +96,6 @@ IF(WIN32) ENDIF() ELSEIF(IOS) - FIND_PROGRAM(xcrun xcrun CMAKE_FIND_ROOT_PATH_BOTH) - IF(NOT xcrun) - MESSAGE(FATAL_ERROR "Cannot find xcrun to create IPAs") - ENDIF() - FILE(WRITE ${PROJECT_BINARY_DIR}/ipa.cmake " SET(BUNDLE_DIRS \"\${CONFIG}-iphoneos;UninstalledProducts;UninstalledProducts/iphoneos\") @@ -112,7 +113,9 @@ ELSEIF(IOS) MESSAGE(FATAL_ERROR \"Bundle directory does not exist\") ENDIF() - EXECUTE_PROCESS(COMMAND ${xcrun} -sdk iphoneos PackageApplication \${BundleDir} -o ${PROJECT_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.ipa) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_directory \${BundleDir} Payload/AusweisApp2.app) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar cf \"${CPACK_PACKAGE_FILE_NAME}.ipa\" --format=zip Payload) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E remove_directory Payload) ") ADD_CUSTOM_TARGET(ipa COMMAND ${CMAKE_COMMAND} -DCONFIG=$ -P ${CMAKE_BINARY_DIR}/ipa.cmake) diff --git a/cmake/Tools.cmake b/cmake/Tools.cmake index f527052..a6df4de 100644 --- a/cmake/Tools.cmake +++ b/cmake/Tools.cmake @@ -140,7 +140,7 @@ IF(UNCRUSTIFY) EXECUTE_PROCESS(COMMAND ${UNCRUSTIFY} --version OUTPUT_VARIABLE UNCRUSTIFY_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) STRING(REPLACE "uncrustify " "" UNCRUSTIFY_VERSION ${UNCRUSTIFY_VERSION}) - SET(UNCRUSTIFY_NEEDED_VERSION "0.64") + SET(UNCRUSTIFY_NEEDED_VERSION "0.65") IF("${UNCRUSTIFY_VERSION}" STRLESS "${UNCRUSTIFY_NEEDED_VERSION}") MESSAGE(WARNING "Uncrustify seems to be too old. Use at least ${UNCRUSTIFY_NEEDED_VERSION}... you are using: ${UNCRUSTIFY_VERSION}") ELSE() @@ -200,6 +200,12 @@ IF(CONVERT) COMMAND ${CONVERT_CMD} npa_beta.svg -resize 96x96 android/xhdpi/npa_beta.png COMMAND ${CONVERT_CMD} npa_beta.svg -resize 144x144 android/xxhdpi/npa_beta.png COMMAND ${CONVERT_CMD} npa_beta.svg -resize 192x192 android/xxxhdpi/npa_beta.png + COMMAND ${CONVERT_CMD} npa_preview.svg -resize 36x36 android/ldpi/npa_preview.png + COMMAND ${CONVERT_CMD} npa_preview.svg -resize 48x48 android/mdpi/npa_preview.png + COMMAND ${CONVERT_CMD} npa_preview.svg -resize 72x72 android/hdpi/npa_preview.png + COMMAND ${CONVERT_CMD} npa_preview.svg -resize 96x96 android/xhdpi/npa_preview.png + COMMAND ${CONVERT_CMD} npa_preview.svg -resize 144x144 android/xxhdpi/npa_preview.png + COMMAND ${CONVERT_CMD} npa_preview.svg -resize 192x192 android/xxxhdpi/npa_preview.png WORKING_DIRECTORY ${RESOURCES_DIR}/images) ENDIF() @@ -229,6 +235,12 @@ SET(PNGQUANT_CMD pngquant -f -o) COMMAND ${PNGQUANT_CMD} android/xhdpi/npa_beta.png -- android/xhdpi/npa_beta.png COMMAND ${PNGQUANT_CMD} android/xxhdpi/npa_beta.png -- android/xxhdpi/npa_beta.png COMMAND ${PNGQUANT_CMD} android/xxxhdpi/npa_beta.png -- android/xxxhdpi/npa_beta.png + COMMAND ${PNGQUANT_CMD} android/ldpi/npa_preview.png -- android/ldpi/npa_preview.png + COMMAND ${PNGQUANT_CMD} android/mdpi/npa_preview.png -- android/mdpi/npa_preview.png + COMMAND ${PNGQUANT_CMD} android/hdpi/npa_preview.png -- android/hdpi/npa_preview.png + COMMAND ${PNGQUANT_CMD} android/xhdpi/npa_preview.png -- android/xhdpi/npa_preview.png + COMMAND ${PNGQUANT_CMD} android/xxhdpi/npa_preview.png -- android/xxhdpi/npa_preview.png + COMMAND ${PNGQUANT_CMD} android/xxxhdpi/npa_preview.png -- android/xxxhdpi/npa_preview.png WORKING_DIRECTORY ${RESOURCES_DIR}/images) ENDIF() diff --git a/docs/releasenotes/1.12.3.rst b/docs/releasenotes/1.12.3.rst new file mode 100644 index 0000000..a47f451 --- /dev/null +++ b/docs/releasenotes/1.12.3.rst @@ -0,0 +1,22 @@ +AusweisApp2 1.12.3 +^^^^^^^^^^^^^^^^^^ + +**Releasedatum:** 15. September 2017 + + +Anwender +"""""""" + - Anzeige des Verwendungszwecks korrigiert. + + - Anbieterliste beinhaltet nur noch die Anbieter + der aktuellen Plattform. + + - Unterstützung von arm64-v8a. + + +Entwickler +"""""""""" + - Finale API des eingebetteten SDKs. + + - Anpassung der verschiedenen README-Dateien um + die AusweisApp2 selbst zu bauen. diff --git a/docs/releasenotes/appcast.rst b/docs/releasenotes/appcast.rst index a1c0a4f..c7a14fb 100644 --- a/docs/releasenotes/appcast.rst +++ b/docs/releasenotes/appcast.rst @@ -4,6 +4,7 @@ Release Notes .. toctree:: :maxdepth: 1 + 1.12.3 1.12.2 1.12.1 1.12.0 diff --git a/docs/releasenotes/conf.py.in b/docs/releasenotes/conf.py.in index f1dacbc..c8bdc2a 100644 --- a/docs/releasenotes/conf.py.in +++ b/docs/releasenotes/conf.py.in @@ -42,7 +42,7 @@ master_doc = 'index' # General information about the project. project = 'AusweisApp2' -copyright = '2016, Governikus GmbH & Co. KG' +copyright = '2016-2017, Governikus GmbH & Co. KG' author = 'Governikus GmbH & Co. KG' # The version info for the project you're documenting, acts as replacement for @@ -145,7 +145,7 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'AusweisApp2_ReleaseNotes.tex', 'AusweisApp2 Release Notes', + (master_doc, 'AusweisApp2-@VERSION_DVCS@-ReleaseNotes.tex', 'AusweisApp2 Release Notes', 'Governikus GmbH \& Co. KG', 'howto'), ] diff --git a/docs/releasenotes/singlehtml.conf.py.in b/docs/releasenotes/singlehtml.conf.py.in index 16842a3..cda68ef 100644 --- a/docs/releasenotes/singlehtml.conf.py.in +++ b/docs/releasenotes/singlehtml.conf.py.in @@ -42,7 +42,7 @@ master_doc = 'appcast' # General information about the project. project = 'AusweisApp2' -copyright = '2016, Governikus GmbH & Co. KG' +copyright = '2016-2017, Governikus GmbH & Co. KG' author = 'Governikus GmbH & Co. KG' # The version info for the project you're documenting, acts as replacement for diff --git a/docs/releasenotes/support.rst b/docs/releasenotes/support.rst index 6b443a9..7ffc2f0 100644 --- a/docs/releasenotes/support.rst +++ b/docs/releasenotes/support.rst @@ -8,6 +8,8 @@ der AusweisApp2 unterstützt. Betriebssysteme """"""""""""""" + - OS X 10.9 + - OS X 10.10 - OS X 10.11 @@ -20,10 +22,23 @@ Betriebssysteme - Windows 10 (64bit) + - Android 4.3 und höher (x86, armeabi-v7a, arm64-v8a) + +Karten +"""""" + - Neuer Personalausweis + + - Elektronischer Aufenthaltstitel + + + +macOS / Windows +""""""""""""""" + Browser -""""""" +~~~~~~~ Das BSI hat die Online-Ausweisfunktion als einen Aufruf konzipiert, der unabhängig vom verwendeten Browser ist. Durch die strikte Einhaltung der Vorgaben aus den entsprechenden Technischen Richtlinie @@ -33,9 +48,9 @@ und sollte daher mit allen marktüblichen Browsern verwendet werden können. Im Rahmen der Qualitätssicherung werden die folgenden Browserversionen getestet. - - Firefox 54 + - Firefox 55 - - Chrome 59 + - Chrome 61 - Internet Explorer 11 @@ -43,14 +58,18 @@ getestet. -Kartenleser -""""""""""" -Alle Kartenlesegeräte, die die Onlineausweisfunktionalität unterstützen und nach +Kartenlesegeräte +~~~~~~~~~~~~~~~~ +Alle Kartenlesegeräte, die die Onlineausweisfunktionalität unterstützen und nach BSI TR-03119 zertifiziert sind. Details hierzu befinden sich auf der Homepage des BSI unter "Nach Technischen Richtlinien zertifizierte Produkte". Zusätzlich werden folgende nicht zertifizierte Kartenleser getestet. + - Cherry TC-1200 + + - Cherry TC-1300 + - Identiv Cloud 4701 F - Identiv SCL3711 @@ -59,10 +78,6 @@ Zusätzlich werden folgende nicht zertifizierte Kartenleser getestet. - Identiv CLOUD 4700 F - - ST-1200-CR3 / ST-1275 - - - SDI Cloud uTrust 4700 F - - ACR1252U - OMNIKEY 5021 CL @@ -73,12 +88,38 @@ Zusätzlich werden folgende nicht zertifizierte Kartenleser getestet. Aktuelle Informationen zu Kartenlesern finden Sie auf unserer Webseite: -https://www.ausweisapp.bund.de/informieren/voraussetzungen/ +https://www.ausweisapp.bund.de/fragen-und-antworten/voraussetzungen/ -Karten -"""""" - - Neuer Personalausweis +Android +""""""" - - Elektronischer Aufenthaltstitel +Browser +~~~~~~~ +Das BSI hat die Online-Ausweisfunktion als einen Aufruf konzipiert, +der unabhängig vom verwendeten Browser ist. Durch die strikte +Einhaltung der Vorgaben aus den entsprechenden Technischen Richtlinie +des BSI (BSI TR-03124) ist die AusweisApp2 generell browserunabhängig. +Im mobilen Umfeld ist die Funktionalität jedoch abhängig von der vom +Diensteanbieter umgesetzten Aktivierung. Daher empfehlen wir einen der +folgenden Browser zu verwenden. + + - Firefox Klar 1.3 + + - Chrome 61 + + - Android System WebView 60 + + + +Kartenlesegeräte +~~~~~~~~~~~~~~~~ +Alle NFC-fähigen Smartphones bzw. Tablets, die die Onlineausweisfunktionalität +unterstützen. Details hierzu befinden sich auf der Homepage: +https://www.ausweisapp.bund.de/mobile-geraete/ + +Darüber hinaus ist die Verwendung eines Bluetooth-Kartenlesegeräts möglich. +Folgendes Bluetooth-Kartenlesegerät wird von der AusweiApp2 unterstützt: + + - cyberJack wave diff --git a/docs/releasenotes/versions.rst b/docs/releasenotes/versions.rst index d554d8e..a3c8058 100644 --- a/docs/releasenotes/versions.rst +++ b/docs/releasenotes/versions.rst @@ -6,6 +6,7 @@ Versionszweig 1.12 .. toctree:: :maxdepth: 1 + 1.12.3 1.12.2 1.12.1 1.12.0 diff --git a/docs/sdk/android.rst b/docs/sdk/android.rst index ee3fb2b..22e5b9f 100644 --- a/docs/sdk/android.rst +++ b/docs/sdk/android.rst @@ -61,9 +61,9 @@ to send JSON commands to the SDK and to pass discovered NFC tags to the SDK. The second AIDL interface is given to the SDK by the client application. It enables the client to receive the intial session parameters as well as -JSON messages -from the SDK. Both interfaces are listed below and you need to import them into -your build environment. +JSON messages from the SDK. Furthermore it has a function which is called +when an existing connection with the SDK is dropped by the SDK. Both interfaces +are listed below and you need to import them into your build environment. .. seealso:: @@ -101,6 +101,7 @@ Callback { void sessionIdGenerated(String pSessionId, boolean pIsSecureSessionId); void receive(String pJson); + void sdkDisconnected(); } @@ -124,7 +125,7 @@ fingerprint of the authentic SDK certificate is the following: .. code-block:: text - B0:2A:C7:6B:50:A4:97:AE:81:0A:EA:C2:25:98:18:7B:3D:42:90:27:7D:08:51:A7:FA:8E:1A:EA:5A:97:98:70 + B0 2A C7 6B 50 A4 97 AE 81 0A EA C2 25 98 18 7B 3D 42 90 27 7D 08 51 A7 FA 8E 1A EA 5A 97 98 70 @@ -187,15 +188,17 @@ To differentiate between different connected clients, virtual sessions are used once the binding is completed. These sessions are discussed in a separate section, section :ref:`android_create_session`. +.. seealso:: + :ref:`android_disconnect_sdk` + Create connection ^^^^^^^^^^^^^^^^^ -First of all, in order to bind to the service, one needs to instantiate an -Android ServiceConnection. -Subsequently, the object is passed to the Android API and the contained -methods are invoked -by Android on service connection and disconnection. +First of all, in order to bind to the service, one needs to instantiate +an Android ServiceConnection. Subsequently, the object is passed to the +Android API and the contained methods are invoked by Android on service +connection and disconnection. .. code-block:: java @@ -223,13 +226,12 @@ by Android on service connection and disconnection. Bind service to raw connection ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -In order to perform the actual binding a directed Intent, which identifies -the AusweisApp2 SDK, is created. -This Intent is send to -the Android API along with the ServiceConnection created above. +In order to perform the actual binding a directed Intent, which +identifies the AusweisApp2 SDK, is created. This Intent is send +to the Android API along with the ServiceConnection created above. This API call either starts up the SDK if it is the first client, -or connects to the running SDK instance -if there is already another client bound. +or connects to the running SDK instance if there is already +another client bound. .. code-block:: java @@ -355,11 +357,17 @@ connected clients. There is a maximum of one established session at a time. In order to open a session with the SDK you need to pass an instance of **IAusweisApp2SdkCallback** to the **connectSdk** function of your previously acquired instance of **IAusweisApp2Sdk**. If your callback is accepted, -the function returns true. Otherwise there is another session connected. +the function returns true. Otherwise there is a problem with your supplied callback. Sessions will be disconnected once the IBinder instance of the connected client is -invalidated or another communication error occurs. Please see +invalidated, another communication error occurs or another Client connects. Please see :ref:`android_disconnect_sdk` for instructions to gracefully disconnect from the SDK. +As mentioned above: If there already is a connected client and a second client attempts +to connect, the first client is disconnected and the second client is granted exclusive +access to the SDK. The first client is informed via its callback by **sdkDisconnected**. +The second client is presented a fresh environment and it has no access to any data of +the first client. + If you have successfully established a session, the **sessionIdGenerated** function of your callback is invoked. With this invocation you receive two arguments. **pIsSecureSessionId** is true if the SDK was able to gather enough entropy in @@ -464,15 +472,14 @@ The **receive** method is called each time the SDK sends a message. :ref:`android_create_session` + .. _android_disconnect_sdk: Disconnect from SDK ------------------- In order to disconnect from the AusweisApp2 SDK you need to invalidate your -instance of **IBinder**. There are two possibilities to do this. The first -one is to unbind from the SDK Android service to undo your binding, like -shown in the code listing below. The second one is to return false in the -**pingBinder** function of your IBinder instance. +instance of **IBinder**. You can unbind from the SDK Android service to undo +your binding, like shown in the code listing below. .. code-block:: java @@ -663,7 +670,10 @@ are shown in code listing below. } } - // [...] + +This class must now be added to the activity: + +.. code-block:: java ForegroundDispatcher mDispatcher = new ForegroundDispatcher(this); diff --git a/docs/sdk/commands.rst b/docs/sdk/commands.rst index c1a3761..7c719fa 100644 --- a/docs/sdk/commands.rst +++ b/docs/sdk/commands.rst @@ -117,7 +117,7 @@ RUN_AUTH ^^^^^^^^ Starts an authentication. -The AusweisApp2 will send a :ref:`auth` message when the authentication is started. +The AusweisApp2 will send an :ref:`auth` message when the authentication is started. - **tcTokenURL**: @@ -166,14 +166,14 @@ SET_ACCESS_RIGHTS ^^^^^^^^^^^^^^^^^ Set effective access rights. -By default the **"effective"** access rights are **"optional"** + **"required"**. -If you want to enable or disable some **"optional"** access rights you can +By default the **effective** access rights are **optional** + **required**. +If you want to enable or disable some **optional** access rights you can send this command to modify the **effective** access rights. The AusweisApp2 will send an :ref:`access_rights` message as an answer. - - **raw**: + - **chat**: List of enabled **optional** access rights. If you send an empty **[]** all **optional** access rights are disabled. @@ -181,7 +181,14 @@ The AusweisApp2 will send an :ref:`access_rights` message as an answer. { "cmd": "SET_ACCESS_RIGHTS", - "raw": [] + "chat": [] + } + +.. code-block:: json + + { + "cmd": "SET_ACCESS_RIGHTS", + "chat": ["FamilyName"] } .. note:: @@ -189,6 +196,8 @@ The AusweisApp2 will send an :ref:`access_rights` message as an answer. :ref:`access_rights` message. Otherwise you will get a :ref:`bad_state` message as an answer. +.. seealso:: + List of possible access rights are listed in :ref:`access_rights`. @@ -272,7 +281,7 @@ SET_PIN Set PIN of inserted card. If the AusweisApp2 sends message :ref:`enter_pin` you need -to send this command to unlock the card with the PIN. +to send this command to unblock the card with the PIN. The AusweisApp2 will send an :ref:`enter_pin` message on error or message :ref:`enter_can` if the retryCounter of the card @@ -282,10 +291,11 @@ For detailed information see message :ref:`enter_pin`. If the PIN was correct, the workflow will continue. If the last attempt to enter the PIN failed, AusweisApp2 -will send the message :ref:`enter_puk`. +will send the message :ref:`enter_puk` as the retryCounter +is decreased to **0**. -- **value**: The personal identification number of the card. +- **value**: The personal identification number (PIN) of the card. This must be 6 digits. .. code-block:: json @@ -310,13 +320,13 @@ SET_CAN Set CAN of inserted card. If the AusweisApp2 sends message :ref:`enter_can` you need -to send this command to unlock the last retry of :ref:`set_pin`. +to send this command to unblock the last retry of :ref:`set_pin`. The AusweisApp2 will send an :ref:`enter_can` message on error. Otherwise the workflow will continue with :ref:`enter_pin`. -- **value**: The card access number of the card. +- **value**: The card access number (CAN) of the card. This must be 6 digits. .. code-block:: json @@ -331,3 +341,34 @@ Otherwise the workflow will continue with :ref:`enter_pin`. :ref:`enter_can` message. Otherwise you will get a :ref:`bad_state` message as an answer. + + + +.. _set_puk: + +SET_PUK +^^^^^^^ +Set PUK of inserted card. + +If the AusweisApp2 sends message :ref:`enter_puk` you need +to send this command to unblock :ref:`set_pin`. + +The AusweisApp2 will send an :ref:`enter_puk` message on error +or if the PUK is operative. +Otherwise the workflow will continue with :ref:`enter_pin`. +For detailed information see message :ref:`enter_puk`. + +- **value**: The personal unblocking key (PUK) of the card. + This must be 10 digits. + +.. code-block:: json + + { + "cmd": "SET_PUK", + "value": "1234567890" + } + +.. note:: + This command is allowed only if the AusweisApp2 sends an initial + :ref:`enter_puk` message. Otherwise you will get a :ref:`bad_state` + message as an answer. diff --git a/docs/sdk/conf.py.in b/docs/sdk/conf.py.in index 7c0eb48..c594a77 100644 --- a/docs/sdk/conf.py.in +++ b/docs/sdk/conf.py.in @@ -42,7 +42,7 @@ master_doc = 'index' # General information about the project. project = 'AusweisApp2 SDK' -copyright = '2016, Governikus GmbH & Co. KG' +copyright = '2016-2017, Governikus GmbH & Co. KG' author = 'Governikus GmbH & Co. KG' # The version info for the project you're documenting, acts as replacement for @@ -143,7 +143,7 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'AusweisApp2_SDK.tex', 'AusweisApp2 SDK', + (master_doc, 'AusweisApp2-@VERSION_DVCS@-SDK.tex', 'AusweisApp2 SDK', 'Governikus GmbH \& Co. KG', 'howto'), ] diff --git a/docs/sdk/intro.rst b/docs/sdk/intro.rst index 9f764dd..c19a5f6 100644 --- a/docs/sdk/intro.rst +++ b/docs/sdk/intro.rst @@ -20,6 +20,35 @@ Also this documentation provides some example workflows to show a possible communication. +.. important:: + The AusweisApp2 does **not** provide any personal data to + your client application directly as AusweisApp2 does not + have access to this data for security reasons. + AusweisApp2 facilitates a secure connection between the + eID server and the ID card, enabling the eID server to get + those data from the card. + + This way your backend receives high level trust data. + Since your client application runs in a user's environment, + you could not be sure about the integrity of the data + if your client application were to receive high sensitive + data from the AusweisApp2 directly as your backend does + not have any possibility to verify the source of the data. + + Also this approach, recommended for compliance reasons by the + Federal Office for Information Security, spares your client + application the necessity of encypting these high sensitive + data. + + In case your client application requires data input from the + ID card, you need to get this from the backend system + (e.g. the eID server) after a succesfull authentication. + + + .. seealso:: + `TR-03124`_, part 1: Specifications + + .. _TR-03124: https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Publikationen/TechnischeRichtlinien/TR03124/TR-03124-1.pdf Recommended diff --git a/docs/sdk/messages.rst b/docs/sdk/messages.rst index 64be8fc..90f91f0 100644 --- a/docs/sdk/messages.rst +++ b/docs/sdk/messages.rst @@ -30,7 +30,18 @@ the whole workflow. - **error**: This optional parameter indicates an error of a :ref:`set_access_rights` call if the command contained invalid data. - - **raw**: Access rights of the service provider. + - **aux**: Optional auxiliary data of the service provider. + + - **ageVerificationDate**: Optional required date of birth for AgeVerification as ISO 8601. + + - **requiredAge**: Optional required age for AgeVerification. It is calculated + by AusweisApp2 on the basis of ageVerificationDate and current date. + + - **validityDate**: Optional validity date as ISO 8601. + + - **communityId**: Optional id of community. + + - **chat**: Access rights of the service provider. - **effective**: Indicates the enabled access rights of **optional** and **required**. @@ -38,26 +49,73 @@ the whole workflow. - **required**: These rights are mandatory and cannot be disabled. + - **transactionInfo**: Optional transaction information. + .. code-block:: json { "msg": "ACCESS_RIGHTS", "error": "some optional error message", - "raw": + "aux": + { + "ageVerificationDate": "1999-07-20", + "requiredAge": "18", + "validityDate": "2017-07-20", + "communityId": "02760400110000" + }, + "chat": { - "effective": [24,20,16,15,14,12,11,10,9,8,2,0], - "optional": [15], - "required": [24,20,16,14,12,11,10,9,8,2,0] + "effective": ["Address", "FamilyName", "GivenNames", "AgeVerification"], + "optional": ["GivenNames", "AgeVerification"], + "required": ["Address", "FamilyName"] + }, + "transactionInfo": "this is an example" + } + + +.. code-block:: json + + { + "msg": "ACCESS_RIGHTS", + "chat": + { + "effective": ["Address", "FamilyName", "GivenNames", "AgeVerification"], + "optional": ["GivenNames", "AgeVerification"], + "required": ["Address", "FamilyName"] } } +The following access rights are possible: + + - Address + - BirthName + - FamilyName + - GivenNames + - PlaceOfBirth + - DateOfBirth + - DoctoralDegree + - ArtisticName + - Pseudonym + - ValidUntil + - Nationality + - IssuingCountry + - DocumentType + - ResidencePermitI + - ResidencePermitII + - CommunityID + - AddressVerification + - AgeVerification + + .. seealso:: `TR-03110`_, part 4, chapter 2.2.3 -.. _TR-03110: https://www.bsi.bund.de/EN/Publications/TechnicalGuidelines/TR03110/BSITR03110.html + `TR-03127`_, chapter 3.2.2 +.. _TR-03110: https://www.bsi.bund.de/EN/Publications/TechnicalGuidelines/TR03110/BSITR03110.html +.. _TR-03127: https://www.bsi.bund.de/DE/Publikationen/TechnischeRichtlinien/tr03127/tr-03127.html @@ -230,6 +288,8 @@ Provides information about the used certificate. - **termsOfUsage**: Raw certificate information about the terms of usage. + - **purpose**: Parsed purpose of the terms of usage. + - **validity**: Validity dates of the certificate in UTC. - **effectiveDate**: Certificate is valid since this date. @@ -246,7 +306,8 @@ Provides information about the used certificate. "issuerUrl": "http://www.governikus.de", "subjectName": "Governikus GmbH & Co. KG", "subjectUrl": "https://test.governikus-eid.de", - "termsOfUsage": "Anschrift:\t\r\nGovernikus GmbH & Co. KG\r\nAm Fallturm 9\r\n28359 Bremen\t\r\n\r\nE-Mail-Adresse:\thb@bos-bremen.de\t\r\n\r\nZweck des Auslesevorgangs:\tDemonstration des eID-Service\t\r\n\r\nZuständige Datenschutzaufsicht:\t\r\nDie Landesbeauftragte für Datenschutz und Informationsfreiheit der Freien Hansestadt Bremen\r\nArndtstraße 1\r\n27570 Bremerhaven" + "termsOfUsage": "Anschrift:\t\r\nGovernikus GmbH & Co. KG\r\nAm Fallturm 9\r\n28359 Bremen\t\r\n\r\nE-Mail-Adresse:\thb@bos-bremen.de\t\r\n\r\nZweck des Auslesevorgangs:\tDemonstration des eID-Service\t\r\n\r\nZuständige Datenschutzaufsicht:\t\r\nDie Landesbeauftragte für Datenschutz und Informationsfreiheit der Freien Hansestadt Bremen\r\nArndtstraße 1\r\n27570 Bremerhaven", + "purpose": "Demonstration des eID-Service" }, "validity": { @@ -264,11 +325,11 @@ ENTER_CAN ^^^^^^^^^ Indicates that a CAN is required to continue workflow. -If the AusweisApp2 will send this message you need to -provide the CAN of inserted card with :ref:`set_can`. +If the AusweisApp2 sends this message, you will have to +provide the CAN of the inserted card with :ref:`set_can`. -The workflow will automatically continue if the CAN -was correct and the AuweisApp2 will send a :ref:`enter_pin` message. +The workflow will automatically continue if the CAN was correct +and the AusweisApp2 will send an :ref:`enter_pin` message. If the correct CAN is entered the retryCounter will still be **1**. If your application provides an invalid :ref:`set_can` command @@ -297,12 +358,16 @@ again but without an error parameter. "attached": true, "card": { + "inoperative": false, "deactivated": false, "retryCounter": 1 } } } +.. note:: + There is no retry limit for an incorrect CAN. + @@ -313,16 +378,15 @@ ENTER_PIN Indicates that a PIN is required to continue the workflow. If the AusweisApp2 sends this message, you will have to -provide the PIN of inserted card with :ref:`set_pin`. +provide the PIN of the inserted card with :ref:`set_pin`. -The workflow will automatically continue if the PIN -was correct. Otherwise you will receive another message :ref:`enter_pin`. +The workflow will automatically continue if the PIN was correct. +Otherwise you will receive another message :ref:`enter_pin`. If the correct PIN is entered the retryCounter will be set to **3**. If your application provides an invalid :ref:`set_pin` command the AusweisApp2 will send an :ref:`enter_pin` message with an error -parameter and the retryCounter of the card is **not** -decreased. +parameter and the retryCounter of the card is **not** decreased. If your application provides a valid :ref:`set_pin` command and the PIN was incorrect the AusweisApp2 will send :ref:`enter_pin` @@ -332,6 +396,10 @@ If the value of retryCounter is **1** the AusweisApp2 will initially send an :ref:`enter_can` message. Once your application provides a correct CAN the AusweisApp2 will send an :ref:`enter_pin` again with a retryCounter of **1**. +If the value of retryCounter is **0** the AusweisApp2 will initially send an +:ref:`enter_puk` message. Once your application provides a correct PUK the +AusweisApp2 will send an :ref:`enter_pin` again with a retryCounter of **3**. + - **error**: Optional error message if your command :ref:`set_pin` was invalid. @@ -350,6 +418,7 @@ AusweisApp2 will send an :ref:`enter_pin` again with a retryCounter of **1**. "attached": true, "card": { + "inoperative": false, "deactivated": false, "retryCounter": 3 } @@ -365,12 +434,33 @@ ENTER_PUK ^^^^^^^^^ Indicates that a PUK is required to continue the workflow. -If AusweisApp2 sends this message, you will have to -show a message to the user that the card is blocked -and needs to be unblocked by AusweisApp2. +If the AusweisApp2 sends this message, you will have to +provide the PUK of the inserted card with :ref:`set_puk`. -You need to send a :ref:`cancel` to abort the workflow. +The workflow will automatically continue if the PUK was correct +and the AusweisApp2 will send an :ref:`enter_pin` message. +Otherwise you will receive another message :ref:`enter_puk`. +If the correct PUK is entered the retryCounter will be set to **3**. +If your application provides an invalid :ref:`set_puk` command +the AusweisApp2 will send an :ref:`enter_puk` message with an error +parameter. + +If your application provides a valid :ref:`set_puk` command +and the PUK was incorrect the AusweisApp2 will send :ref:`enter_puk` +again but without an error parameter. + +If AusweisApp2 sends :ref:`enter_puk` with field "inoperative" of embedded +:ref:`reader` message set true it is not possible to unblock the PIN. +You will have to show a message to the user that the card is inoperative +and the user should contact the authority responsible for issueing the +identification document to unblock the PIN. +You need to send a :ref:`cancel` to abort the workflow if card is operative. +Please see the note for more information. + + + - **error**: Optional error message if your command :ref:`set_puk` + was invalid. - **reader**: Information about the used card and card reader. Please see message :ref:`reader` for details. @@ -379,18 +469,32 @@ You need to send a :ref:`cancel` to abort the workflow. { "msg": "ENTER_PUK", + "error": "You must provide 10 digits", "reader": { "name": "NFC", "attached": true, "card": { + "inoperative": false, "deactivated": false, "retryCounter": 0 } } } +.. note:: + There is no retry limit for an incorrect PUK. But + be aware that the PUK can only be used 10 times to + unblock the PIN. There is no readable counter for this. + The AusweisApp2 is not able to provide any counter information + of PUK usage. + If the PUK is used 10 times it is not possible to unblock + the PIN anymore and the card will remain in PUK state. + Also it is not possible to indicate this state before the + user enters the correct PUK once. This information will be + provided as field "inoperative" of :ref:`reader` message. + @@ -537,6 +641,11 @@ until a card with enabled eID functionality is inserted. - **card**: Provides information about inserted card, otherwise null. + - **inoperative**: True if PUK is inoperative and cannot unblock PIN, + otherwise false. This can be recognized if user enters a correct + PUK only. It is not possbible to read this data before a user tries + to unblock the PIN. + - **deactivated**: True if eID functionality is deactivated, otherwise false. - **retryCounter**: Count of possible retries for the PIN. If you enter a PIN @@ -550,6 +659,7 @@ until a card with enabled eID functionality is inserted. "attached": true, "card": { + "inoperative": false, "deactivated": false, "retryCounter": 3 } @@ -585,6 +695,7 @@ Provides information about all connected card readers. "attached": true, "card": { + "inoperative": false, "deactivated": false, "retryCounter": 3 } @@ -612,7 +723,7 @@ Be aware of case sensitive names in :doc:`commands`. .. code-block:: json { - "msg": "UNKNOWN_COMMAND" - "error": "get_INFo", + "msg": "UNKNOWN_COMMAND", + "error": "get_INFo" } diff --git a/docs/sdk/workflow.rst b/docs/sdk/workflow.rst index 890b499..00c8980 100644 --- a/docs/sdk/workflow.rst +++ b/docs/sdk/workflow.rst @@ -28,13 +28,13 @@ into the connected card reader. {"msg": "AUTH"} - {"msg": "ACCESS_RIGHTS", "raw": {"effective":[24,15,0],"optional":[15],"required":[24,0]}} + {"msg": "ACCESS_RIGHTS", "chat": {"effective":["FamilyName","GivenNames","DocumentType"],"optional":["GivenNames"],"required":["FamilyName","DocumentType"]}} {"cmd": "ACCEPT"} - {"msg": "ENTER_PIN", "reader": {"attached":true,"card":{"deactivated":false,"inserted":true,"retryCounter":3},"name":"NFC"}} + {"msg": "ENTER_PIN", "reader": {"attached":true,"card":{"inoperative":false,"deactivated":false,"inserted":true,"retryCounter":3},"name":"NFC"}} - {"cmd": "SET_PIN", "pin": "123456"} + {"cmd": "SET_PIN", "value": "123456"} {"msg": "AUTH","result": {"major":"http://www.bsi.bund.de/ecard/api/1.1/resultmajor#ok"},"url":"https://test.governikus-eid.de/DEMO/?refID=123456"} @@ -46,7 +46,7 @@ The following messages and commands show possible iterations if the user enters an incorrect PIN and CAN twice before entering the correct CAN and PIN. -We assume that the user didn't insert a card +We assume that the user did not insert a card into the connected card reader. @@ -56,31 +56,31 @@ into the connected card reader. {"msg": "AUTH"} - {"msg": "ACCESS_RIGHTS", "raw": {"effective":[0],"optional":[],"required":[0]}} + {"msg": "ACCESS_RIGHTS", "chat": {"effective":["DocumentType"],"optional":[],"required":["DocumentType"]}} {"cmd": "ACCEPT"} {"msg": "INSERT_CARD"} - {"msg": "ENTER_PIN", "reader": {"attached":true,"card":{"deactivated":false,"inserted":true,"retryCounter":3},"name":"NFC"}} + {"msg": "ENTER_PIN", "reader": {"attached":true,"card":{"inoperative":false,"deactivated":false,"inserted":true,"retryCounter":3},"name":"NFC"}} - {"cmd": "SET_PIN", "pin": "000000"} + {"cmd": "SET_PIN", "value": "000000"} - {"msg": "ENTER_PIN", "reader": {"attached":true,"card":{"deactivated":false,"inserted":true,"retryCounter":2},"name":"NFC"}} + {"msg": "ENTER_PIN", "reader": {"attached":true,"card":{"inoperative":false,"deactivated":false,"inserted":true,"retryCounter":2},"name":"NFC"}} - {"cmd": "SET_PIN", "pin": "000001"} + {"cmd": "SET_PIN", "value": "000001"} - {"msg": "ENTER_CAN", "reader": {"attached":true,"card":{"deactivated":false,"inserted":true,"retryCounter":1},"name":"NFC"}} + {"msg": "ENTER_CAN", "reader": {"attached":true,"card":{"inoperative":false,"deactivated":false,"inserted":true,"retryCounter":1},"name":"NFC"}} - {"cmd": "SET_CAN", "can": "000000"} + {"cmd": "SET_CAN", "value": "000000"} - {"msg": "ENTER_CAN", "reader": {"attached":true,"card":{"deactivated":false,"inserted":true,"retryCounter":1},"name":"NFC"}} + {"msg": "ENTER_CAN", "reader": {"attached":true,"card":{"inoperative":false,"deactivated":false,"inserted":true,"retryCounter":1},"name":"NFC"}} - {"cmd": "SET_CAN", "can": "654321"} + {"cmd": "SET_CAN", "value": "654321"} - {"msg": "ENTER_PIN", "reader": {"attached":true,"card":{"deactivated":false,"inserted":true,"retryCounter":1},"name":"NFC"}} + {"msg": "ENTER_PIN", "reader": {"attached":true,"card":{"inoperative":false,"deactivated":false,"inserted":true,"retryCounter":1},"name":"NFC"}} - {"cmd": "SET_PIN", "pin": "123456"} + {"cmd": "SET_PIN", "value": "123456"} {"msg": "AUTH","result": {"major":"http://www.bsi.bund.de/ecard/api/1.1/resultmajor#ok"},"url":"https://test.governikus-eid.de/DEMO/?refID=123456"} @@ -91,7 +91,7 @@ Cancelled authentication The following messages and commands show possible iterations if the user cancels the authentication. -We assume that the user didn't connect the card reader. +We assume that the user did not connect the card reader. .. code-block:: json @@ -100,10 +100,39 @@ We assume that the user didn't connect the card reader. {"msg": "AUTH"} - {"msg": "ACCESS_RIGHTS", "raw": {"effective":[0],"optional":[],"required":[0]}} + {"msg": "ACCESS_RIGHTS", "chat": {"effective":["DocumentType"],"optional":[],"required":["DocumentType"]}} {"cmd": "CANCEL"} {"msg": "AUTH", "result": {"description":"The operation was aborted due to cancellation by user.","language":"en","major":"http://www.bsi.bund.de/ecard/api/1.1/resultmajor#error","message":"The process was cancelled by the user.","minor":"http://www.bsi.bund.de/ecard/api/1.1/resultminor/sal#cancellationByUser"},"url":"https://test.governikus-eid.de/DEMO/?errID=123456"} + +Set some access rights +^^^^^^^^^^^^^^^^^^^^^^ +The following messages and commands show possible +iterations if the user disables and enables an access right. + +We assume that the user did not connect the card reader. + + +.. code-block:: json + + {"cmd": "RUN_AUTH", "tcTokenURL": "https://test.governikus-eid.de/DEMO"} + + {"msg": "AUTH"} + + {"msg": "ACCESS_RIGHTS", "chat": {"effective":["FamilyName","GivenNames","DocumentType"],"optional":["GivenNames"],"required":["FamilyName","DocumentType"]}} + + {"cmd": "SET_ACCESS_RIGHTS", "chat": []} + + {"msg": "ACCESS_RIGHTS", "chat": {"effective":["FamilyName","DocumentType"],"optional":["GivenNames"],"required":["FamilyName","DocumentType"]}} + + {"cmd": "SET_ACCESS_RIGHTS", "chat": ["GivenNames"]} + + {"msg": "ACCESS_RIGHTS", "chat": {"effective":["FamilyName","GivenNames","DocumentType"],"optional":["GivenNames"],"required":["FamilyName","DocumentType"]}} + + {"cmd": "CANCEL"} + + {"msg": "AUTH", "result": {"description":"The operation was aborted due to cancellation by user.","language":"en","major":"http://www.bsi.bund.de/ecard/api/1.1/resultmajor#error","message":"The process was cancelled by the user.","minor":"http://www.bsi.bund.de/ecard/api/1.1/resultminor/sal#cancellationByUser"},"url":"https://test.governikus-eid.de/DEMO/?errID=123456"} + diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index c5d961b..df6f39c 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) +CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) IF(POLICY CMP0010) CMAKE_POLICY(SET CMP0010 NEW) @@ -403,14 +403,8 @@ IF(WIN32) ENDIF() ENDIF() -IF(CMAKE_VERSION VERSION_LESS 3.2) - SET(COMPRESSION cfj) - SET(COMPRESSION_FILENDING tar.bz2) -ELSE() - SET(COMPRESSION cfJ) - SET(COMPRESSION_FILENDING tar.xz) -ENDIF() - +SET(COMPRESSION cfJ) +SET(COMPRESSION_FILENDING tar.xz) ADD_CUSTOM_TARGET(compress.pre ${compressed_filename} COMMAND ${CLEANUP_FILES} COMMAND ${CMAKE_COMMAND} -E remove_directory "${DESTINATION_DIR}/doc" diff --git a/libs/README.rst b/libs/README.rst index 1b406bf..664a75a 100644 --- a/libs/README.rst +++ b/libs/README.rst @@ -8,7 +8,7 @@ Unterstützte Compiler: - MinGW 32 / 64 >= 4.9 -- GCC >= 4.7 +- GCC >= 4.9 - Clang >= 3.4 @@ -17,7 +17,7 @@ Unterstützte Compiler: Notwendige Bibliotheken: -- Qt >= 5.7 +- Qt >= 5.8 - http://www.qt.io/download/ @@ -36,7 +36,7 @@ Notwendige Bibliotheken: Notwendige Tools: -- CMake >= 3.1.0 (>= 3.7.0 für Android) +- CMake >= 3.3.0 (>= 3.7.1 für Android) - http://www.cmake.org @@ -46,10 +46,8 @@ Build ----- Die Abhängigkeiten lassen sich mittels der CMakeLists.txt in diesem Ordner automatisch aufbauen. - Das Skript kann die abhängigen Bibliotheken als Quellcode selbständig herunterladen, -entpacken und bauen. Dabei ist allerdings zu beachten, dass CMake erst ab v3.1.0 -die notwendigen Kompressionen beherrscht [1]. +entpacken und bauen. Lokale Pakete können mittels -DPACKAGES_DIR=C:/packages verwendet werden. Wichtig: Bei PACKAGES_DIR muss ein absoluter Pfad angegeben werden! @@ -67,8 +65,6 @@ Zusätzlich kann mit dem make Target "compress" der Inhalt der dist-Ordner berei ein Tarball aus den gebauten Bibliotheken erzeugt werden. -[1] http://www.cmake.org/Bug/view.php?id=13515 - Proxy ^^^^^ Sofern beim Download der Pakete ein Proxy notwendig ist, müssen vorm Aufruf von "make" @@ -85,7 +81,7 @@ notwendig.) macOS ^^^^^ -Unter MacOS ist die Einrichtung relativ einfach und bedarf nur der oben gennanten Voreinstellungen. +Unter MacOS ist die Einrichtung relativ einfach und bedarf nur der oben genannten Voreinstellungen. Es wird der von Apple ausgelieferte clang compiler verwendet. Beispiel: Innerhalb von /Users/governikus/AusweisApp2 befindet sich der Quellcode. @@ -211,18 +207,22 @@ Komponenten vorhanden sein: - https://developer.android.com/tools/sdk/ndk/index.html - - Getestet: r13b (x86_64) + - Getestet: r10e (https://wiki.qt.io/Qt_for_Android_known_issues) - Android SDK mit gesetztem ANDROID_HOME - - https://developer.android.com/sdk/index.html#Other + - https://developer.android.com/studio/releases/sdk-tools.html - - Getestet: 25.2.2 + - Getestet: 25.2.5 + + - Qt ist derzeit nicht mit aktuelleren kompatibel: https://bugreports.qt.io/browse/QTBUG-61988 - Unter bestimmten Umständen kann es vorkommen, dass die Build-Tools-Version nicht erkannt wird. Dies kann mittels der Umgebungsvariable ANDROID_BUILD_TOOLS_REVISION behoben werden. Die genaue Version ist im Android Manager vom Android SDK (./tools/android) hinterlegt. + - Getestet: 26.0.1 + - Um Qt erfolgreich zu bauen, sind verschiedene API Level von Android notwendig. Diese sollten mindestens Level 18 und 21 sein. Nähere Informationen dazu sind im Wiki von Qt enthalten: http://wiki.qt.io/Android @@ -244,5 +244,5 @@ Beispiel: Innerhalb von /home/governikus/AusweisApp2 befindet sich der Quellcode $ make Standardmäßig wird die Architektur "armeabi-v7a" gewählt. Um zum Beispiel die Toolchain für x86-Architektur -zu bauen , ist beim Aufruf von CMake der Parameter "-DCMAKE_ANDROID_ARCH_ABI=x86" mitzugeben. +zu bauen, ist beim Aufruf von CMake der Parameter "-DCMAKE_ANDROID_ARCH_ABI=x86" mitzugeben. diff --git a/resources/default-supported-devices.json b/resources/default-supported-devices.json index 593a251..3071203 100644 --- a/resources/default-supported-devices.json +++ b/resources/default-supported-devices.json @@ -18,7 +18,7 @@ "URL": "https://appl.governikus-asp.de/ausweisapp2/driver/pcsc-cyberjack_3.99.5final.SP07-universal-signed.pkg" }, { - "Platforms": ["MV_10_11"], + "Platforms": ["MV_10_11", "MV_10_12"], "URL": "https://appl.governikus-asp.de/ausweisapp2/driver/01_pcsc-cyberjack_3.99.5final.SP08-universal-osx10.11-signed.pkg" }, { @@ -44,7 +44,7 @@ "URL": "https://appl.governikus-asp.de/ausweisapp2/driver/pcsc-cyberjack_3.99.5final.SP07-universal-signed.pkg" }, { - "Platforms": ["MV_10_11"], + "Platforms": ["MV_10_11", "MV_10_12"], "URL": "https://appl.governikus-asp.de/ausweisapp2/driver/01_pcsc-cyberjack_3.99.5final.SP08-universal-osx10.11-signed.pkg" }, { @@ -66,7 +66,7 @@ "URL": "https://appl.governikus-asp.de/ausweisapp2/driver/01_cJRFIDbasisIFD.exe" }, { - "Platforms": ["MV_10_9", "MV_10_10", "MV_10_11"], + "Platforms": ["MV_10_9", "MV_10_10", "MV_10_11", "MV_10_12"], "URL": "https://appl.governikus-asp.de/ausweisapp2/driver/ifd-ccid-1.4.8-universal-signed.pkg" }, { @@ -88,7 +88,7 @@ "URL": "https://appl.governikus-asp.de/ausweisapp2/driver/SDI011_win_installer_V1.01.zip" }, { - "Platforms": ["MV_10_9", "MV_10_10", "MV_10_11"], + "Platforms": ["MV_10_9", "MV_10_10", "MV_10_11", "MV_10_12"], "URL": "https://appl.governikus-asp.de/ausweisapp2/driver/SDI011_mac_V5.0.18.zip" }, { @@ -110,7 +110,7 @@ "URL": "https://appl.governikus-asp.de/ausweisapp2/driver/SCL011_win_installer_V1.01.zip" }, { - "Platforms": ["MV_10_9", "MV_10_10", "MV_10_11"], + "Platforms": ["MV_10_9", "MV_10_10", "MV_10_11", "MV_10_12"], "URL": "https://appl.governikus-asp.de/ausweisapp2/driver/SCL011_V2.09_mac.zip" }, { diff --git a/resources/images/android/hdpi/npa_preview.png b/resources/images/android/hdpi/npa_preview.png new file mode 100644 index 0000000..e37ee9c Binary files /dev/null and b/resources/images/android/hdpi/npa_preview.png differ diff --git a/resources/images/android/ldpi/npa_preview.png b/resources/images/android/ldpi/npa_preview.png new file mode 100644 index 0000000..a6a0483 Binary files /dev/null and b/resources/images/android/ldpi/npa_preview.png differ diff --git a/resources/images/android/mdpi/npa_preview.png b/resources/images/android/mdpi/npa_preview.png new file mode 100644 index 0000000..6babd5c Binary files /dev/null and b/resources/images/android/mdpi/npa_preview.png differ diff --git a/resources/images/android/xhdpi/npa_preview.png b/resources/images/android/xhdpi/npa_preview.png new file mode 100644 index 0000000..4e39bff Binary files /dev/null and b/resources/images/android/xhdpi/npa_preview.png differ diff --git a/resources/images/android/xxhdpi/npa_preview.png b/resources/images/android/xxhdpi/npa_preview.png new file mode 100644 index 0000000..37d7f97 Binary files /dev/null and b/resources/images/android/xxhdpi/npa_preview.png differ diff --git a/resources/images/android/xxxhdpi/npa_preview.png b/resources/images/android/xxxhdpi/npa_preview.png new file mode 100644 index 0000000..5936f91 Binary files /dev/null and b/resources/images/android/xxxhdpi/npa_preview.png differ diff --git a/resources/images/npa_beta.svg b/resources/images/npa_beta.svg index d89208c..cac822b 100644 --- a/resources/images/npa_beta.svg +++ b/resources/images/npa_beta.svg @@ -11,13 +11,6 @@ - - - - - - - @@ -98,9 +91,7 @@ -0.82422,3.29736 0.0693,-1.30517 -0.39649,-3.14404 0.82422,-3.29736 z m -32.96973,14.83643 c -5.87598,-1.50293 -5.95215,-5.31787 -0.82324,-0.82422 2.66699,1.01855 0.6289,-2.66699 3.2959,-1.64844 0.21582,-2.41308 -1.86329,-2.53223 -1.64844,-4.94531 -2.52051,-0.59815 -2.42383,1.42139 -4.94531,0.82422 0.0908,-2.10596 2.75976,-1.63623 4.94531,-1.64844 2.78711,2.30371 3.21679,7.03271 -0.82422,8.24219 z" - inkscape:connector-curvature="0" style="clip-rule:evenodd;fill:#b50202;fill-rule:evenodd" - sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccscccsccccccccccccccccccccccccccccccc" /> + style="clip-rule:evenodd;fill:#b50202;fill-rule:evenodd" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PREVIEW + + + + + + + + + + diff --git a/resources/images/preview.svg b/resources/images/preview.svg new file mode 100644 index 0000000..5277377 --- /dev/null +++ b/resources/images/preview.svg @@ -0,0 +1,1341 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PREVIEW + diff --git a/resources/packaging/android/IAusweisApp2SdkCallback.aidl b/resources/packaging/android/IAusweisApp2SdkCallback.aidl index 271b572..244e50c 100644 --- a/resources/packaging/android/IAusweisApp2SdkCallback.aidl +++ b/resources/packaging/android/IAusweisApp2SdkCallback.aidl @@ -3,4 +3,5 @@ package com.governikus.ausweisapp2; interface IAusweisApp2SdkCallback { void sessionIdGenerated(String pSessionId, boolean pIsSecureSessionId); void receive(String pJson); + void sdkDisconnected(); } diff --git a/resources/qml/more/MoreView.qml b/resources/qml/more/MoreView.qml index 5125aed..13fc95e 100644 --- a/resources/qml/more/MoreView.qml +++ b/resources/qml/more/MoreView.qml @@ -47,7 +47,7 @@ SectionPage { Qt.openUrlExternally("market://details?id=com.governikus.ausweisapp2") } else if (Qt.platform.os === "ios") { - Qt.openUrlExternally("itms://itunes.apple.com/de/app/wikipedia-mobile/id324715238?mt=8") + Qt.openUrlExternally("https://www.ausweisapp.bund.de/en/questions-and-answers/evaluate-us/") } } } @@ -55,7 +55,7 @@ SectionPage { MoreViewMenuItem { text: qsTr("Share"); imageSource: "qrc:///images/iOS/more/icon_mehr_upload.svg"; - onClicked: qmlExtension.shareText(qsTr("I'm using Ausweisapp2, download it here for Android: https://play.google.com/store/apps/details?id=com.governikus.ausweisapp2&hl=de or here for iOS: https://itunes.apple.com/de/app/wikipedia-mobile/id324715238?mt=8"), qsTr("Share with")) + onClicked: qmlExtension.shareText(qsTr("I'm using Ausweisapp2, download it here for Android: https://play.google.com/store/apps/details?id=com.governikus.ausweisapp2"), qsTr("Share with")) } MoreViewMenuItem { diff --git a/resources/translations/ausweisapp2_de.ts b/resources/translations/ausweisapp2_de.ts index 50b70fd..a871f27 100644 --- a/resources/translations/ausweisapp2_de.ts +++ b/resources/translations/ausweisapp2_de.ts @@ -1062,7 +1062,7 @@ Read the software license text on the application homepage. - Lesen Sie die Softwarelizenz auf der Internetseite der Anwedung. + Lesen Sie die Softwarelizenz auf der Internetseite der Anwendung. @@ -1155,8 +1155,8 @@ - I'm using Ausweisapp2, download it here for Android: https://play.google.com/store/apps/details?id=com.governikus.ausweisapp2&hl=de or here for iOS: https://itunes.apple.com/de/app/wikipedia-mobile/id324715238?mt=8 - Ich verwende die AusweisApp2 , laden Sie die AusweisApp2 für Android: https://play.google.com/store/apps/details?id=com.governikus.ausweisapp2&hl=de oder für iOS: https: //itunes.apple . com / de / app / wikipedia -mobile / id324715238 ? mt = 8 + I'm using Ausweisapp2, download it here for Android: https://play.google.com/store/apps/details?id=com.governikus.ausweisapp2 + Ich verwende die AusweisApp2, laden Sie die AusweisApp2 für Android: https://play.google.com/store/apps/details?id=com.governikus.ausweisapp2&hl=de @@ -3968,7 +3968,7 @@ Bitte beachten Sie, dass Sie mit Ihrer PUK lediglich Ihren Online-Ausweis entspe <div align="right">Step %1 of %2</div><div align="left">Almost done!</div> - <div align="right">Step %1 of %2</div><div align="left">Fast fertig!</div> + <div align="right">Schritt %1 von %2</div><div align="left">Fast fertig!</div> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0a27950..63ab7c3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -166,11 +166,6 @@ IF(IOS) SET_TARGET_PROPERTIES(AusweisApp PROPERTIES XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") SET_TARGET_PROPERTIES(AusweisApp PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "8.0") SET_TARGET_PROPERTIES(AusweisApp PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") - IF(${CMAKE_BUILD_TYPE} STREQUAL "DEBUG") - SET_TARGET_PROPERTIES(AusweisApp PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer: Marco von der Puetten") - ELSE() - SET_TARGET_PROPERTIES(AusweisApp PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Distribution: Governikus GmbH & Co. KG") - ENDIF() # prevent xcode to convert multiple png files to tiff SET_TARGET_PROPERTIES(AusweisApp PROPERTIES XCODE_ATTRIBUTE_COMBINE_HIDPI_IMAGES "NO") @@ -186,7 +181,7 @@ IF(ANDROID) TARGET_LINK_LIBRARIES(AusweisApp AusweisAppCardNfc AusweisAppActivationIntent) ENDIF() -IF(LINUX OR ANDROID OR IOS) +IF(ANDROID OR IOS OR (LINUX AND CMAKE_BUILD_TYPE STREQUAL "DEBUG")) TARGET_LINK_LIBRARIES(AusweisApp AusweisAppCardBluetooth) ENDIF() @@ -196,7 +191,7 @@ ENDIF() IF(IOS OR ANDROID OR WINDOWS_STORE OR ${CMAKE_BUILD_TYPE} STREQUAL "DEBUG") TARGET_LINK_LIBRARIES(AusweisApp AusweisAppQml) - TARGET_LINK_LIBRARIES(AusweisApp AusweisAppJsonApi AusweisAppAidl) + TARGET_LINK_LIBRARIES(AusweisApp AusweisAppAidl) ENDIF() IF(DESKTOP) TARGET_LINK_LIBRARIES(AusweisApp AusweisAppCardPcsc AusweisAppCardDrivers AusweisAppActivationWebservice) @@ -204,7 +199,7 @@ IF(DESKTOP) ENDIF() IF(${CMAKE_BUILD_TYPE} STREQUAL "DEBUG") - TARGET_LINK_LIBRARIES(AusweisApp AusweisAppJsonApi AusweisAppWebSocket) + TARGET_LINK_LIBRARIES(AusweisApp AusweisAppWebSocket) ENDIF() diff --git a/src/activation/intent/IntentActivationHandler.h b/src/activation/intent/IntentActivationHandler.h index 0367f2b..4c9f8e0 100644 --- a/src/activation/intent/IntentActivationHandler.h +++ b/src/activation/intent/IntentActivationHandler.h @@ -35,7 +35,7 @@ class IntentActivationHandler Q_INTERFACES(governikus::ActivationHandler) #ifdef Q_OS_ANDROID - friend void::Java_com_governikus_ausweisapp2_MainActivity_triggerActivation(JNIEnv*, jobject, jstring); + friend void ::Java_com_governikus_ausweisapp2_MainActivity_triggerActivation(JNIEnv*, jobject, jstring); #endif private: diff --git a/src/activation/intent/MainActivity.java b/src/activation/intent/MainActivity.java index 6e84823..94c06fb 100644 --- a/src/activation/intent/MainActivity.java +++ b/src/activation/intent/MainActivity.java @@ -8,8 +8,8 @@ import android.content.IntentFilter; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.nfc.NfcAdapter; -import android.nfc.Tag; import android.nfc.tech.IsoDep; +import android.nfc.Tag; import android.os.Bundle; import android.util.Log; import org.qtproject.qt5.android.bindings.QtActivity; diff --git a/src/activation/webservice/WebserviceActivationHandler.h b/src/activation/webservice/WebserviceActivationHandler.h index e657981..1f47dc5 100644 --- a/src/activation/webservice/WebserviceActivationHandler.h +++ b/src/activation/webservice/WebserviceActivationHandler.h @@ -26,7 +26,7 @@ class WebserviceActivationHandler Q_INTERFACES(governikus::ActivationHandler) private: - friend class::test_WebserviceActivationHandler; + friend class ::test_WebserviceActivationHandler; QSharedPointer mServer; static void addStatusLine(QString& pContent, StatusFormat pStatusFormat, const QString& pKey, const QString& pValue); diff --git a/src/aidl/AidlBinder.java b/src/aidl/AidlBinder.java index a903bf4..cb29d26 100644 --- a/src/aidl/AidlBinder.java +++ b/src/aidl/AidlBinder.java @@ -3,9 +3,9 @@ package com.governikus.ausweisapp2; import android.nfc.Tag; import android.os.DeadObjectException; import android.os.IBinder; -import android.os.RemoteException; import android.util.Log; +import java.lang.Throwable; import java.util.HashMap; import java.util.Map; @@ -38,9 +38,9 @@ class AidlBinder extends IAusweisApp2Sdk.Stub } - private void handleRemoteException(RemoteException pException) + private void handleClientException(Throwable pException) { - Log.w(LOG_TAG, "Android service: Connected client send an exception. Dropping client.", pException); + Log.w(LOG_TAG, "Android service: Connected client sent an exception. Dropping client.", pException); mCallback = null; } @@ -53,28 +53,47 @@ class AidlBinder extends IAusweisApp2Sdk.Stub return false; } + if (pCallback == mCallback) + { + Log.i(LOG_TAG, "Android service: Supplied callback is already in use."); + return true; + } + cleanUpDeadCallback(); if (mCallback != null) { - Log.w(LOG_TAG, "Android service: A client is already connected. Ignoring newly supplied callback."); - return false; + Log.i(LOG_TAG, "Android service: A client is already connected. Dropping previous callback."); + try + { + mCallbackSessionId = null; + mCallback.sdkDisconnected(); + } + catch (Throwable t) + { + handleClientException(t); + } } + mCallbackSessionId = resetValidSessionID(); + if (mCallbackSessionId.isEmpty()) + { + return false; + } + mCallback = pCallback; - mCallbackSessionId = resetValidSessionID(""); - final boolean secureSessionId = isSecureRandomPsk(); + final boolean sessionIdIsSecure = isSecureRandomPsk(); Log.i(LOG_TAG, "Android service: Callback connected."); try { - mCallback.sessionIdGenerated(secureSessionId ? mCallbackSessionId : null, secureSessionId); + mCallback.sessionIdGenerated(sessionIdIsSecure ? mCallbackSessionId : null, sessionIdIsSecure); } - catch (RemoteException e) + catch (Throwable t) { - handleRemoteException(e); + handleClientException(t); } - return true; + return sessionIdIsSecure; } @@ -134,14 +153,14 @@ class AidlBinder extends IAusweisApp2Sdk.Stub Log.w(LOG_TAG, "Android service: Connected client is already dead."); mCallback = null; } - catch (RemoteException e) + catch (Throwable t) { - handleRemoteException(e); + handleClientException(t); } } - private native String resetValidSessionID(String pPsk); + private native String resetValidSessionID(); private native boolean isSecureRandomPsk(); private native void aidlSend(String pMessageFromClient); } diff --git a/src/aidl/PskManager.cpp b/src/aidl/PskManager.cpp index 6ceb337..d694fb2 100644 --- a/src/aidl/PskManager.cpp +++ b/src/aidl/PskManager.cpp @@ -18,13 +18,21 @@ using namespace governikus; Q_GLOBAL_STATIC(PskManager, instance) -PskManager & PskManager::getInstance() +PskManager::PskManager() + : mPsk() + , mSecureRandomPsk(false) + , mPskMutex() +{ +} + + +PskManager& PskManager::getInstance() { return *instance; } -QByteArray PskManager::generatePsk(const QByteArray& pClientPartialPsk) +QByteArray PskManager::generatePsk() { const static int TIMESTAMP_BYTE_COUNT = 64 / 8; const static int RANDOM_BYTE_COUNT = 256; @@ -60,16 +68,8 @@ QByteArray PskManager::generatePsk(const QByteArray& pClientPartialPsk) mServerInputBytes += timeStampBytes; mServerInputBytes += randomBytes; - auto clientPartialPsk = pClientPartialPsk.trimmed(); - if (clientPartialPsk.startsWith("0x")) - { - clientPartialPsk = clientPartialPsk.mid(2, -1); - } - const auto& clientInputBytes = QByteArray::fromHex(clientPartialPsk); - QCryptographicHash hashFunction(QCryptographicHash::Sha256); hashFunction.addData(mServerInputBytes); - hashFunction.addData(clientInputBytes); mPsk = hashFunction.result().toHex(); return mPsk; } diff --git a/src/aidl/PskManager.h b/src/aidl/PskManager.h index 6429a5a..59b389a 100644 --- a/src/aidl/PskManager.h +++ b/src/aidl/PskManager.h @@ -1,22 +1,17 @@ /*! - * PskManager.h - * * \copyright Copyright (c) 2016 Governikus GmbH & Co. KG */ #pragma once - #include #include - namespace governikus { class PskManager { - private: QByteArray mPsk; bool mSecureRandomPsk; @@ -24,7 +19,9 @@ class PskManager public: static PskManager& getInstance(); - QByteArray generatePsk(const QByteArray& pClientPartialPsk = QByteArray()); + + PskManager(); + QByteArray generatePsk(); QByteArray getPsk(); bool isSecureRandomPsk(); }; diff --git a/src/aidl/UIPlugInAidl.cpp b/src/aidl/UIPlugInAidl.cpp index 8d71f55..dc78f93 100644 --- a/src/aidl/UIPlugInAidl.cpp +++ b/src/aidl/UIPlugInAidl.cpp @@ -17,9 +17,9 @@ #include #ifdef Q_OS_ANDROID +#include #include #include -#include #endif @@ -34,6 +34,7 @@ UIPlugInAidl::UIPlugInAidl() : UIPlugIn() , mJsonApi(nullptr) , mContext() + , mWorkflowIsActive() , mInitializationSuccessfull(false) { if (UILoader::getInstance().load(UIPlugInName::UIPlugInJsonApi)) @@ -82,6 +83,7 @@ bool UIPlugInAidl::isSuccessfullInitialized() void UIPlugInAidl::onWorkflowStarted(QSharedPointer pContext) { + mWorkflowIsActive.lock(); mContext = pContext; } @@ -91,6 +93,8 @@ void UIPlugInAidl::onWorkflowFinished(QSharedPointer pContext) Q_UNUSED(pContext); mContext.clear(); + mJsonApi->blockSignals(false); + mWorkflowIsActive.unlock(); } @@ -100,11 +104,23 @@ void UIPlugInAidl::onReceived(const QByteArray& pMessage) } +bool UIPlugInAidl::waitForWorkflowToFinish() +{ + const int fiveSeconds = 5000; + bool success = mWorkflowIsActive.tryLock(fiveSeconds); + if (success) + { + mWorkflowIsActive.unlock(); + } + return success; +} + + void UIPlugInAidl::reset() { if (mContext) { - const QSignalBlocker blocker(mJsonApi); + mJsonApi->blockSignals(true); Q_EMIT mContext->fireCancelWorkflow(); } } @@ -136,25 +152,24 @@ extern "C" // These functions need to be explicitly exported so that the JVM can bind to them. // At the moment only the Q_Plugins seem to be appropriate locations. -JNIEXPORT jstring JNICALL Java_com_governikus_ausweisapp2_AidlBinder_resetValidSessionID(JNIEnv* pEnv, jobject pObj, jstring pClientPartialPsk) +JNIEXPORT jstring JNICALL Java_com_governikus_ausweisapp2_AidlBinder_resetValidSessionID(JNIEnv* pEnv, jobject pObj) { Q_UNUSED(pObj); - const char* nativeString = pEnv->GetStringUTFChars(pClientPartialPsk, 0); - const auto& clientPartialPsk = QByteArray(nativeString); - pEnv->ReleaseStringUTFChars(pClientPartialPsk, nativeString); - - UIPlugInAidl* plugin = UIPlugInAidl::getInstance(); if (!plugin->isSuccessfullInitialized()) { - qCritical(aidl) << "Cannot call AIDL plugin"; - return pEnv->NewStringUTF(QString().toUtf8().constData()); + qCCritical(aidl) << "Cannot call AIDL plugin"; + return pEnv->NewStringUTF(""); + } + QMetaObject::invokeMethod(plugin, "reset", Qt::QueuedConnection); + if (!plugin->waitForWorkflowToFinish()) + { + qCCritical(aidl) << "Cannot acquire workflow mutex"; + return pEnv->NewStringUTF(""); } - QMetaObject::invokeMethod(plugin, "reset", Qt::BlockingQueuedConnection); - - const auto& finalPsk = PskManager::getInstance().generatePsk(clientPartialPsk); + const auto& finalPsk = PskManager::getInstance().generatePsk(); return pEnv->NewStringUTF(finalPsk.constData()); } diff --git a/src/aidl/UIPlugInAidl.h b/src/aidl/UIPlugInAidl.h index f544efd..137246b 100644 --- a/src/aidl/UIPlugInAidl.h +++ b/src/aidl/UIPlugInAidl.h @@ -10,6 +10,7 @@ #include "view/UIPlugIn.h" #include +#include namespace governikus { @@ -24,6 +25,7 @@ class UIPlugInAidl private: UIPlugInJsonApi* mJsonApi; QSharedPointer mContext; + QMutex mWorkflowIsActive; static QAtomicPointer instance; bool mInitializationSuccessfull; @@ -35,6 +37,7 @@ class UIPlugInAidl static UIPlugInAidl* getInstance(bool pBlock = true); bool isSuccessfullInitialized(); Q_INVOKABLE void onReceived(const QByteArray& pMessage); + bool waitForWorkflowToFinish(); private Q_SLOTS: void reset(); diff --git a/src/card/base/CardConnection.h b/src/card/base/CardConnection.h index fe5ed4a..e3d8ef5 100644 --- a/src/card/base/CardConnection.h +++ b/src/card/base/CardConnection.h @@ -8,15 +8,15 @@ #pragma once +#include "asn1/Chat.h" +#include "asn1/CVCertificate.h" +#include "asn1/CVCertificateChain.h" +#include "command/BaseCardCommand.h" #include "CardConnectionWorker.h" #include "Commands.h" #include "InputAPDUInfo.h" #include "ReaderInfo.h" #include "SmartCardDefinitions.h" -#include "asn1/CVCertificate.h" -#include "asn1/CVCertificateChain.h" -#include "asn1/Chat.h" -#include "command/BaseCardCommand.h" #include "command/DestroyPaceChannelCommand.h" #include "command/EstablishPaceChannelCommand.h" diff --git a/src/card/base/CardConnectionWorker.cpp b/src/card/base/CardConnectionWorker.cpp index 6962392..3a06905 100644 --- a/src/card/base/CardConnectionWorker.cpp +++ b/src/card/base/CardConnectionWorker.cpp @@ -46,6 +46,12 @@ ReaderInfo CardConnectionWorker::getReaderInfo() const } +void CardConnectionWorker::setPukInoperative() +{ + mReader->setPukInoperative(); +} + + bool CardConnectionWorker::hasCard() const { return !mReader.isNull() && mReader->getCard() != nullptr; diff --git a/src/card/base/CardConnectionWorker.h b/src/card/base/CardConnectionWorker.h index 17a9b9e..06f9cc3 100644 --- a/src/card/base/CardConnectionWorker.h +++ b/src/card/base/CardConnectionWorker.h @@ -6,15 +6,15 @@ #pragma once +#include "asn1/SecurityInfos.h" #include "Apdu.h" #include "CardReturnCode.h" #include "Commands.h" #include "EstablishPACEChannel.h" #include "FileRef.h" +#include "pace/SecureMessaging.h" #include "Reader.h" #include "SmartCardDefinitions.h" -#include "asn1/SecurityInfos.h" -#include "pace/SecureMessaging.h" #include @@ -64,6 +64,8 @@ class CardConnectionWorker Q_INVOKABLE ReaderInfo getReaderInfo() const; + void setPukInoperative(); + virtual CardReturnCode updateRetryCounter(); virtual CardReturnCode readFile(const FileRef& pFileRef, QByteArray& pFileContent); diff --git a/src/card/base/CardInfo.cpp b/src/card/base/CardInfo.cpp index 104c169..dd76db6 100644 --- a/src/card/base/CardInfo.cpp +++ b/src/card/base/CardInfo.cpp @@ -6,10 +6,10 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "CardConnectionWorker.h" -#include "CardInfo.h" #include "asn1/PACEInfo.h" #include "asn1/SecurityInfos.h" +#include "CardConnectionWorker.h" +#include "CardInfo.h" #include #include @@ -21,11 +21,12 @@ Q_DECLARE_LOGGING_CATEGORY(card) using namespace governikus; -CardInfo::CardInfo(CardType pCardType, QSharedPointer pEfCardAccess, int pRetryCounter, bool pPinDeactivated) +CardInfo::CardInfo(CardType pCardType, QSharedPointer pEfCardAccess, int pRetryCounter, bool pPinDeactivated, bool pPukInoperative) : mCardType(pCardType) , mEfCardAccess(pEfCardAccess) , mRetryCounter(pRetryCounter) , mPinDeactivated(pPinDeactivated) + , mPukInoperative(pPukInoperative) { } @@ -60,6 +61,12 @@ bool CardInfo::isPinDeactivated() const } +bool CardInfo::isPukInoperative() const +{ + return mPukInoperative; +} + + bool CardInfoFactory::create(const QSharedPointer& pCardConnectionWorker, ReaderInfo& pReaderInfo) { if (pCardConnectionWorker == nullptr) diff --git a/src/card/base/CardInfo.h b/src/card/base/CardInfo.h index bca4191..30fbbb3 100644 --- a/src/card/base/CardInfo.h +++ b/src/card/base/CardInfo.h @@ -8,8 +8,8 @@ #pragma once -#include "SmartCardDefinitions.h" #include "asn1/SecurityInfos.h" +#include "SmartCardDefinitions.h" #include @@ -31,9 +31,11 @@ class CardInfo QSharedPointer mEfCardAccess; int mRetryCounter; bool mPinDeactivated; + bool mPukInoperative; public: - CardInfo(CardType pCardType, QSharedPointer = QSharedPointer(), int pRetryCounter = -1, bool pPinDeactivated = false); + CardInfo(CardType pCardType, QSharedPointer = QSharedPointer(), + int pRetryCounter = -1, bool pPinDeactivated = false, bool pPukInoperative = false); CardType getCardType() const; @@ -48,6 +50,11 @@ class CardInfo */ bool isPinDeactivated() const; + /*! + * The PUK is inoperative. User is not able to unblock the PIN anymore. + */ + bool isPukInoperative() const; + friend class Reader; }; diff --git a/src/card/base/Commands.cpp b/src/card/base/Commands.cpp index 231cf59..fc083be 100644 --- a/src/card/base/Commands.cpp +++ b/src/card/base/Commands.cpp @@ -6,9 +6,9 @@ #include "Commands.h" +#include "asn1/ASN1Util.h" #include "FileRef.h" #include "SecureMessagingResponse.h" -#include "asn1/ASN1Util.h" #include diff --git a/src/card/base/Commands.h b/src/card/base/Commands.h index c9f140e..4a339bd 100644 --- a/src/card/base/Commands.h +++ b/src/card/base/Commands.h @@ -4,11 +4,11 @@ #pragma once +#include "asn1/Chat.h" #include "Apdu.h" #include "CardReturnCode.h" #include "FileRef.h" #include "SmartCardDefinitions.h" -#include "asn1/Chat.h" #include diff --git a/src/card/base/EstablishPACEChannel.cpp b/src/card/base/EstablishPACEChannel.cpp index cf55921..789e160 100644 --- a/src/card/base/EstablishPACEChannel.cpp +++ b/src/card/base/EstablishPACEChannel.cpp @@ -2,9 +2,9 @@ * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ +#include "asn1/ASN1Util.h" #include "EstablishPACEChannel.h" #include "PersoSimWorkaround.h" -#include "asn1/ASN1Util.h" #include #include diff --git a/src/card/base/EstablishPACEChannel.h b/src/card/base/EstablishPACEChannel.h index 1f7e589..c6355e9 100644 --- a/src/card/base/EstablishPACEChannel.h +++ b/src/card/base/EstablishPACEChannel.h @@ -6,12 +6,12 @@ #pragma once -#include "Apdu.h" -#include "CardReturnCode.h" -#include "SmartCardDefinitions.h" #include "asn1/ASN1TemplateUtil.h" #include "asn1/CertificateDescription.h" #include "asn1/SecurityInfos.h" +#include "Apdu.h" +#include "CardReturnCode.h" +#include "SmartCardDefinitions.h" #include diff --git a/src/card/base/GeneralAuthenticateResponse.cpp b/src/card/base/GeneralAuthenticateResponse.cpp index b109077..b13f62e 100644 --- a/src/card/base/GeneralAuthenticateResponse.cpp +++ b/src/card/base/GeneralAuthenticateResponse.cpp @@ -4,8 +4,8 @@ * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ -#include "GeneralAuthenticateResponse.h" #include "asn1/ASN1Util.h" +#include "GeneralAuthenticateResponse.h" #include diff --git a/src/card/base/GeneralAuthenticateResponse.h b/src/card/base/GeneralAuthenticateResponse.h index 294b972..3b64d7a 100644 --- a/src/card/base/GeneralAuthenticateResponse.h +++ b/src/card/base/GeneralAuthenticateResponse.h @@ -8,8 +8,8 @@ #pragma once -#include "Apdu.h" #include "asn1/ASN1TemplateUtil.h" +#include "Apdu.h" namespace governikus diff --git a/src/card/base/Reader.cpp b/src/card/base/Reader.cpp index adf0b98..43c00be 100644 --- a/src/card/base/Reader.cpp +++ b/src/card/base/Reader.cpp @@ -3,10 +3,10 @@ */ +#include "asn1/PACEInfo.h" #include "CardConnectionWorker.h" #include "PersoSimWorkaround.h" #include "Reader.h" -#include "asn1/PACEInfo.h" #include @@ -32,6 +32,12 @@ Reader::~Reader() } +void Reader::setPukInoperative() +{ + mReaderInfo.mCardInfo.mPukInoperative = true; +} + + QSharedPointer Reader::createCardConnectionWorker() { Card* currentCard = getCard(); diff --git a/src/card/base/Reader.h b/src/card/base/Reader.h index 533fabd..8dda6a5 100644 --- a/src/card/base/Reader.h +++ b/src/card/base/Reader.h @@ -73,6 +73,7 @@ class Reader virtual Card* getCard() const = 0; + void setPukInoperative(); /*! * \brief Creates a new CardConnectionWorker if and only if there is a card in the reader which is not already exclusively connected. diff --git a/src/card/base/ReaderInfo.h b/src/card/base/ReaderInfo.h index ac470ba..357a480 100644 --- a/src/card/base/ReaderInfo.h +++ b/src/card/base/ReaderInfo.h @@ -33,7 +33,10 @@ class ReaderInfo ExtendedLengthApduSupportCode mExtendedLengthApduSupportCode; public: - ReaderInfo(ReaderManagerPlugInType pPlugInType = ReaderManagerPlugInType::UNKNOWN, const QString& pName = QString(), ReaderType pReaderType = ReaderType::UNKNOWN, const CardInfo& pCardInfo = CardInfo(CardType::NONE)); + ReaderInfo(ReaderManagerPlugInType pPlugInType = ReaderManagerPlugInType::UNKNOWN, + const QString& pName = QString(), + ReaderType pReaderType = ReaderType::UNKNOWN, + const CardInfo& pCardInfo = CardInfo(CardType::NONE)); bool isValid() const { @@ -71,6 +74,12 @@ class ReaderInfo } + bool isPukInoperative() const + { + return mCardInfo.isPukInoperative(); + } + + void setCardInfo(const CardInfo& pCardInfo) { mCardInfo = pCardInfo; diff --git a/src/card/base/ReaderManager.h b/src/card/base/ReaderManager.h index b9114a2..c77c5f1 100644 --- a/src/card/base/ReaderManager.h +++ b/src/card/base/ReaderManager.h @@ -4,10 +4,10 @@ #pragma once +#include "command/CreateCardConnectionCommand.h" #include "DeviceError.h" #include "Reader.h" #include "ReaderManagerWorker.h" -#include "command/CreateCardConnectionCommand.h" #include #include diff --git a/src/card/base/SecureMessagingResponse.cpp b/src/card/base/SecureMessagingResponse.cpp index 72b8136..86473f0 100644 --- a/src/card/base/SecureMessagingResponse.cpp +++ b/src/card/base/SecureMessagingResponse.cpp @@ -2,8 +2,8 @@ * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ -#include "SecureMessagingResponse.h" #include "asn1/ASN1Util.h" +#include "SecureMessagingResponse.h" #include diff --git a/src/card/base/SecureMessagingResponse.h b/src/card/base/SecureMessagingResponse.h index c47e901..17a21ed 100644 --- a/src/card/base/SecureMessagingResponse.h +++ b/src/card/base/SecureMessagingResponse.h @@ -6,8 +6,8 @@ #pragma once -#include "Commands.h" #include "asn1/ASN1TemplateUtil.h" +#include "Commands.h" namespace governikus diff --git a/src/card/base/asn1/ASN1TemplateUtil.h b/src/card/base/asn1/ASN1TemplateUtil.h index fbdd71f..1222b36 100644 --- a/src/card/base/asn1/ASN1TemplateUtil.h +++ b/src/card/base/asn1/ASN1TemplateUtil.h @@ -138,7 +138,7 @@ static const int CB_ERROR = 0; }\ \ template<>\ - name * decodeAsn1Object(name** pObject, const unsigned char** pData, long pDataLen)\ + name * decodeAsn1Object(name * *pObject, const unsigned char** pData, long pDataLen)\ {\ return d2i_##name(pObject, pData, pDataLen);\ }\ @@ -152,7 +152,7 @@ static const int CB_ERROR = 0; #define DECLARE_ASN1_OBJECT(name)\ template<> name * newAsn1Object();\ template<> int encodeAsn1Object(name * pObject, unsigned char** encoded);\ - template<> name * decodeAsn1Object(name** pObject, const unsigned char** pData, long pDataLen);\ + template<> name * decodeAsn1Object(name * *pObject, const unsigned char** pData, long pDataLen);\ template<> void freeAsn1Object(name * pObject); diff --git a/src/card/base/asn1/ASN1Util.cpp b/src/card/base/asn1/ASN1Util.cpp index f1981fa..f983307 100644 --- a/src/card/base/asn1/ASN1Util.cpp +++ b/src/card/base/asn1/ASN1Util.cpp @@ -2,9 +2,9 @@ #include "SecureMessagingResponse.h" +#include #include #include -#include using namespace governikus; diff --git a/src/card/base/asn1/AccessRoleAndRight.cpp b/src/card/base/asn1/AccessRoleAndRight.cpp index 4818369..2427280 100644 --- a/src/card/base/asn1/AccessRoleAndRight.cpp +++ b/src/card/base/asn1/AccessRoleAndRight.cpp @@ -6,6 +6,7 @@ #include "AccessRoleAndRight.h" +#include using namespace governikus; @@ -209,3 +210,29 @@ QString AccessRoleAndRightsUtil::toDisplayText(AccessRight pRight) return tr("Unknown"); } } + + +QLatin1String AccessRoleAndRightsUtil::toTechnicalName(AccessRight pRight) +{ + const auto name = getEnumName(static_cast(pRight)); + if (!name.size()) + { + qCritical() << "Requested AccessRight without mapping:" << pRight; + } + return name; +} + + +bool AccessRoleAndRightsUtil::fromTechnicalName(const char* pStr, const std::function& pFunc) +{ + const AccessRightNames undefined = static_cast(UINT_MAX); + + auto entry = Enum::fromString(pStr, undefined); + if (entry != undefined) + { + Q_ASSERT(Enum::isValue(static_cast(entry))); + pFunc(static_cast(entry)); + return true; + } + return false; +} diff --git a/src/card/base/asn1/AccessRoleAndRight.h b/src/card/base/asn1/AccessRoleAndRight.h index c88b06f..d68e90a 100644 --- a/src/card/base/asn1/AccessRoleAndRight.h +++ b/src/card/base/asn1/AccessRoleAndRight.h @@ -15,6 +15,7 @@ #include "EnumHelper.h" +#include #include #include @@ -65,6 +66,29 @@ defineTypedEnumType(AccessRight, uint, AGE_VERIFICATION = 0 ) +// do NOT change any key/value as this is used as an unique identifier! +#define TYPE(x) static_cast::type>(x) +defineTypedEnumType(AccessRightNames, std::underlying_type::type, + ResidencePermitII = TYPE(AccessRight::READ_DG20), + ResidencePermitI = TYPE(AccessRight::READ_DG19), + CommunityID = TYPE(AccessRight::READ_DG18), + Address = TYPE(AccessRight::READ_DG17), + BirthName = TYPE(AccessRight::READ_DG13), + Nationality = TYPE(AccessRight::READ_DG10), + PlaceOfBirth = TYPE(AccessRight::READ_DG09), + DateOfBirth = TYPE(AccessRight::READ_DG08), + DoctoralDegree = TYPE(AccessRight::READ_DG07), + ArtisticName = TYPE(AccessRight::READ_DG06), + FamilyName = TYPE(AccessRight::READ_DG05), + GivenNames = TYPE(AccessRight::READ_DG04), + ValidUntil = TYPE(AccessRight::READ_DG03), + IssuingCountry = TYPE(AccessRight::READ_DG02), + DocumentType = TYPE(AccessRight::READ_DG01), + Pseudonym = TYPE(AccessRight::RESTRICTED_IDENTIFICATION), + AddressVerification = TYPE(AccessRight::COMMUNITY_ID_VERIFICATION), + AgeVerification = TYPE(AccessRight::AGE_VERIFICATION) + ) +#undef TYPE inline uint qHash(governikus::AccessRight pAccessRight) { @@ -91,6 +115,8 @@ class AccessRoleAndRightsUtil static const QList& allDisplayedOrderedRights(); static const QList& allRights(); static QString toDisplayText(AccessRight pRight); + static QLatin1String toTechnicalName(AccessRight pRight); + static bool fromTechnicalName(const char* pStr, const std::function& pFunc); }; } diff --git a/src/card/base/asn1/AuthenticatedAuxiliaryData.cpp b/src/card/base/asn1/AuthenticatedAuxiliaryData.cpp index f2c6d8e..b0b6925 100644 --- a/src/card/base/asn1/AuthenticatedAuxiliaryData.cpp +++ b/src/card/base/asn1/AuthenticatedAuxiliaryData.cpp @@ -21,6 +21,17 @@ Q_DECLARE_LOGGING_CATEGORY(card) namespace governikus { +using CommunityID = ASN1_OCTET_STRING; +DECLARE_ASN1_FUNCTIONS(CommunityID) + +using ValidityDate = ASN1_OCTET_STRING; +DECLARE_ASN1_FUNCTIONS(ValidityDate) + +using AgeVerificationDate = ASN1_STRING; +DECLARE_ASN1_FUNCTIONS(AgeVerificationDate) + +DECLARE_ASN1_OBJECT(ValidityDate) + /*! * This defines the AuxDataTemplate object as SEQUENCE without the special tag. */ diff --git a/src/card/base/asn1/AuthenticatedAuxiliaryData.h b/src/card/base/asn1/AuthenticatedAuxiliaryData.h index 8f94666..e60a912 100644 --- a/src/card/base/asn1/AuthenticatedAuxiliaryData.h +++ b/src/card/base/asn1/AuthenticatedAuxiliaryData.h @@ -41,18 +41,6 @@ namespace governikus */ -typedef ASN1_OCTET_STRING CommunityID; -DECLARE_ASN1_FUNCTIONS(CommunityID) - - -typedef ASN1_OCTET_STRING ValidityDate; -DECLARE_ASN1_FUNCTIONS(ValidityDate) - - -typedef ASN1_STRING AgeVerificationDate; -DECLARE_ASN1_FUNCTIONS(AgeVerificationDate) - - typedef struct auxdatatemplate_st { ASN1_OBJECT* mAuxId; @@ -90,6 +78,4 @@ struct AuthenticatedAuxiliaryData DECLARE_ASN1_FUNCTIONS(AuthenticatedAuxiliaryData) DECLARE_ASN1_OBJECT(AuthenticatedAuxiliaryData) -DECLARE_ASN1_OBJECT(ValidityDate) - } /* namespace governikus */ diff --git a/src/card/base/asn1/CVCertificateChain.h b/src/card/base/asn1/CVCertificateChain.h index 1b643dd..03c343f 100644 --- a/src/card/base/asn1/CVCertificateChain.h +++ b/src/card/base/asn1/CVCertificateChain.h @@ -10,8 +10,8 @@ #pragma once -#include "CVCertificate.h" #include "Commands.h" +#include "CVCertificate.h" #include diff --git a/src/card/base/asn1/CVCertificateChainBuilder.h b/src/card/base/asn1/CVCertificateChainBuilder.h index 65573c1..0b169c5 100644 --- a/src/card/base/asn1/CVCertificateChainBuilder.h +++ b/src/card/base/asn1/CVCertificateChainBuilder.h @@ -6,9 +6,9 @@ #pragma once +#include "ChainBuilder.h" #include "CVCertificate.h" #include "CVCertificateChain.h" -#include "ChainBuilder.h" #include "EstablishPACEChannel.h" diff --git a/src/card/base/asn1/CertificateDescription.cpp b/src/card/base/asn1/CertificateDescription.cpp index 5f6832c..5acd955 100644 --- a/src/card/base/asn1/CertificateDescription.cpp +++ b/src/card/base/asn1/CertificateDescription.cpp @@ -38,14 +38,14 @@ QStringList takeWhileNonEmpty(const QStringList& lines) QString getField(const QString& pData, const QStringList& pSearchItems) { - static const QString NEW_LINE("\r\n"); + const QLatin1Char NEW_LINE('\n'); for (const auto& item : pSearchItems) { const int pos = pData.indexOf(item); if (pos != -1) { - const QString rest = pData.mid(pos + item.length()); + const QString rest = pData.mid(pos + item.length()).trimmed(); const QStringList lines = takeWhileNonEmpty(rest.split(NEW_LINE)); if (lines.isEmpty()) { @@ -243,7 +243,7 @@ QSet CertificateDescription::getCommCertificates() const QString CertificateDescription::getServiceProviderAddress() const { static const QStringList SEARCH_ITEMS({ - QStringLiteral("Name, Anschrift und E-Mail-Adresse des Diensteanbieters:\r\n") + QStringLiteral("Name, Anschrift und E-Mail-Adresse des Diensteanbieters:") }); return getField(getTermsOfUsage(), SEARCH_ITEMS); @@ -253,10 +253,10 @@ QString CertificateDescription::getServiceProviderAddress() const QString CertificateDescription::getPurpose() const { static const QStringList SEARCH_ITEMS({ - QStringLiteral("Gesch\u00E4ftszweck:\r\n"), - QStringLiteral("Zweck des Auslesevorgangs:\r\n"), - QStringLiteral("Verwendung der Daten:\r\n"), - QStringLiteral("Zweck der Daten\u00FCbermittlung:\r\n") + QStringLiteral("Gesch\u00E4ftszweck:"), + QStringLiteral("Zweck des Auslesevorgangs:"), + QStringLiteral("Verwendung der Daten:"), + QStringLiteral("Zweck der Daten\u00FCbermittlung:") }); return getField(getTermsOfUsage(), SEARCH_ITEMS); @@ -267,7 +267,7 @@ QString CertificateDescription::getDataSecurityOfficer() const { static const QStringList SEARCH_ITEMS({QStringLiteral( "Hinweis auf die f\u00FCr den Diensteanbieter zust\u00E4ndigen Stellen, " - "die die Einhaltung der Vorschriften zum Datenschutz kontrollieren:\r\n")}); + "die die Einhaltung der Vorschriften zum Datenschutz kontrollieren:")}); return getField(getTermsOfUsage(), SEARCH_ITEMS); } diff --git a/src/card/base/asn1/CertificateDescription.h b/src/card/base/asn1/CertificateDescription.h index da75da4..6a5fce3 100644 --- a/src/card/base/asn1/CertificateDescription.h +++ b/src/card/base/asn1/CertificateDescription.h @@ -40,9 +40,7 @@ namespace governikus * redirectURL [0x06] PrintableString OPTIONAL, * commCertificates [0x07] SET OF OCTET STRING OPTIONAL * } - * \brief The CertificateDescription class */ - struct CertificateDescription { Q_DECLARE_TR_FUNCTIONS(CertificateDescription) diff --git a/src/card/base/asn1/ChainBuilder.h b/src/card/base/asn1/ChainBuilder.h index 0645fde..c359964 100644 --- a/src/card/base/asn1/ChainBuilder.h +++ b/src/card/base/asn1/ChainBuilder.h @@ -13,9 +13,9 @@ #pragma once -#include #include #include +#include namespace governikus diff --git a/src/card/base/asn1/Chat.h b/src/card/base/asn1/Chat.h index 67abe28..3a2174f 100644 --- a/src/card/base/asn1/Chat.h +++ b/src/card/base/asn1/Chat.h @@ -8,8 +8,8 @@ #pragma once -#include "ASN1TemplateUtil.h" #include "AccessRoleAndRight.h" +#include "ASN1TemplateUtil.h" #include diff --git a/src/card/base/asn1/EcdsaPublicKey.cpp b/src/card/base/asn1/EcdsaPublicKey.cpp index 99e5bf3..fab4d07 100644 --- a/src/card/base/asn1/EcdsaPublicKey.cpp +++ b/src/card/base/asn1/EcdsaPublicKey.cpp @@ -7,8 +7,8 @@ #include "EcdsaPublicKey.h" #include "pace/ec/EcUtil.h" -#include #include +#include using namespace governikus; diff --git a/src/card/base/asn1/SecurityInfo.h b/src/card/base/asn1/SecurityInfo.h index 49584bf..c5e2da5 100644 --- a/src/card/base/asn1/SecurityInfo.h +++ b/src/card/base/asn1/SecurityInfo.h @@ -10,8 +10,8 @@ #include "ASN1TemplateUtil.h" -#include #include +#include namespace governikus diff --git a/src/card/base/asn1/SignatureChecker.cpp b/src/card/base/asn1/SignatureChecker.cpp index d205ffe..4507424 100644 --- a/src/card/base/asn1/SignatureChecker.cpp +++ b/src/card/base/asn1/SignatureChecker.cpp @@ -5,9 +5,9 @@ #include "asn1/SignatureChecker.h" #include "pace/ec/EcUtil.h" -#include #include #include +#include using namespace governikus; diff --git a/src/card/base/command/BaseCardCommand.cpp b/src/card/base/command/BaseCardCommand.cpp index 2ac6d39..4b62d8d 100644 --- a/src/card/base/command/BaseCardCommand.cpp +++ b/src/card/base/command/BaseCardCommand.cpp @@ -2,9 +2,9 @@ * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ +#include "asn1/SecurityInfos.h" #include "BaseCardCommand.h" #include "CardConnection.h" -#include "asn1/SecurityInfos.h" #include #include diff --git a/src/card/base/command/BaseCardCommand.h b/src/card/base/command/BaseCardCommand.h index 0f54255..468ca82 100644 --- a/src/card/base/command/BaseCardCommand.h +++ b/src/card/base/command/BaseCardCommand.h @@ -23,7 +23,7 @@ class BaseCardCommand : public QObject { Q_OBJECT - friend class::test_BaseCardCommand; + friend class ::test_BaseCardCommand; private: Q_INVOKABLE void execute(); // will be invoked by CardConnection diff --git a/src/card/base/command/DidAuthenticateEAC1Command.h b/src/card/base/command/DidAuthenticateEAC1Command.h index 74641b8..0522882 100644 --- a/src/card/base/command/DidAuthenticateEAC1Command.h +++ b/src/card/base/command/DidAuthenticateEAC1Command.h @@ -8,9 +8,9 @@ #pragma once +#include "asn1/Chat.h" #include "BaseCardCommand.h" #include "Commands.h" -#include "asn1/Chat.h" namespace governikus { diff --git a/src/card/base/command/DidAuthenticateEAC2Command.cpp b/src/card/base/command/DidAuthenticateEAC2Command.cpp index c0034b0..e3e3981 100644 --- a/src/card/base/command/DidAuthenticateEAC2Command.cpp +++ b/src/card/base/command/DidAuthenticateEAC2Command.cpp @@ -4,11 +4,11 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ +#include "asn1/ChipAuthenticationInfo.h" +#include "asn1/EFCardSecurity.h" #include "CardConnection.h" #include "DidAuthenticateEAC2Command.h" #include "GeneralAuthenticateResponse.h" -#include "asn1/ChipAuthenticationInfo.h" -#include "asn1/EFCardSecurity.h" #include diff --git a/src/card/base/command/DidAuthenticateEAC2Command.h b/src/card/base/command/DidAuthenticateEAC2Command.h index 1299fa1..3f50c16 100644 --- a/src/card/base/command/DidAuthenticateEAC2Command.h +++ b/src/card/base/command/DidAuthenticateEAC2Command.h @@ -8,8 +8,8 @@ #pragma once -#include "BaseCardCommand.h" #include "asn1/CVCertificateChain.h" +#include "BaseCardCommand.h" namespace governikus { diff --git a/src/card/base/command/UnblockPinCommand.cpp b/src/card/base/command/UnblockPinCommand.cpp index 96d6aa7..e07beda 100644 --- a/src/card/base/command/UnblockPinCommand.cpp +++ b/src/card/base/command/UnblockPinCommand.cpp @@ -50,6 +50,7 @@ void UnblockPinCommand::internalExecute() mReturnCode = mCardConnectionWorker->transmit(ResetRetryCounterBuilder().build(), response); if (mReturnCode == CardReturnCode::OK && response.getSW1() == Enum::getValue(SW1::ERROR_COMMAND_NOT_ALLOWED)) { + mCardConnectionWorker->setPukInoperative(); mReturnCode = CardReturnCode::PUK_INOPERATIVE; } } diff --git a/src/card/base/pace/CipherMac.cpp b/src/card/base/pace/CipherMac.cpp index 113dca9..c5d47fb 100644 --- a/src/card/base/pace/CipherMac.cpp +++ b/src/card/base/pace/CipherMac.cpp @@ -5,8 +5,8 @@ #include "asn1/KnownOIDs.h" #include "pace/CipherMac.h" -#include #include +#include using namespace governikus; diff --git a/src/card/base/pace/CipherMac.h b/src/card/base/pace/CipherMac.h index 56c40bb..920d39d 100644 --- a/src/card/base/pace/CipherMac.h +++ b/src/card/base/pace/CipherMac.h @@ -8,8 +8,8 @@ #pragma once -#include #include +#include namespace governikus { diff --git a/src/card/base/pace/KeyAgreement.cpp b/src/card/base/pace/KeyAgreement.cpp index e31589a..856ea82 100644 --- a/src/card/base/pace/KeyAgreement.cpp +++ b/src/card/base/pace/KeyAgreement.cpp @@ -2,14 +2,14 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "Commands.h" -#include "PersoSimWorkaround.h" #include "asn1/PACEInfo.h" +#include "Commands.h" #include "pace/CipherMac.h" +#include "pace/ec/EcdhKeyAgreement.h" #include "pace/KeyAgreement.h" #include "pace/KeyDerivationFunction.h" #include "pace/SymmetricCipher.h" -#include "pace/ec/EcdhKeyAgreement.h" +#include "PersoSimWorkaround.h" #include diff --git a/src/card/base/pace/KeyAgreement.h b/src/card/base/pace/KeyAgreement.h index 8a66197..299bdfb 100644 --- a/src/card/base/pace/KeyAgreement.h +++ b/src/card/base/pace/KeyAgreement.h @@ -8,9 +8,9 @@ #pragma once +#include "asn1/SecurityInfo.h" #include "CardConnectionWorker.h" #include "GeneralAuthenticateResponse.h" -#include "asn1/SecurityInfo.h" #include "pace/KeyDerivationFunction.h" #include diff --git a/src/card/base/pace/KeyDerivationFunction.cpp b/src/card/base/pace/KeyDerivationFunction.cpp index cebfb43..6150c3b 100644 --- a/src/card/base/pace/KeyDerivationFunction.cpp +++ b/src/card/base/pace/KeyDerivationFunction.cpp @@ -5,8 +5,8 @@ #include "asn1/KnownOIDs.h" #include "pace/KeyDerivationFunction.h" -#include #include +#include using namespace governikus; diff --git a/src/card/base/pace/PaceHandler.cpp b/src/card/base/pace/PaceHandler.cpp index c0683c7..7ba4071 100644 --- a/src/card/base/pace/PaceHandler.cpp +++ b/src/card/base/pace/PaceHandler.cpp @@ -4,16 +4,16 @@ #include "pace/PaceHandler.h" -#include "Commands.h" -#include "FileRef.h" -#include "PersoSimWorkaround.h" #include "asn1/KnownOIDs.h" #include "asn1/PACEInfo.h" -#include "pace/KeyAgreement.h" +#include "Commands.h" +#include "FileRef.h" #include "pace/ec/EllipticCurveFactory.h" +#include "pace/KeyAgreement.h" +#include "PersoSimWorkaround.h" -#include #include +#include using namespace governikus; diff --git a/src/card/base/pace/PaceHandler.h b/src/card/base/pace/PaceHandler.h index 1dc88c2..6b46776 100644 --- a/src/card/base/pace/PaceHandler.h +++ b/src/card/base/pace/PaceHandler.h @@ -8,10 +8,10 @@ #pragma once -#include "CardConnectionWorker.h" -#include "EnumHelper.h" #include "asn1/PACEInfo.h" #include "asn1/SecurityInfos.h" +#include "CardConnectionWorker.h" +#include "EnumHelper.h" #include "pace/KeyAgreement.h" #include "pace/KeyDerivationFunction.h" @@ -25,7 +25,7 @@ namespace governikus { class PaceHandler { - friend class::test_PaceHandler; + friend class ::test_PaceHandler; private: const QSharedPointer mCardConnectionWorker; diff --git a/src/card/base/pace/SecureMessaging.cpp b/src/card/base/pace/SecureMessaging.cpp index dabb461..4ddd025 100644 --- a/src/card/base/pace/SecureMessaging.cpp +++ b/src/card/base/pace/SecureMessaging.cpp @@ -3,9 +3,9 @@ * * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ -#include "SecureMessagingResponse.h" #include "asn1/ASN1Util.h" #include "pace/SecureMessaging.h" +#include "SecureMessagingResponse.h" #include diff --git a/src/card/base/pace/SecureMessaging.h b/src/card/base/pace/SecureMessaging.h index cae984b..3bdd644 100644 --- a/src/card/base/pace/SecureMessaging.h +++ b/src/card/base/pace/SecureMessaging.h @@ -8,8 +8,8 @@ #pragma once -#include "Apdu.h" #include "asn1/ASN1TemplateUtil.h" +#include "Apdu.h" #include "pace/CipherMac.h" #include "pace/SymmetricCipher.h" diff --git a/src/card/base/pace/SymmetricCipher.cpp b/src/card/base/pace/SymmetricCipher.cpp index 1833e52..24b8a0d 100644 --- a/src/card/base/pace/SymmetricCipher.cpp +++ b/src/card/base/pace/SymmetricCipher.cpp @@ -5,8 +5,8 @@ #include "asn1/KnownOIDs.h" #include "pace/SymmetricCipher.h" -#include #include +#include using namespace governikus; diff --git a/src/card/base/pace/SymmetricCipher.h b/src/card/base/pace/SymmetricCipher.h index e95fc0a..3eeb6cd 100644 --- a/src/card/base/pace/SymmetricCipher.h +++ b/src/card/base/pace/SymmetricCipher.h @@ -8,8 +8,8 @@ #pragma once -#include #include +#include namespace governikus { diff --git a/src/card/base/pace/ec/EcdhGenericMapping.cpp b/src/card/base/pace/ec/EcdhGenericMapping.cpp index efc4138..0e72067 100644 --- a/src/card/base/pace/ec/EcdhGenericMapping.cpp +++ b/src/card/base/pace/ec/EcdhGenericMapping.cpp @@ -4,8 +4,8 @@ #include -#include "pace/ec/EcUtil.h" #include "pace/ec/EcdhGenericMapping.h" +#include "pace/ec/EcUtil.h" #include diff --git a/src/card/base/pace/ec/EcdhGenericMapping.h b/src/card/base/pace/ec/EcdhGenericMapping.h index 76becdd..47a36b3 100644 --- a/src/card/base/pace/ec/EcdhGenericMapping.h +++ b/src/card/base/pace/ec/EcdhGenericMapping.h @@ -6,9 +6,9 @@ #include "pace/DomainParameterMapping.h" +#include #include #include -#include namespace governikus { diff --git a/src/card/base/pace/ec/EcdhKeyAgreement.cpp b/src/card/base/pace/ec/EcdhKeyAgreement.cpp index d6de17a..a4452f1 100644 --- a/src/card/base/pace/ec/EcdhKeyAgreement.cpp +++ b/src/card/base/pace/ec/EcdhKeyAgreement.cpp @@ -2,13 +2,13 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "Commands.h" #include "asn1/KnownOIDs.h" #include "asn1/PACEInfo.h" +#include "Commands.h" #include "pace/CipherMac.h" -#include "pace/ec/EcUtil.h" #include "pace/ec/EcdhGenericMapping.h" #include "pace/ec/EcdhKeyAgreement.h" +#include "pace/ec/EcUtil.h" #include "pace/ec/EllipticCurveFactory.h" #include diff --git a/src/card/base/pace/ec/EcdhKeyAgreement.h b/src/card/base/pace/ec/EcdhKeyAgreement.h index 4759a07..d4ec844 100644 --- a/src/card/base/pace/ec/EcdhKeyAgreement.h +++ b/src/card/base/pace/ec/EcdhKeyAgreement.h @@ -4,13 +4,13 @@ #pragma once -#include "CardConnectionWorker.h" #include "asn1/SecurityInfo.h" +#include "CardConnectionWorker.h" #include "pace/DomainParameterMapping.h" #include "pace/KeyAgreement.h" -#include #include +#include class test_EcdhKeyAgreement; @@ -21,7 +21,7 @@ class EcdhKeyAgreement : public KeyAgreement { private: - friend class::test_EcdhKeyAgreement; + friend class ::test_EcdhKeyAgreement; QSharedPointer > mMapping; QSharedPointer mEphemeralCurve; diff --git a/src/card/base/pace/ec/EllipticCurveFactory.h b/src/card/base/pace/ec/EllipticCurveFactory.h index 130f190..71acefb 100644 --- a/src/card/base/pace/ec/EllipticCurveFactory.h +++ b/src/card/base/pace/ec/EllipticCurveFactory.h @@ -6,9 +6,9 @@ #include "asn1/SecurityInfo.h" +#include #include #include -#include namespace governikus { diff --git a/src/card/bluetooth/BluetoothCard.cpp b/src/card/bluetooth/BluetoothCard.cpp index be2ff9c..19b9248 100644 --- a/src/card/bluetooth/BluetoothCard.cpp +++ b/src/card/bluetooth/BluetoothCard.cpp @@ -5,11 +5,11 @@ */ #include "BluetoothCard.h" #include "DestroyPACEChannel.h" -#include "SynchronousBtCall.h" #include "messages/BluetoothMessageCreator.h" #include "messages/BluetoothMessageDisconnectResponse.h" #include "messages/BluetoothMessageSetTransportProtocolResponse.h" #include "messages/BluetoothMessageTransferApduResponse.h" +#include "SynchronousBtCall.h" #include diff --git a/src/card/bluetooth/BluetoothReader.cpp b/src/card/bluetooth/BluetoothReader.cpp index 91b5f37..906525d 100644 --- a/src/card/bluetooth/BluetoothReader.cpp +++ b/src/card/bluetooth/BluetoothReader.cpp @@ -8,11 +8,11 @@ #include "BluetoothDebug.h" #include "BluetoothReader.h" #include "DeviceError.h" -#include "SynchronousBtCall.h" #include "messages/BluetoothMessageCreator.h" #include "messages/BluetoothMessageParser.h" #include "messages/BluetoothMessageSetTransportProtocolResponse.h" #include "messages/BluetoothMessageStatusInd.h" +#include "SynchronousBtCall.h" #include #include diff --git a/src/card/bluetooth/messages/BluetoothMessage.h b/src/card/bluetooth/messages/BluetoothMessage.h index e212773..dcb99f8 100644 --- a/src/card/bluetooth/messages/BluetoothMessage.h +++ b/src/card/bluetooth/messages/BluetoothMessage.h @@ -24,7 +24,7 @@ class BluetoothMessage typedef QSharedPointer Ptr; private: - friend class::test_BluetoothMessageParser; + friend class ::test_BluetoothMessageParser; BluetoothMsgId mMsgId; QMap mMessageParameter; diff --git a/src/card/nfc/NFCConnector.java b/src/card/nfc/NFCConnector.java index b634ed5..eeee441 100644 --- a/src/card/nfc/NFCConnector.java +++ b/src/card/nfc/NFCConnector.java @@ -10,9 +10,9 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.nfc.NfcAdapter; +import android.nfc.tech.IsoDep; import android.nfc.Tag; import android.nfc.TagLostException; -import android.nfc.tech.IsoDep; import android.util.Log; diff --git a/src/card/nfc/NfcReaderManagerPlugIn.h b/src/card/nfc/NfcReaderManagerPlugIn.h index 8ebe7a3..9f17e43 100644 --- a/src/card/nfc/NfcReaderManagerPlugIn.h +++ b/src/card/nfc/NfcReaderManagerPlugIn.h @@ -32,7 +32,7 @@ class NfcReaderManagerPlugIn Q_INTERFACES(governikus::ReaderManagerPlugIn) #ifdef Q_OS_ANDROID - friend void::Java_com_governikus_ausweisapp2_NfcAdapterStateChangeReceiver_nfcAdapterStateChanged(JNIEnv * env, jobject obj, jint newState); + friend void ::Java_com_governikus_ausweisapp2_NfcAdapterStateChangeReceiver_nfcAdapterStateChanged(JNIEnv * env, jobject obj, jint newState); #endif private: diff --git a/src/cli/UIPlugInCli.h b/src/cli/UIPlugInCli.h index c0dc0d2..18eae5f 100644 --- a/src/cli/UIPlugInCli.h +++ b/src/cli/UIPlugInCli.h @@ -6,8 +6,8 @@ #pragma once -#include "ConsoleReader.h" #include "context/WorkflowContext.h" +#include "ConsoleReader.h" #include "view/UIPlugIn.h" #include diff --git a/src/core/context/AuthContext.cpp b/src/core/context/AuthContext.cpp index f541dd4..d1fc9c6 100644 --- a/src/core/context/AuthContext.cpp +++ b/src/core/context/AuthContext.cpp @@ -4,8 +4,8 @@ #include "AuthContext.h" -#include "AppSettings.h" #include "asn1/Chat.h" +#include "AppSettings.h" #include "paos/retrieve/DidAuthenticateEac1Parser.h" #include @@ -267,3 +267,16 @@ void AuthContext::initCvcChainBuilder(const QVectorgetAuthenticatedAuxiliaryData()); + + if (mDIDAuthenticateEAC1 && mDIDAuthenticateEAC1->getAuthenticatedAuxiliaryData()) + { + return mDIDAuthenticateEAC1->getAuthenticatedAuxiliaryData()->getRequiredAge(); + } + return QString(); +} diff --git a/src/core/context/AuthContext.h b/src/core/context/AuthContext.h index aeb8425..30ddf7c 100644 --- a/src/core/context/AuthContext.h +++ b/src/core/context/AuthContext.h @@ -8,18 +8,13 @@ #pragma once +#include "asn1/CVCertificate.h" +#include "asn1/CVCertificateChainBuilder.h" #include "ActivationHandler.h" +#include "context/WorkflowContext.h" #include "Commands.h" #include "EnumHelper.h" #include "NetworkManager.h" -#include "Result.h" -#include "SelfAuthenticationData.h" -#include "TcToken.h" -#include "UrlUtil.h" -#include "asn1/CVCertificate.h" -#include "asn1/CVCertificateChainBuilder.h" -#include "context/WorkflowContext.h" -#include "paos/MessageIdHandler.h" #include "paos/invoke/DidAuthenticateResponseEac1.h" #include "paos/invoke/DidAuthenticateResponseEac2.h" #include "paos/invoke/DidListResponse.h" @@ -27,6 +22,7 @@ #include "paos/invoke/InitializeFrameworkResponse.h" #include "paos/invoke/StartPaos.h" #include "paos/invoke/TransmitResponse.h" +#include "paos/MessageIdHandler.h" #include "paos/retrieve/DidAuthenticateEac1.h" #include "paos/retrieve/DidAuthenticateEac2.h" #include "paos/retrieve/DidAuthenticateEacAdditional.h" @@ -34,6 +30,10 @@ #include "paos/retrieve/InitializeFramework.h" #include "paos/retrieve/StartPaosResponse.h" #include "paos/retrieve/Transmit.h" +#include "Result.h" +#include "SelfAuthenticationData.h" +#include "TcToken.h" +#include "UrlUtil.h" #include #include @@ -56,11 +56,11 @@ class AuthContext Q_OBJECT private: - friend class::test_StatePrepareChat; - friend class::test_StateRedirectBrowser; - friend class::test_StatePreVerification; - friend class::test_StateProcessCertificatesFromEac2; - friend class::test_StateCertificateDescriptionCheck; + friend class ::test_StatePrepareChat; + friend class ::test_StateRedirectBrowser; + friend class ::test_StatePreVerification; + friend class ::test_StateProcessCertificatesFromEac2; + friend class ::test_StateCertificateDescriptionCheck; bool mTcTokenNotFound; bool mErrorReportedToServer; @@ -385,13 +385,7 @@ class AuthContext } - QString getRequiredAge() - { - Q_ASSERT(mDIDAuthenticateEAC1); - Q_ASSERT(mDIDAuthenticateEAC1->getAuthenticatedAuxiliaryData()); - return mDIDAuthenticateEAC1->getAuthenticatedAuxiliaryData()->getRequiredAge(); - } - + QString getRequiredAge() const; const QSet& getOptionalAccessRights() const { diff --git a/src/core/controller/AppController.cpp b/src/core/controller/AppController.cpp index e457992..5cb5560 100644 --- a/src/core/controller/AppController.cpp +++ b/src/core/controller/AppController.cpp @@ -5,6 +5,13 @@ */ #include "AppSettings.h" +#include "context/AuthContext.h" +#include "context/ChangePinContext.h" +#include "context/SelfAuthenticationContext.h" +#include "controller/AppController.h" +#include "controller/AuthController.h" +#include "controller/ChangePinController.h" +#include "controller/SelfAuthController.h" #include "DriverService.h" #include "HttpServerRequestor.h" #include "HttpServerStatusParser.h" @@ -14,13 +21,6 @@ #include "ProviderService.h" #include "ReaderManager.h" #include "ResourceLoader.h" -#include "context/AuthContext.h" -#include "context/ChangePinContext.h" -#include "context/SelfAuthenticationContext.h" -#include "controller/AppController.h" -#include "controller/AuthController.h" -#include "controller/ChangePinController.h" -#include "controller/SelfAuthController.h" #include "view/UILoader.h" #include diff --git a/src/core/controller/AppController.h b/src/core/controller/AppController.h index 381cbe4..67c121b 100644 --- a/src/core/controller/AppController.h +++ b/src/core/controller/AppController.h @@ -9,8 +9,8 @@ #pragma once #include "ActivationHandler.h" -#include "EnumHelper.h" #include "context/WorkflowContext.h" +#include "EnumHelper.h" #include "view/UIPlugIn.h" #include diff --git a/src/core/controller/AuthController.cpp b/src/core/controller/AuthController.cpp index 462ef57..653d080 100644 --- a/src/core/controller/AuthController.cpp +++ b/src/core/controller/AuthController.cpp @@ -31,8 +31,8 @@ #include "states/StateUpdateRetryCounter.h" #include "states/StateWriteHistory.h" -#include #include +#include using namespace governikus; @@ -135,6 +135,7 @@ AuthController::AuthController(QSharedPointer pContext) sEstablishPacePuk->addTransition(sEstablishPacePuk, &AbstractState::fireSuccess, sEstablishPacePin); sEstablishPacePuk->addTransition(sEstablishPacePuk, &StateEstablishPacePuk::fireInvalidPuk, sUpdateRetryCounter); + sEstablishPacePuk->addTransition(sEstablishPacePuk, &StateEstablishPacePuk::fireInoperativePuk, sUpdateRetryCounter); sEstablishPacePuk->addTransition(sEstablishPacePuk, &AbstractState::fireError, sSendDidAuthenticateResponseEac1); sEstablishPacePuk->addTransition(sEstablishPacePuk, &AbstractState::fireCancel, sSendDidAuthenticateResponseEac1); diff --git a/src/core/controller/ChangePinController.cpp b/src/core/controller/ChangePinController.cpp index c6018c9..8cc73f6 100644 --- a/src/core/controller/ChangePinController.cpp +++ b/src/core/controller/ChangePinController.cpp @@ -2,8 +2,8 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "ChangePinController.h" #include "context/ChangePinContext.h" +#include "ChangePinController.h" #include "states/CompositeStateSelectCard.h" #include "states/FinalState.h" #include "states/StateChangePin.h" diff --git a/src/core/controller/SelfAuthController.cpp b/src/core/controller/SelfAuthController.cpp index 36cd9fc..b2cb721 100644 --- a/src/core/controller/SelfAuthController.cpp +++ b/src/core/controller/SelfAuthController.cpp @@ -32,8 +32,8 @@ #include "states/StateWriteHistory.h" -#include #include +#include using namespace governikus; diff --git a/src/core/controller/WorkflowController.h b/src/core/controller/WorkflowController.h index 0f65713..bdb3972 100644 --- a/src/core/controller/WorkflowController.h +++ b/src/core/controller/WorkflowController.h @@ -24,7 +24,7 @@ class WorkflowController : public QObject { Q_OBJECT - friend class::test_ChangePinController; + friend class ::test_ChangePinController; protected: QStateMachine mStateMachine; diff --git a/src/core/paos/PaosMessage.h b/src/core/paos/PaosMessage.h index c9e1345..4401252 100644 --- a/src/core/paos/PaosMessage.h +++ b/src/core/paos/PaosMessage.h @@ -17,7 +17,7 @@ namespace governikus class PaosMessage { - friend class::test_PaosMessage; + friend class ::test_PaosMessage; private: QString mMessageID, mRelatesTo; diff --git a/src/core/paos/element/Eac1InputType.h b/src/core/paos/element/Eac1InputType.h index c1f4225..875d1ab 100644 --- a/src/core/paos/element/Eac1InputType.h +++ b/src/core/paos/element/Eac1InputType.h @@ -7,9 +7,9 @@ #pragma once #include "asn1/AuthenticatedAuxiliaryData.h" -#include "asn1/CVCertificate.h" #include "asn1/CertificateDescription.h" #include "asn1/Chat.h" +#include "asn1/CVCertificate.h" #include #include @@ -29,12 +29,12 @@ class TestAuthContext; class Eac1InputType { friend class DidAuthenticateEac1Parser; - friend class::test_StatePrepareChat; + friend class ::test_StatePrepareChat; friend class TestAuthContext; - friend class::test_StateExtractCvcsFromEac1InputType; - friend class::test_StatePreVerification; - friend class::test_StateCertificateDescriptionCheck; - friend class::test_StateProcessCertificatesFromEac2; + friend class ::test_StateExtractCvcsFromEac1InputType; + friend class ::test_StatePreVerification; + friend class ::test_StateCertificateDescriptionCheck; + friend class ::test_StateProcessCertificatesFromEac2; private: QVector > mCvCertificates; diff --git a/src/core/paos/element/Eac2InputType.h b/src/core/paos/element/Eac2InputType.h index 5c45812..79f3558 100644 --- a/src/core/paos/element/Eac2InputType.h +++ b/src/core/paos/element/Eac2InputType.h @@ -19,7 +19,7 @@ namespace governikus class Eac2InputType { friend class DidAuthenticateEac2Parser; - friend class::test_StateProcessCertificatesFromEac2; + friend class ::test_StateProcessCertificatesFromEac2; private: QByteArrayList mCvCertificatesAsBinary; diff --git a/src/core/paos/invoke/DidAuthenticateResponseEac1.h b/src/core/paos/invoke/DidAuthenticateResponseEac1.h index 846b430..e38aead 100644 --- a/src/core/paos/invoke/DidAuthenticateResponseEac1.h +++ b/src/core/paos/invoke/DidAuthenticateResponseEac1.h @@ -7,8 +7,8 @@ #pragma once #include "EstablishPACEChannel.h" -#include "PaosCreator.h" #include "paos/ResponseType.h" +#include "PaosCreator.h" #include #include diff --git a/src/core/paos/invoke/DidAuthenticateResponseEac2.h b/src/core/paos/invoke/DidAuthenticateResponseEac2.h index 5c2abca..9c93b93 100644 --- a/src/core/paos/invoke/DidAuthenticateResponseEac2.h +++ b/src/core/paos/invoke/DidAuthenticateResponseEac2.h @@ -6,8 +6,8 @@ #pragma once -#include "PaosCreator.h" #include "paos/ResponseType.h" +#include "PaosCreator.h" #include diff --git a/src/core/paos/invoke/DidListResponse.h b/src/core/paos/invoke/DidListResponse.h index b818ee7..8508a70 100644 --- a/src/core/paos/invoke/DidListResponse.h +++ b/src/core/paos/invoke/DidListResponse.h @@ -6,8 +6,8 @@ #pragma once -#include "PaosCreator.h" #include "paos/ResponseType.h" +#include "PaosCreator.h" namespace governikus { diff --git a/src/core/paos/invoke/DisconnectResponse.h b/src/core/paos/invoke/DisconnectResponse.h index 90ba5f0..64f5d18 100644 --- a/src/core/paos/invoke/DisconnectResponse.h +++ b/src/core/paos/invoke/DisconnectResponse.h @@ -6,8 +6,8 @@ #pragma once -#include "PaosCreator.h" #include "paos/ResponseType.h" +#include "PaosCreator.h" class test_DisconnectResponse; @@ -18,7 +18,7 @@ class DisconnectResponse : public PaosCreator , public ResponseType { - friend class::test_DisconnectResponse; + friend class ::test_DisconnectResponse; private: QString mSlotHandle; diff --git a/src/core/paos/invoke/InitializeFrameworkResponse.h b/src/core/paos/invoke/InitializeFrameworkResponse.h index 30d2784..644a772 100644 --- a/src/core/paos/invoke/InitializeFrameworkResponse.h +++ b/src/core/paos/invoke/InitializeFrameworkResponse.h @@ -6,9 +6,9 @@ #pragma once -#include "PaosCreator.h" -#include "paos/ResponseType.h" #include "paos/element/SupportedApi.h" +#include "paos/ResponseType.h" +#include "PaosCreator.h" namespace governikus { diff --git a/src/core/paos/invoke/PaosCreator.h b/src/core/paos/invoke/PaosCreator.h index 6ae95cb..88f36d1 100644 --- a/src/core/paos/invoke/PaosCreator.h +++ b/src/core/paos/invoke/PaosCreator.h @@ -17,7 +17,7 @@ namespace governikus class PaosCreator { - friend class::test_PaosCreator; + friend class ::test_PaosCreator; public: enum class Namespace diff --git a/src/core/paos/invoke/StartPaos.h b/src/core/paos/invoke/StartPaos.h index 0a11f75..681a530 100644 --- a/src/core/paos/invoke/StartPaos.h +++ b/src/core/paos/invoke/StartPaos.h @@ -6,11 +6,11 @@ #pragma once -#include "paos/PaosMessage.h" #include "paos/element/ConnectionHandle.h" #include "paos/element/SupportedApi.h" #include "paos/element/UserAgent.h" #include "paos/invoke/PaosCreator.h" +#include "paos/PaosMessage.h" class test_StartPaos; @@ -21,7 +21,7 @@ class StartPaos : public PaosCreator , public PaosMessage { - friend class::test_StartPaos; + friend class ::test_StartPaos; private: const QByteArray mSessionId; diff --git a/src/core/paos/invoke/TransmitResponse.h b/src/core/paos/invoke/TransmitResponse.h index e955fb2..10dbcdc 100644 --- a/src/core/paos/invoke/TransmitResponse.h +++ b/src/core/paos/invoke/TransmitResponse.h @@ -6,8 +6,8 @@ #pragma once -#include "PaosCreator.h" #include "paos/ResponseType.h" +#include "PaosCreator.h" class test_TransmitResponse; @@ -18,7 +18,7 @@ class TransmitResponse : public PaosCreator , public ResponseType { - friend class::test_TransmitResponse; + friend class ::test_TransmitResponse; private: QByteArrayList mOutputApdus; diff --git a/src/core/paos/retrieve/DidAuthenticateEac1.cpp b/src/core/paos/retrieve/DidAuthenticateEac1.cpp index aae5588..9ad726f 100644 --- a/src/core/paos/retrieve/DidAuthenticateEac1.cpp +++ b/src/core/paos/retrieve/DidAuthenticateEac1.cpp @@ -4,8 +4,8 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "DidAuthenticateEac1.h" #include "asn1/ASN1Util.h" +#include "DidAuthenticateEac1.h" using namespace governikus; diff --git a/src/core/paos/retrieve/DidAuthenticateEac1.h b/src/core/paos/retrieve/DidAuthenticateEac1.h index 96b73e6..cc5f411 100644 --- a/src/core/paos/retrieve/DidAuthenticateEac1.h +++ b/src/core/paos/retrieve/DidAuthenticateEac1.h @@ -8,13 +8,13 @@ #pragma once #include "asn1/AuthenticatedAuxiliaryData.h" -#include "asn1/CVCertificate.h" #include "asn1/CertificateDescription.h" #include "asn1/Chat.h" -#include "paos/ElementDetector.h" -#include "paos/PaosMessage.h" +#include "asn1/CVCertificate.h" #include "paos/element/ConnectionHandle.h" #include "paos/element/Eac1InputType.h" +#include "paos/ElementDetector.h" +#include "paos/PaosMessage.h" #include @@ -32,12 +32,12 @@ class DIDAuthenticateEAC1 : public PaosMessage { friend class DidAuthenticateEac1Parser; - friend class::test_StatePrepareChat; + friend class ::test_StatePrepareChat; friend class TestAuthContext; - friend class::test_StatePreVerification; - friend class::test_StateExtractCvcsFromEac1InputType; - friend class::test_StateProcessCertificatesFromEac2; - friend class::test_StateCertificateDescriptionCheck; + friend class ::test_StatePreVerification; + friend class ::test_StateExtractCvcsFromEac1InputType; + friend class ::test_StateProcessCertificatesFromEac2; + friend class ::test_StateCertificateDescriptionCheck; private: ConnectionHandle mConnectionHandle; diff --git a/src/core/paos/retrieve/DidAuthenticateEac2.h b/src/core/paos/retrieve/DidAuthenticateEac2.h index 05bd6b3..0ba84ae 100644 --- a/src/core/paos/retrieve/DidAuthenticateEac2.h +++ b/src/core/paos/retrieve/DidAuthenticateEac2.h @@ -8,9 +8,9 @@ #pragma once -#include "paos/PaosMessage.h" #include "paos/element/ConnectionHandle.h" #include "paos/element/Eac2InputType.h" +#include "paos/PaosMessage.h" class test_StateProcessCertificatesFromEac2; @@ -21,7 +21,7 @@ class DIDAuthenticateEAC2 : public PaosMessage { friend class DidAuthenticateEac2Parser; - friend class::test_StateProcessCertificatesFromEac2; + friend class ::test_StateProcessCertificatesFromEac2; private: ConnectionHandle mConnectionHandle; diff --git a/src/core/paos/retrieve/DidAuthenticateEac2Parser.h b/src/core/paos/retrieve/DidAuthenticateEac2Parser.h index f16a751..2e1ba3f 100644 --- a/src/core/paos/retrieve/DidAuthenticateEac2Parser.h +++ b/src/core/paos/retrieve/DidAuthenticateEac2Parser.h @@ -6,8 +6,8 @@ #pragma once -#include "paos/PaosMessage.h" #include "paos/element/Eac2InputType.h" +#include "paos/PaosMessage.h" #include "paos/retrieve/DidAuthenticateEac2.h" #include "paos/retrieve/PaosParser.h" diff --git a/src/core/paos/retrieve/DidAuthenticateEacAdditional.h b/src/core/paos/retrieve/DidAuthenticateEacAdditional.h index 717c900..1b721a1 100644 --- a/src/core/paos/retrieve/DidAuthenticateEacAdditional.h +++ b/src/core/paos/retrieve/DidAuthenticateEacAdditional.h @@ -6,8 +6,8 @@ #pragma once -#include "paos/PaosMessage.h" #include "paos/element/ConnectionHandle.h" +#include "paos/PaosMessage.h" #include diff --git a/src/core/paos/retrieve/DidList.h b/src/core/paos/retrieve/DidList.h index 8d3ede5..178bcb6 100644 --- a/src/core/paos/retrieve/DidList.h +++ b/src/core/paos/retrieve/DidList.h @@ -8,9 +8,9 @@ #pragma once +#include "paos/element/ConnectionHandle.h" #include "paos/ElementDetector.h" #include "paos/PaosMessage.h" -#include "paos/element/ConnectionHandle.h" namespace governikus { diff --git a/src/core/paos/retrieve/PaosParser.h b/src/core/paos/retrieve/PaosParser.h index 0b776d7..ede440b 100644 --- a/src/core/paos/retrieve/PaosParser.h +++ b/src/core/paos/retrieve/PaosParser.h @@ -6,8 +6,8 @@ #pragma once -#include "paos/PaosMessage.h" #include "paos/element/ElementParser.h" +#include "paos/PaosMessage.h" namespace governikus { diff --git a/src/core/states/AbstractState.h b/src/core/states/AbstractState.h index ddce3fb..4f447f6 100644 --- a/src/core/states/AbstractState.h +++ b/src/core/states/AbstractState.h @@ -8,8 +8,8 @@ #pragma once -#include "Result.h" #include "context/WorkflowContext.h" +#include "Result.h" #include #include diff --git a/src/core/states/StateCertificateDescriptionCheck.cpp b/src/core/states/StateCertificateDescriptionCheck.cpp index ddacc7b..bca1542 100644 --- a/src/core/states/StateCertificateDescriptionCheck.cpp +++ b/src/core/states/StateCertificateDescriptionCheck.cpp @@ -4,10 +4,10 @@ #include "StateCertificateDescriptionCheck.h" -#include "AppSettings.h" -#include "UrlUtil.h" #include "asn1/CVCertificateChainBuilder.h" #include "asn1/KnownOIDs.h" +#include "AppSettings.h" +#include "UrlUtil.h" using namespace governikus; diff --git a/src/core/states/StateCertificateDescriptionCheck.h b/src/core/states/StateCertificateDescriptionCheck.h index 116d414..c148e98 100644 --- a/src/core/states/StateCertificateDescriptionCheck.h +++ b/src/core/states/StateCertificateDescriptionCheck.h @@ -17,7 +17,7 @@ class StateCertificateDescriptionCheck { Q_OBJECT friend class StateBuilder; - friend class::test_StateCertificateDescriptionCheck; + friend class ::test_StateCertificateDescriptionCheck; StateCertificateDescriptionCheck(const QSharedPointer& pContext); virtual void run() override; diff --git a/src/core/states/StateCheckRefreshAddress.h b/src/core/states/StateCheckRefreshAddress.h index 1c5a905..5b84b2c 100644 --- a/src/core/states/StateCheckRefreshAddress.h +++ b/src/core/states/StateCheckRefreshAddress.h @@ -28,7 +28,7 @@ class StateCheckRefreshAddress { Q_OBJECT friend class StateBuilder; - friend class::test_StateCheckRefreshAddress; + friend class ::test_StateCheckRefreshAddress; StateCheckRefreshAddress(const QSharedPointer& pContext); diff --git a/src/core/states/StateDidAuthenticateEac1.cpp b/src/core/states/StateDidAuthenticateEac1.cpp index c6b5724..ba23e5e 100644 --- a/src/core/states/StateDidAuthenticateEac1.cpp +++ b/src/core/states/StateDidAuthenticateEac1.cpp @@ -4,10 +4,10 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ +#include "asn1/CVCertificateChainBuilder.h" #include "CardConnection.h" #include "Result.h" #include "StateDidAuthenticateEac1.h" -#include "asn1/CVCertificateChainBuilder.h" #include diff --git a/src/core/states/StateDidAuthenticateEac2.cpp b/src/core/states/StateDidAuthenticateEac2.cpp index 23354e0..48a3676 100644 --- a/src/core/states/StateDidAuthenticateEac2.cpp +++ b/src/core/states/StateDidAuthenticateEac2.cpp @@ -2,10 +2,10 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "CardConnection.h" -#include "StateDidAuthenticateEac2.h" #include "asn1/CVCertificate.h" #include "asn1/CVCertificateChainBuilder.h" +#include "CardConnection.h" +#include "StateDidAuthenticateEac2.h" using namespace governikus; diff --git a/src/core/states/StateDidList.cpp b/src/core/states/StateDidList.cpp index ad3c238..5ae7040 100644 --- a/src/core/states/StateDidList.cpp +++ b/src/core/states/StateDidList.cpp @@ -4,8 +4,8 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "StateDidList.h" #include "paos/invoke/DidListResponse.h" +#include "StateDidList.h" using namespace governikus; diff --git a/src/core/states/StateExtractCvcsFromEac1IntputType.h b/src/core/states/StateExtractCvcsFromEac1IntputType.h index 2a32094..97d5557 100644 --- a/src/core/states/StateExtractCvcsFromEac1IntputType.h +++ b/src/core/states/StateExtractCvcsFromEac1IntputType.h @@ -19,7 +19,7 @@ class StateExtractCvcsFromEac1IntputType { Q_OBJECT friend class StateBuilder; - friend class::test_StateExtractCvcsFromEac1InputType; + friend class ::test_StateExtractCvcsFromEac1InputType; StateExtractCvcsFromEac1IntputType(const QSharedPointer& pContext); virtual void run() override; diff --git a/src/core/states/StateGenericSendReceive.cpp b/src/core/states/StateGenericSendReceive.cpp index f148473..15dd218 100644 --- a/src/core/states/StateGenericSendReceive.cpp +++ b/src/core/states/StateGenericSendReceive.cpp @@ -3,9 +3,9 @@ */ #include "CertificateChecker.h" +#include "paos/PaosHandler.h" #include "StateGenericSendReceive.h" #include "TlsConfiguration.h" -#include "paos/PaosHandler.h" Q_DECLARE_LOGGING_CATEGORY(network) diff --git a/src/core/states/StateGenericSendReceive.h b/src/core/states/StateGenericSendReceive.h index 21237c3..6ccc304 100644 --- a/src/core/states/StateGenericSendReceive.h +++ b/src/core/states/StateGenericSendReceive.h @@ -5,9 +5,9 @@ #pragma once #include "context/AuthContext.h" +#include "paos/invoke/PaosCreator.h" #include "paos/PaosMessage.h" #include "paos/PaosType.h" -#include "paos/invoke/PaosCreator.h" #include "states/AbstractGenericState.h" #include diff --git a/src/core/states/StateGetSelfAuthenticationData.h b/src/core/states/StateGetSelfAuthenticationData.h index 958e0ee..d523914 100644 --- a/src/core/states/StateGetSelfAuthenticationData.h +++ b/src/core/states/StateGetSelfAuthenticationData.h @@ -8,9 +8,9 @@ #pragma once +#include "context/SelfAuthenticationContext.h" #include "NetworkManager.h" #include "Result.h" -#include "context/SelfAuthenticationContext.h" #include "states/AbstractGenericState.h" namespace governikus diff --git a/src/core/states/StatePreVerification.cpp b/src/core/states/StatePreVerification.cpp index 20a9686..67d7e14 100644 --- a/src/core/states/StatePreVerification.cpp +++ b/src/core/states/StatePreVerification.cpp @@ -4,10 +4,10 @@ #include "StatePreVerification.h" -#include "AppSettings.h" -#include "EnumHelper.h" #include "asn1/CVCertificateChainBuilder.h" #include "asn1/SignatureChecker.h" +#include "AppSettings.h" +#include "EnumHelper.h" #include diff --git a/src/core/states/StatePreVerification.h b/src/core/states/StatePreVerification.h index 2165d95..b23d8da 100644 --- a/src/core/states/StatePreVerification.h +++ b/src/core/states/StatePreVerification.h @@ -23,7 +23,7 @@ class StatePreVerification { Q_OBJECT friend class StateBuilder; - friend class::test_StatePreVerification; + friend class ::test_StatePreVerification; const QVector > mTrustedCvcas; const QDateTime mValidationDateTime; diff --git a/src/core/states/StateProcessCertificatesFromEac2.cpp b/src/core/states/StateProcessCertificatesFromEac2.cpp index fa5d790..a3f3a3e 100644 --- a/src/core/states/StateProcessCertificatesFromEac2.cpp +++ b/src/core/states/StateProcessCertificatesFromEac2.cpp @@ -4,8 +4,8 @@ #include "StateProcessCertificatesFromEac2.h" -#include "Result.h" #include "asn1/CVCertificateChainBuilder.h" +#include "Result.h" #include diff --git a/src/core/states/StateProcessCertificatesFromEac2.h b/src/core/states/StateProcessCertificatesFromEac2.h index bf8437e..b3b5bd8 100644 --- a/src/core/states/StateProcessCertificatesFromEac2.h +++ b/src/core/states/StateProcessCertificatesFromEac2.h @@ -19,7 +19,7 @@ class StateProcessCertificatesFromEac2 { Q_OBJECT friend class StateBuilder; - friend class::test_StateProcessCertificatesFromEac2; + friend class ::test_StateProcessCertificatesFromEac2; StateProcessCertificatesFromEac2(const QSharedPointer& pContext); virtual void run() override; diff --git a/src/core/states/StateRedirectBrowser.h b/src/core/states/StateRedirectBrowser.h index bb69872..a8702e8 100644 --- a/src/core/states/StateRedirectBrowser.h +++ b/src/core/states/StateRedirectBrowser.h @@ -8,8 +8,8 @@ #pragma once -#include "Result.h" #include "context/AuthContext.h" +#include "Result.h" #include "states/AbstractGenericState.h" namespace governikus diff --git a/src/core/states/StateSelectNfcReader.cpp b/src/core/states/StateSelectNfcReader.cpp index 05d9233..e08fda3 100644 --- a/src/core/states/StateSelectNfcReader.cpp +++ b/src/core/states/StateSelectNfcReader.cpp @@ -2,9 +2,9 @@ * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ +#include "context/ChangePinContext.h" #include "ReaderManager.h" #include "StateSelectNfcReader.h" -#include "context/ChangePinContext.h" using namespace governikus; diff --git a/src/core/states/StateStartPaos.cpp b/src/core/states/StateStartPaos.cpp index f1ba025..d5fca84 100644 --- a/src/core/states/StateStartPaos.cpp +++ b/src/core/states/StateStartPaos.cpp @@ -3,8 +3,8 @@ */ #include "CardConnection.h" -#include "StateStartPaos.h" #include "paos/invoke/StartPaos.h" +#include "StateStartPaos.h" using namespace governikus; diff --git a/src/export/PdfCreator.cpp b/src/export/PdfCreator.cpp index 530b922..24d3889 100644 --- a/src/export/PdfCreator.cpp +++ b/src/export/PdfCreator.cpp @@ -12,8 +12,8 @@ #include #include #include -#include #include +#include using namespace governikus; diff --git a/src/global/BuildHelper.cpp b/src/global/BuildHelper.cpp index d494c21..80df59f 100644 --- a/src/global/BuildHelper.cpp +++ b/src/global/BuildHelper.cpp @@ -21,12 +21,7 @@ const char* BuildHelper::mDateTime = __DATE__ " / " __TIME__; int BuildHelper::getVersionCode() { - if (VersionNumber::getApplicationVersion().isDeveloperVersion()) - { - return getVersionCode(QStringLiteral("com.governikus.ausweisapp2.dev")); - } - - return getVersionCode(QStringLiteral("com.governikus.ausweisapp2")); + return getVersionCode(getPackageName()); } @@ -67,4 +62,17 @@ int BuildHelper::getVersionCode(const QString& pPackageName) } +QString BuildHelper::getPackageName() +{ + auto context = QtAndroid::androidContext(); + auto name = context.callObjectMethod("getPackageName", "()Ljava/lang/String;"); + if (name.isValid()) + { + return name.toString(); + } + + return QString(); +} + + #endif diff --git a/src/global/BuildHelper.h b/src/global/BuildHelper.h index dea6694..601c361 100644 --- a/src/global/BuildHelper.h +++ b/src/global/BuildHelper.h @@ -28,6 +28,7 @@ class BuildHelper #ifdef Q_OS_ANDROID static int getVersionCode(); static int getVersionCode(const QString& pPackageName); + static QString getPackageName(); #endif diff --git a/src/global/EnumHelper.h b/src/global/EnumHelper.h index d8948f0..593fd25 100644 --- a/src/global/EnumHelper.h +++ b/src/global/EnumHelper.h @@ -24,18 +24,18 @@ namespace governikus return pDbg.noquote() << Enum::getName(pType);\ }\ \ - inline QString& operator+=(QString& pStr, enumName pType)\ + inline QString& operator+=(QString & pStr, enumName pType)\ {\ pStr += Enum::getName(pType);\ return pStr;\ }\ \ - inline QString operator+(const QString& pStr, enumName pType)\ + inline QString operator+(const QString &pStr, enumName pType)\ {\ return pStr + Enum::getName(pType);\ }\ \ - inline QString operator+(enumName pType, const QString& pStr)\ + inline QString operator+(enumName pType, const QString &pStr)\ {\ return Enum::getName(pType) + pStr;\ }\ diff --git a/src/global/EnvHolder.h b/src/global/EnvHolder.h index 373e268..d194c2a 100644 --- a/src/global/EnvHolder.h +++ b/src/global/EnvHolder.h @@ -6,13 +6,13 @@ #pragma once +#include +#include #include #include #include #include #include -#include -#include namespace governikus { @@ -44,7 +44,7 @@ class EnvHolder static EnvHolder& getInstance(); template - typename std::enable_if::value&& std::is_destructible::value, T*>::type storeSingleton(Identifier pId) + typename std::enable_if::value && std::is_destructible::value, T*>::type storeSingleton(Identifier pId) { static_assert(std::has_virtual_destructor::value, "Destructor must be virtual"); diff --git a/src/global/LanguageLoader.h b/src/global/LanguageLoader.h index 8f5efde..8a96cad 100644 --- a/src/global/LanguageLoader.h +++ b/src/global/LanguageLoader.h @@ -21,8 +21,8 @@ namespace governikus class LanguageLoader { private: - friend class::test_LanguageLoader; - friend class::test_ProviderParser; + friend class ::test_LanguageLoader; + friend class ::test_ProviderParser; static const QLocale::Language mFallbackLanguage; static QLocale mDefaultLanguage; diff --git a/src/global/LogHandler.h b/src/global/LogHandler.h index a61b910..48e6551 100644 --- a/src/global/LogHandler.h +++ b/src/global/LogHandler.h @@ -22,7 +22,7 @@ class LogHandler : public QObject { Q_OBJECT - friend class::test_LogHandler; + friend class ::test_LogHandler; private: const bool mEnvPattern; diff --git a/src/global/Result.h b/src/global/Result.h index 342b167..253eb4c 100644 --- a/src/global/Result.h +++ b/src/global/Result.h @@ -27,7 +27,7 @@ class Result Q_DECLARE_TR_FUNCTIONS(governikus::Result) friend class StartPaosResponse; - friend class::test_result; + friend class ::test_result; public: enum class Major diff --git a/src/global/VersionNumber.cpp b/src/global/VersionNumber.cpp index 6a06f68..3cdb6ba 100644 --- a/src/global/VersionNumber.cpp +++ b/src/global/VersionNumber.cpp @@ -17,11 +17,14 @@ const VersionNumber &VersionNumber::getApplicationVersion() } VersionNumber::VersionNumber(const QString& pVersion) - : mOriginalVersion(pVersion) - , mSuffixIndex() - , mVersionNumber(QVersionNumber::fromString(pVersion, &mSuffixIndex)) - , mSuffix(mOriginalVersion.mid(mSuffixIndex).trimmed()) + : mVersionNumber() + , mSuffix() { + // do not initialize idx, otherwise you will trap into + // a gcc bug: https://bugs.alpinelinux.org/issues/7584 + int idx; + mVersionNumber = QVersionNumber::fromString(pVersion, &idx); + mSuffix = pVersion.mid(idx).trimmed(); } @@ -33,7 +36,7 @@ const QVersionNumber& VersionNumber::getVersionNumber() const bool VersionNumber::isDeveloperVersion() const { - return (mVersionNumber.minorVersion() & 1) || !mSuffix.isEmpty(); + return mVersionNumber.isNull() || (mVersionNumber.minorVersion() & 1) || !mSuffix.isEmpty(); } diff --git a/src/global/VersionNumber.h b/src/global/VersionNumber.h index c5b85b8..97aaea7 100644 --- a/src/global/VersionNumber.h +++ b/src/global/VersionNumber.h @@ -14,10 +14,8 @@ namespace governikus class VersionNumber { private: - const QString mOriginalVersion; - int mSuffixIndex; - const QVersionNumber mVersionNumber; - const QString mSuffix; + QVersionNumber mVersionNumber; + QString mSuffix; friend bool operator==(const VersionNumber& pLeft, const VersionNumber& pRight); diff --git a/src/gui/AboutDialog.cpp b/src/gui/AboutDialog.cpp index ef7d84c..104271d 100644 --- a/src/gui/AboutDialog.cpp +++ b/src/gui/AboutDialog.cpp @@ -37,8 +37,7 @@ AboutDialog::AboutDialog(QWidget* pParent) connect(mUi->btnOkay, &QPushButton::clicked, this, &QDialog::accept); connect(this, &QDialog::accepted, this, &AboutDialog::onAccept); - const bool intialCheckState = AppSettings::getInstance().getGeneralSettings().isDeveloperMode() ? Qt::Checked : Qt::Unchecked; - mUi->chkbDeveloperMode->setCheckState(intialCheckState ? Qt::Checked : Qt::Unchecked); + mUi->chkbDeveloperMode->setCheckState(AppSettings::getInstance().getGeneralSettings().isDeveloperMode() ? Qt::Checked : Qt::Unchecked); connect(mUi->chkbDeveloperMode, &QCheckBox::stateChanged, this, &AboutDialog::onCheckboxStateChanged); onCheckboxStateChanged(); diff --git a/src/gui/AppQtGui.cpp b/src/gui/AppQtGui.cpp index 8a49524..d5ea31d 100644 --- a/src/gui/AppQtGui.cpp +++ b/src/gui/AppQtGui.cpp @@ -8,14 +8,14 @@ #include "AppSettings.h" #include "DiagnosisGui.h" +#include "generic/HelpAction.h" +#include "generic/Page.h" #include "GuiProfile.h" #include "NetworkManager.h" #include "ReaderDriverGui.h" #include "SetupAssistantGui.h" -#include "UpdateWindow.h" #include "Updater.h" -#include "generic/HelpAction.h" -#include "generic/Page.h" +#include "UpdateWindow.h" #include "workflow/WorkflowAuthenticateQtGui.h" #include "workflow/WorkflowChangePinQtGui.h" #include "workflow/WorkflowGui.h" diff --git a/src/gui/AppQtMainWidget.cpp b/src/gui/AppQtMainWidget.cpp index 2bc047a..f6c37eb 100644 --- a/src/gui/AppQtMainWidget.cpp +++ b/src/gui/AppQtMainWidget.cpp @@ -6,16 +6,16 @@ #include "AboutDialog.h" #include "BuildHelper.h" +#include "generic/ExclusiveButtonGroup.h" +#include "generic/HelpAction.h" #include "GuiProfile.h" #include "LogHandler.h" #include "ReaderDetector.h" #include "ReaderDriverDialog.h" -#include "SetupAssistantWizard.h" -#include "VersionNumber.h" -#include "generic/ExclusiveButtonGroup.h" -#include "generic/HelpAction.h" #include "step/AuthenticateStepsWidget.h" +#include "SetupAssistantWizard.h" #include "ui_AppQtMainWidget.h" +#include "VersionNumber.h" #include "workflow/WorkflowQtWidget.h" #include diff --git a/src/gui/AppQtMainWidget.h b/src/gui/AppQtMainWidget.h index 7abc52b..8c5b78e 100644 --- a/src/gui/AppQtMainWidget.h +++ b/src/gui/AppQtMainWidget.h @@ -13,9 +13,9 @@ #include #include -#include "LogFilesDialog.h" #include "context/ChangePinContext.h" #include "generic/GuiModule.h" +#include "LogFilesDialog.h" #include "workflow/WorkflowWidgetParent.h" namespace Ui diff --git a/src/gui/AppStartPage.cpp b/src/gui/AppStartPage.cpp index bd4559b..20ebe1c 100644 --- a/src/gui/AppStartPage.cpp +++ b/src/gui/AppStartPage.cpp @@ -6,9 +6,9 @@ #include "AppStartPage.h" -#include "GuiProfile.h" #include "generic/LayoutBuilder.h" #include "generic/TabButtonGroup.h" +#include "GuiProfile.h" #include "ui_AppStartPage.h" #include diff --git a/src/gui/DiagnosisDialog.h b/src/gui/DiagnosisDialog.h index 59fa4a2..0d139ba 100644 --- a/src/gui/DiagnosisDialog.h +++ b/src/gui/DiagnosisDialog.h @@ -8,8 +8,8 @@ #pragma once -#include "DiagnosisWidget.h" #include "context/DiagnosisContext.h" +#include "DiagnosisWidget.h" #include #include diff --git a/src/gui/DiagnosisGui.h b/src/gui/DiagnosisGui.h index 17a9ac5..2a80ef3 100644 --- a/src/gui/DiagnosisGui.h +++ b/src/gui/DiagnosisGui.h @@ -6,9 +6,9 @@ #pragma once -#include "DiagnosisDialog.h" #include "context/DiagnosisContext.h" #include "controller/DiagnosisController.h" +#include "DiagnosisDialog.h" #include #include diff --git a/src/gui/GeneralSettingsWidget.cpp b/src/gui/GeneralSettingsWidget.cpp index 1893ee0..612c642 100644 --- a/src/gui/GeneralSettingsWidget.cpp +++ b/src/gui/GeneralSettingsWidget.cpp @@ -5,8 +5,8 @@ #include "GeneralSettingsWidget.h" #include "AppSettings.h" -#include "UpdateWindow.h" #include "ui_GeneralSettingsWidget.h" +#include "UpdateWindow.h" using namespace governikus; diff --git a/src/gui/HistoryWidget.cpp b/src/gui/HistoryWidget.cpp index 52e3ae0..003ed2c 100644 --- a/src/gui/HistoryWidget.cpp +++ b/src/gui/HistoryWidget.cpp @@ -5,13 +5,13 @@ #include "HistoryWidget.h" #include "DeleteHistoryDialog.h" -#include "PdfCreator.h" #include "generic/ListCheckItemWidget.h" #include "generic/ListItem.h" #include "generic/ListItemIconLeft.h" #include "generic/ListItemIconRight.h" #include "generic/ListItemSubTitle.h" #include "generic/ListItemTitle.h" +#include "PdfCreator.h" #include "ui_HistoryWidget.h" #include diff --git a/src/gui/HistoryWidget.h b/src/gui/HistoryWidget.h index 5d71e9a..533fac3 100644 --- a/src/gui/HistoryWidget.h +++ b/src/gui/HistoryWidget.h @@ -6,19 +6,19 @@ #include "AppSettings.h" #include "DetailDialog.h" -#include "HistoryDetailWidget.h" #include "generic/ListCheckItemWidget.h" #include "generic/Page.h" +#include "HistoryDetailWidget.h" #include #include #include #include +#include #include #include #include #include -#include namespace Ui { diff --git a/src/gui/HistoryWidgetQml.h b/src/gui/HistoryWidgetQml.h index 3e67466..423973f 100644 --- a/src/gui/HistoryWidgetQml.h +++ b/src/gui/HistoryWidgetQml.h @@ -8,9 +8,9 @@ #include "AppSettings.h" #include "DetailDialog.h" +#include "generic/Page.h" #include "HistoryModel.h" #include "QmlExtension.h" -#include "generic/Page.h" #include #include diff --git a/src/gui/LogFilesDialog.cpp b/src/gui/LogFilesDialog.cpp index e537d69..d7d27d2 100644 --- a/src/gui/LogFilesDialog.cpp +++ b/src/gui/LogFilesDialog.cpp @@ -7,8 +7,8 @@ #include "LogFilesDialog.h" #include "ui_LogFilesDialog.h" -#include "LogHandler.h" #include "generic/HelpAction.h" +#include "LogHandler.h" #include #include diff --git a/src/gui/MainPage.cpp b/src/gui/MainPage.cpp index 7aada90..5152d56 100644 --- a/src/gui/MainPage.cpp +++ b/src/gui/MainPage.cpp @@ -9,9 +9,9 @@ #include #include -#include "GuiProfile.h" #include "generic/LayoutBuilder.h" #include "generic/TabButtonGroup.h" +#include "GuiProfile.h" using namespace governikus; diff --git a/src/gui/PinSettingsWidget.cpp b/src/gui/PinSettingsWidget.cpp index 94fb4b4..4f8ee6c 100644 --- a/src/gui/PinSettingsWidget.cpp +++ b/src/gui/PinSettingsWidget.cpp @@ -4,12 +4,12 @@ #include "PinSettingsWidget.h" +#include "generic/PasswordEdit.h" +#include "generic/SmartCardUtil.h" #include "RandomPinDialog.h" #include "ReaderInfo.h" #include "ReaderManager.h" #include "SmartCardDefinitions.h" -#include "generic/PasswordEdit.h" -#include "generic/SmartCardUtil.h" #include "ui_PinSettingsWidget.h" #include diff --git a/src/gui/PinSettingsWidget.h b/src/gui/PinSettingsWidget.h index b8aebef..f520aca 100644 --- a/src/gui/PinSettingsWidget.h +++ b/src/gui/PinSettingsWidget.h @@ -7,8 +7,8 @@ #pragma once #include "DiagnosisWidget.h" -#include "PinSettingsInfoWidget.h" #include "generic/Page.h" +#include "PinSettingsInfoWidget.h" #include diff --git a/src/gui/ProviderWidget.cpp b/src/gui/ProviderWidget.cpp index 9dd8082..467e1a8 100644 --- a/src/gui/ProviderWidget.cpp +++ b/src/gui/ProviderWidget.cpp @@ -7,14 +7,14 @@ #include "ProviderWidget.h" #include "AppSettings.h" -#include "ProviderService.h" -#include "ProviderSettings.h" #include "generic/ListCheckItemWidget.h" #include "generic/ListItem.h" #include "generic/ListItemIconLeft.h" #include "generic/ListItemIconRight.h" #include "generic/ListItemSubTitle.h" #include "generic/ListItemTitle.h" +#include "ProviderService.h" +#include "ProviderSettings.h" #include "ui_ProviderWidget.h" #include diff --git a/src/gui/ProviderWidgetQml.h b/src/gui/ProviderWidgetQml.h index b56c97b..8cbcf6e 100644 --- a/src/gui/ProviderWidgetQml.h +++ b/src/gui/ProviderWidgetQml.h @@ -7,10 +7,10 @@ #pragma once #include "AppSettings.h" +#include "generic/Page.h" #include "HistoryModel.h" #include "ProviderCategoryFilterModel.h" #include "QmlExtension.h" -#include "generic/Page.h" #include #include diff --git a/src/gui/RandomPinDialog.cpp b/src/gui/RandomPinDialog.cpp index faa16d1..0c24b9b 100644 --- a/src/gui/RandomPinDialog.cpp +++ b/src/gui/RandomPinDialog.cpp @@ -7,12 +7,12 @@ #include "RandomPinDialog.h" #include "ui_RandomPinDialog.h" +#include "generic/HelpAction.h" #include "Randomizer.h" #include "ReaderManager.h" -#include "generic/HelpAction.h" -#include #include +#include using namespace governikus; diff --git a/src/gui/ReaderDriverDialog.cpp b/src/gui/ReaderDriverDialog.cpp index 5d6004c..0ad7e3b 100644 --- a/src/gui/ReaderDriverDialog.cpp +++ b/src/gui/ReaderDriverDialog.cpp @@ -4,8 +4,8 @@ * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ -#include "ReaderDriverDialog.h" #include "generic/HelpAction.h" +#include "ReaderDriverDialog.h" #include "ui_ReaderDriverDialog.h" diff --git a/src/gui/ReaderDriverDialog.h b/src/gui/ReaderDriverDialog.h index 25b0c0f..8120652 100644 --- a/src/gui/ReaderDriverDialog.h +++ b/src/gui/ReaderDriverDialog.h @@ -9,8 +9,8 @@ #pragma once -#include "ReaderDriverWidget.h" #include "context/ReaderDriverContext.h" +#include "ReaderDriverWidget.h" #include #include diff --git a/src/gui/ReaderDriverGui.h b/src/gui/ReaderDriverGui.h index fc4d7ec..656a1bc 100644 --- a/src/gui/ReaderDriverGui.h +++ b/src/gui/ReaderDriverGui.h @@ -8,8 +8,8 @@ #pragma once -#include "ReaderDriverDialog.h" #include "context/ReaderDriverContext.h" +#include "ReaderDriverDialog.h" class QWidget; diff --git a/src/gui/ReaderDriverWidget.cpp b/src/gui/ReaderDriverWidget.cpp index 5ed8d7e..bd318fb 100644 --- a/src/gui/ReaderDriverWidget.cpp +++ b/src/gui/ReaderDriverWidget.cpp @@ -1,8 +1,8 @@ #include "ReaderDriverWidget.h" #include "DriverSettings.h" -#include "ReaderManager.h" #include "generic/SmartCardUtil.h" +#include "ReaderManager.h" #include "ui_ReaderDriverWidget.h" #include diff --git a/src/gui/SetupAssistantWizard.cpp b/src/gui/SetupAssistantWizard.cpp index c03faf7..d02da00 100644 --- a/src/gui/SetupAssistantWizard.cpp +++ b/src/gui/SetupAssistantWizard.cpp @@ -5,12 +5,12 @@ */ #include "AppSettings.h" -#include "ReaderInfo.h" -#include "ReaderManager.h" -#include "SetupAssistantWizard.h" #include "generic/GuiUtils.h" #include "generic/HelpAction.h" #include "generic/SmartCardUtil.h" +#include "ReaderInfo.h" +#include "ReaderManager.h" +#include "SetupAssistantWizard.h" #include "ReaderDriverWidget.h" @@ -250,43 +250,43 @@ void SetupAssistantWizard::addReader(QTableWidget* pTableWidget, int pRow, Reade { case ReaderType::REINER_cyberJack_RFID_komfort: manufacturerLabel->setText(QStringLiteral("Reiner SCT
cyberJack RFID komfort")); - manufacturerWebPage = QStringLiteral("https://www.reiner-sct.com/support/support-anfrage/?productGroup=77304735&product=77304822&q=driver#choice4"); + manufacturerWebPage = QStringLiteral("https://www.reiner-sct.com/support/support-anfrage/?os=Windows&productGroup=77304735&product=77304822&q=driver#choice5"); break; case ReaderType::REINER_cyberJack_RFID_standard: manufacturerLabel->setText(QStringLiteral("Reiner SCT
cyberJack RFID standard")); - manufacturerWebPage = QStringLiteral("https://www.reiner-sct.com/support/support-anfrage/?productGroup=77304735&product=77304820&q=driver#choice4"); + manufacturerWebPage = QStringLiteral("https://www.reiner-sct.com/support/support-anfrage/?os=Windows&productGroup=77304735&product=77304820&q=driver#choice5"); break; case ReaderType::REINER_cyberJack_RFID_basis: manufacturerLabel->setText(QStringLiteral("Reiner SCT
cyberJack RFID basis")); - manufacturerWebPage = QStringLiteral("https://www.reiner-sct.com/support/support-anfrage/?productGroup=77304735&product=77304856#choice3"); + manufacturerWebPage = QStringLiteral("https://www.reiner-sct.com/support/support-anfrage/?os=Windows&productGroup=77304735&product=77304856&q=driver#choice5"); break; case ReaderType::REINER_cyberJack_wave: manufacturerLabel->setText(QStringLiteral("Reiner SCT
cyberJack wave")); - manufacturerWebPage = QStringLiteral("https://www.reiner-sct.com/support/support-anfrage/?productGroup=77304735&product=77304828&q=driver#choice4"); + manufacturerWebPage = QStringLiteral("https://www.reiner-sct.com/support/support-anfrage/?os=Windows&productGroup=77304735&product=77304828&q=driver#choice5"); break; case ReaderType::SCM_SCL011_Contactless_Reader: manufacturerLabel->setText(QStringLiteral("Identive
Identive SCL011")); - manufacturerWebPage = QStringLiteral("https://support.identive-group.com/npa_downloads.php?lang=0"); + manufacturerWebPage = QStringLiteral("https://support.identiv.com/scl010-scl011/"); break; case ReaderType::SCM_SDI010: case ReaderType::SCM_SDI011: manufacturerLabel->setText(QStringLiteral("Identive
Identive SDI011")); - manufacturerWebPage = QStringLiteral("https://support.identive-group.com/npa_downloads.php?lang=0"); + manufacturerWebPage = QStringLiteral("https://support.identiv.com/sdi010-011/"); break; case ReaderType::KOBIL_IDToken: manufacturerLabel->setText(QStringLiteral("Kobil
Kobil ID Token")); - manufacturerWebPage = QStringLiteral("https://www.kobil.com/de/support/treiber.html"); + manufacturerWebPage = QStringLiteral("https://www.kobil.com/de/support_de/#drivers_de"); break; case ReaderType::ACS_ACR1281_PICC_Reader: manufacturerLabel->setText(QStringLiteral("ACS
ACR1281U")); - manufacturerWebPage = QStringLiteral("http://www.idvation.com/produkte/reader/npa-reader/"); + manufacturerWebPage = QStringLiteral("http://www.idvation.com/support/faq/4-contactless-readers/acr128/?tx_irfaq_pi1%5Bcat%5D=10"); break; case ReaderType::OMNIKEY_CardMan_5x21_CL: @@ -303,7 +303,7 @@ void SetupAssistantWizard::addReader(QTableWidget* pTableWidget, int pRow, Reade case ReaderType::FEIG_OBID_myAXXESS_basic: manufacturerLabel->setText(QStringLiteral("FEIG electronic GmbH
myAXXESS basic")); - manufacturerWebPage = QStringLiteral("http://www.feig.de/produkte/obid/produktbereiche/obid-myaxxess/npa/obid-myaxxess-basic-basisleser-fuer-npa.html"); + manufacturerWebPage = QStringLiteral("http://www.feig.de/downloads/"); break; case ReaderType::Gemalto_Prox_SU: diff --git a/src/gui/UpdateWindow.cpp b/src/gui/UpdateWindow.cpp index 10e787a..13ce852 100644 --- a/src/gui/UpdateWindow.cpp +++ b/src/gui/UpdateWindow.cpp @@ -4,8 +4,8 @@ #include "UpdateWindow.h" -#include "Updater.h" #include "ui_UpdateWindow.h" +#include "Updater.h" #include #include diff --git a/src/gui/generic/HelpAction.h b/src/gui/generic/HelpAction.h index d50e76a..cee6e41 100644 --- a/src/gui/generic/HelpAction.h +++ b/src/gui/generic/HelpAction.h @@ -21,7 +21,7 @@ namespace governikus class HelpAction { private: - friend class::test_HelpAction; + friend class ::test_HelpAction; static const QMap mHelpMapping; diff --git a/src/gui/step/SelfInfoWidget.cpp b/src/gui/step/SelfInfoWidget.cpp index 3148574..02736b2 100644 --- a/src/gui/step/SelfInfoWidget.cpp +++ b/src/gui/step/SelfInfoWidget.cpp @@ -6,11 +6,11 @@ #include "SelfInfoWidget.h" -#include "PdfCreator.h" -#include "SelfAuthenticationData.h" #include "generic/ListItem.h" #include "generic/ListItemSubTitle.h" #include "generic/ListItemTitle.h" +#include "PdfCreator.h" +#include "SelfAuthenticationData.h" #include "ui_SelfInfoWidget.h" #include diff --git a/src/gui/step/StepAdviseUserToRemoveCardGui.h b/src/gui/step/StepAdviseUserToRemoveCardGui.h index 49b1bca..7827e29 100644 --- a/src/gui/step/StepAdviseUserToRemoveCardGui.h +++ b/src/gui/step/StepAdviseUserToRemoveCardGui.h @@ -8,8 +8,8 @@ #pragma once -#include "StepGui.h" #include "context/AuthContext.h" +#include "StepGui.h" #include #include diff --git a/src/gui/step/StepAuthenticationDoneGui.h b/src/gui/step/StepAuthenticationDoneGui.h index 0627514..c858288 100644 --- a/src/gui/step/StepAuthenticationDoneGui.h +++ b/src/gui/step/StepAuthenticationDoneGui.h @@ -6,8 +6,8 @@ #pragma once -#include "StepGui.h" #include "context/AuthContext.h" +#include "StepGui.h" namespace governikus diff --git a/src/gui/step/StepAuthenticationEac1Gui.cpp b/src/gui/step/StepAuthenticationEac1Gui.cpp index 2377967..d57ed5a 100644 --- a/src/gui/step/StepAuthenticationEac1Gui.cpp +++ b/src/gui/step/StepAuthenticationEac1Gui.cpp @@ -2,10 +2,10 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "StepAuthenticationEac1Gui.h" #include "generic/GuiUtils.h" #include "step/AuthenticateStepsWidget.h" #include "step/StepAuthenticationEac1Widget.h" +#include "StepAuthenticationEac1Gui.h" #include diff --git a/src/gui/step/StepAuthenticationEac1Gui.h b/src/gui/step/StepAuthenticationEac1Gui.h index cedb3fb..79aa5e8 100644 --- a/src/gui/step/StepAuthenticationEac1Gui.h +++ b/src/gui/step/StepAuthenticationEac1Gui.h @@ -4,8 +4,8 @@ #pragma once -#include "StepGui.h" #include "context/AuthContext.h" +#include "StepGui.h" #include #include diff --git a/src/gui/step/StepAuthenticationEac1Widget.cpp b/src/gui/step/StepAuthenticationEac1Widget.cpp index bec01f7..f9f1335 100644 --- a/src/gui/step/StepAuthenticationEac1Widget.cpp +++ b/src/gui/step/StepAuthenticationEac1Widget.cpp @@ -10,9 +10,9 @@ #include "AppSettings.h" #include "CardConnection.h" #include "DetailDialog.h" -#include "RandomPinDialog.h" #include "generic/GuiUtils.h" #include "generic/PasswordEdit.h" +#include "RandomPinDialog.h" #include #include @@ -20,10 +20,10 @@ #include #include #include +#include #include #include #include -#include #ifdef Q_OS_WIN32 #include diff --git a/src/gui/step/StepAuthenticationEac1Widget.h b/src/gui/step/StepAuthenticationEac1Widget.h index a274ad5..1cf57bd 100644 --- a/src/gui/step/StepAuthenticationEac1Widget.h +++ b/src/gui/step/StepAuthenticationEac1Widget.h @@ -8,8 +8,8 @@ #pragma once -#include "StepGui.h" #include "context/AuthContext.h" +#include "StepGui.h" #include diff --git a/src/gui/step/StepChooseCardGui.cpp b/src/gui/step/StepChooseCardGui.cpp index e04b010..77c4978 100644 --- a/src/gui/step/StepChooseCardGui.cpp +++ b/src/gui/step/StepChooseCardGui.cpp @@ -4,9 +4,9 @@ #include "StepChooseCardGui.h" -#include "GuiProfile.h" #include "generic/BusyOverlayContainer.h" #include "generic/SmartCardUtil.h" +#include "GuiProfile.h" #include "step/AuthenticateStepsWidget.h" #include diff --git a/src/gui/step/StepChooseCardGui.h b/src/gui/step/StepChooseCardGui.h index 90870af..a3d0bb8 100644 --- a/src/gui/step/StepChooseCardGui.h +++ b/src/gui/step/StepChooseCardGui.h @@ -6,11 +6,11 @@ #pragma once +#include "context/AuthContext.h" #include "DiagnosisGui.h" #include "ReaderDriverGui.h" #include "ReaderManager.h" #include "StepGui.h" -#include "context/AuthContext.h" #include diff --git a/src/gui/step/StepErrorGui.h b/src/gui/step/StepErrorGui.h index 87b7784..74c521e 100644 --- a/src/gui/step/StepErrorGui.h +++ b/src/gui/step/StepErrorGui.h @@ -6,8 +6,8 @@ #pragma once -#include "StepGui.h" #include "context/WorkflowContext.h" +#include "StepGui.h" namespace governikus { diff --git a/src/gui/step/StepProcessingGui.cpp b/src/gui/step/StepProcessingGui.cpp index 4610cb4..fa26124 100644 --- a/src/gui/step/StepProcessingGui.cpp +++ b/src/gui/step/StepProcessingGui.cpp @@ -2,9 +2,9 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "StepProcessingGui.h" #include "generic/BusyOverlayContainer.h" #include "step/AuthenticateStepsWidget.h" +#include "StepProcessingGui.h" using namespace governikus; diff --git a/src/gui/step/StepShowSelfAuthenticationDataGui.h b/src/gui/step/StepShowSelfAuthenticationDataGui.h index 6dcbfe9..9961e08 100644 --- a/src/gui/step/StepShowSelfAuthenticationDataGui.h +++ b/src/gui/step/StepShowSelfAuthenticationDataGui.h @@ -4,8 +4,8 @@ #pragma once -#include "StepGui.h" #include "context/SelfAuthenticationContext.h" +#include "StepGui.h" #include diff --git a/src/gui/workflow/GenericWorkflowGui.h b/src/gui/workflow/GenericWorkflowGui.h index 90f32f6..8f79993 100644 --- a/src/gui/workflow/GenericWorkflowGui.h +++ b/src/gui/workflow/GenericWorkflowGui.h @@ -9,10 +9,10 @@ #pragma once #include "AppQtMainWidget.h" -#include "WorkflowGui.h" -#include "WorkflowQtWidget.h" #include "context/WorkflowContext.h" #include "step/StepGui.h" +#include "WorkflowGui.h" +#include "WorkflowQtWidget.h" #include #include diff --git a/src/gui/workflow/WorkflowAuthenticateQtGui.h b/src/gui/workflow/WorkflowAuthenticateQtGui.h index 79eed4e..664dc03 100644 --- a/src/gui/workflow/WorkflowAuthenticateQtGui.h +++ b/src/gui/workflow/WorkflowAuthenticateQtGui.h @@ -8,8 +8,8 @@ #pragma once -#include "GenericWorkflowGui.h" #include "context/AuthContext.h" +#include "GenericWorkflowGui.h" namespace governikus diff --git a/src/gui/workflow/WorkflowChangePinQtGui.cpp b/src/gui/workflow/WorkflowChangePinQtGui.cpp index 69c06de..0a07592 100644 --- a/src/gui/workflow/WorkflowChangePinQtGui.cpp +++ b/src/gui/workflow/WorkflowChangePinQtGui.cpp @@ -7,8 +7,8 @@ #include "WorkflowChangePinQtGui.h" #include "AppQtMainWidget.h" -#include "PinSettingsWidget.h" #include "generic/GuiUtils.h" +#include "PinSettingsWidget.h" #include "states/StateChangePin.h" #include "states/StateCleanUpReaderManager.h" #include "states/StateEstablishPaceCan.h" diff --git a/src/gui/workflow/WorkflowChangePinQtGui.h b/src/gui/workflow/WorkflowChangePinQtGui.h index 331a445..977cdb0 100644 --- a/src/gui/workflow/WorkflowChangePinQtGui.h +++ b/src/gui/workflow/WorkflowChangePinQtGui.h @@ -8,8 +8,8 @@ #pragma once -#include "GenericWorkflowGui.h" #include "context/ChangePinContext.h" +#include "GenericWorkflowGui.h" namespace governikus { diff --git a/src/gui/workflow/WorkflowGui.h b/src/gui/workflow/WorkflowGui.h index c438c5e..c8755ca 100644 --- a/src/gui/workflow/WorkflowGui.h +++ b/src/gui/workflow/WorkflowGui.h @@ -12,10 +12,10 @@ #include #include "AppQtMainWidget.h" -#include "WorkflowQtWidget.h" -#include "WorkflowWidgetParent.h" #include "context/WorkflowContext.h" #include "step/StepGui.h" +#include "WorkflowQtWidget.h" +#include "WorkflowWidgetParent.h" namespace governikus { diff --git a/src/gui/workflow/WorkflowQtWidget.cpp b/src/gui/workflow/WorkflowQtWidget.cpp index 4da2204..7914dad 100644 --- a/src/gui/workflow/WorkflowQtWidget.cpp +++ b/src/gui/workflow/WorkflowQtWidget.cpp @@ -6,9 +6,9 @@ #include "WorkflowQtWidget.h" +#include #include #include -#include using namespace governikus; diff --git a/src/gui/workflow/WorkflowSelfInfoQtGui.h b/src/gui/workflow/WorkflowSelfInfoQtGui.h index 76d74e9..c8637af 100644 --- a/src/gui/workflow/WorkflowSelfInfoQtGui.h +++ b/src/gui/workflow/WorkflowSelfInfoQtGui.h @@ -8,8 +8,8 @@ #pragma once -#include "GenericWorkflowGui.h" #include "context/SelfAuthenticationContext.h" +#include "GenericWorkflowGui.h" namespace governikus { diff --git a/src/jsonapi/MessageDispatcher.cpp b/src/jsonapi/MessageDispatcher.cpp index c9ce2e1..c94fb3b 100644 --- a/src/jsonapi/MessageDispatcher.cpp +++ b/src/jsonapi/MessageDispatcher.cpp @@ -174,6 +174,9 @@ MsgHandler MessageDispatcher::createForCommand(const QJsonObject& pObj) case MsgCmdType::SET_CAN: return HANDLE_CURRENT_STATE(MsgType::ENTER_CAN, MsgHandlerEnterCan(pObj, mContext)); + case MsgCmdType::SET_PUK: + return HANDLE_CURRENT_STATE(MsgType::ENTER_PUK, MsgHandlerEnterPuk(pObj, mContext)); + case MsgCmdType::GET_ACCESS_RIGHTS: return HANDLE_CURRENT_STATE(MsgType::ACCESS_RIGHTS, MsgHandlerAccessRights(mContext)); diff --git a/src/jsonapi/UIPlugInJsonApi.cpp b/src/jsonapi/UIPlugInJsonApi.cpp index 469c7b3..627c8bf 100644 --- a/src/jsonapi/UIPlugInJsonApi.cpp +++ b/src/jsonapi/UIPlugInJsonApi.cpp @@ -33,7 +33,7 @@ void UIPlugInJsonApi::callFireMessage(const QByteArray& pMsg) const { if (!pMsg.isEmpty()) { - qCDebug(jsonapi) << "Fire message:" << pMsg; + qCDebug(jsonapi).noquote() << "Fire message:" << pMsg; Q_EMIT fireMessage(pMsg); } } diff --git a/src/jsonapi/UIPlugInJsonApi.h b/src/jsonapi/UIPlugInJsonApi.h index 22922c0..83df47a 100644 --- a/src/jsonapi/UIPlugInJsonApi.h +++ b/src/jsonapi/UIPlugInJsonApi.h @@ -6,8 +6,8 @@ #pragma once -#include "MessageDispatcher.h" #include "context/AuthContext.h" +#include "MessageDispatcher.h" #include "view/UIPlugIn.h" namespace governikus diff --git a/src/jsonapi/messages/MsgContext.h b/src/jsonapi/messages/MsgContext.h index fbf2a0d..bfa832b 100644 --- a/src/jsonapi/messages/MsgContext.h +++ b/src/jsonapi/messages/MsgContext.h @@ -6,9 +6,9 @@ #pragma once -#include "MsgTypes.h" #include "context/AuthContext.h" #include "context/WorkflowContext.h" +#include "MsgTypes.h" namespace governikus { diff --git a/src/jsonapi/messages/MsgHandlerAccessRights.cpp b/src/jsonapi/messages/MsgHandlerAccessRights.cpp index 1d3f32a..50847f9 100644 --- a/src/jsonapi/messages/MsgHandlerAccessRights.cpp +++ b/src/jsonapi/messages/MsgHandlerAccessRights.cpp @@ -22,25 +22,25 @@ MsgHandlerAccessRights::MsgHandlerAccessRights(const QJsonObject& pObj, MsgConte auto ctx = pContext.getAuthContext(); Q_ASSERT(ctx); - const auto& jsonRaw = pObj["raw"]; + const auto& jsonRaw = pObj["chat"]; if (jsonRaw.isUndefined()) { - setError(QLatin1String("'raw' cannot be undefined")); + setError(QLatin1String("'chat' cannot be undefined")); } else if (!jsonRaw.isArray()) { - setError(QLatin1String("Invalid 'raw' data")); + setError(QLatin1String("Invalid 'chat' data")); } else { - handleSetRawData(jsonRaw.toArray(), ctx); + handleSetChatData(jsonRaw.toArray(), ctx); } fillAccessRights(ctx); } -void MsgHandlerAccessRights::handleSetRawData(const QJsonArray& pRaw, const QSharedPointer& pContext) +void MsgHandlerAccessRights::handleSetChatData(const QJsonArray& pChat, const QSharedPointer& pContext) { Q_ASSERT(pContext); @@ -48,23 +48,29 @@ void MsgHandlerAccessRights::handleSetRawData(const QJsonArray& pRaw, const QSha if (!pContext->getOptionalAccessRights().isEmpty()) { - for (const auto& entry : pRaw) + for (const auto& entry : pChat) { - if (entry.isDouble()) + if (entry.isString()) { - const auto value = static_cast(entry.toInt()); - if (pContext->getOptionalAccessRights().contains(value)) + const auto& func = [&](AccessRight pRight){ + if (pContext->getOptionalAccessRights().contains(pRight)) + { + effectiveChat += pRight; + } + else + { + setError(QLatin1String("Entry in 'chat' data is not available")); + } + }; + + if (!AccessRoleAndRightsUtil::fromTechnicalName(entry.toString().toLatin1().constData(), func)) { - effectiveChat += value; - } - else - { - setError(QLatin1String("Entry in 'raw' data is invalid")); + setError(QLatin1String("Entry in 'chat' data is invalid")); } } else { - setError(QLatin1String("Entry in 'raw' data needs to be integer")); + setError(QLatin1String("Entry in 'chat' data needs to be string")); } } } @@ -89,7 +95,11 @@ QJsonArray MsgHandlerAccessRights::getAccessRights(const QSet& pRig std::sort(accessRights.rbegin(), accessRights.rend()); for (auto entry : qAsConst(accessRights)) { - array += static_cast(entry); + const QLatin1String name = AccessRoleAndRightsUtil::toTechnicalName(entry); + if (name.size()) + { + array += name; + } } return array; @@ -100,12 +110,55 @@ void MsgHandlerAccessRights::fillAccessRights(const QSharedPointergetRequiredAccessRights()); - raw["optional"] = getAccessRights(pContext->getOptionalAccessRights()); - raw["effective"] = getAccessRights(pContext->getEffectiveAccessRights()); + QJsonObject chat; + chat["required"] = getAccessRights(pContext->getRequiredAccessRights()); + chat["optional"] = getAccessRights(pContext->getOptionalAccessRights()); + chat["effective"] = getAccessRights(pContext->getEffectiveAccessRights()); - mJsonObject["raw"] = raw; + mJsonObject["chat"] = chat; + const auto& transactionInfo = pContext->getDidAuthenticateEac1()->getTransactionInfo(); + if (!transactionInfo.isEmpty()) + { + mJsonObject["transactionInfo"] = transactionInfo; + } + + const QJsonObject& aux = getAuxiliaryData(pContext); + if (!aux.isEmpty()) + { + mJsonObject["aux"] = aux; + } +} + + +QJsonObject MsgHandlerAccessRights::getAuxiliaryData(const QSharedPointer& pContext) +{ + QJsonObject obj; + + const auto& eac1 = pContext->getDidAuthenticateEac1(); + if (eac1) + { + const auto& aux = eac1->getAuthenticatedAuxiliaryData(); + if (aux) + { + if (aux->hasAgeVerificationDate()) + { + obj["ageVerificationDate"] = aux->getAgeVerificationDate().toString(Qt::ISODate); + obj["requiredAge"] = aux->getRequiredAge(); + } + + if (aux->hasValidityDate()) + { + obj["validityDate"] = aux->getValidityDate().toString(Qt::ISODate); + } + + if (aux->hasCommunityID()) + { + obj["communityId"] = QString::fromUtf8(aux->getCommunityID()); + } + } + } + + return obj; } diff --git a/src/jsonapi/messages/MsgHandlerAccessRights.h b/src/jsonapi/messages/MsgHandlerAccessRights.h index ebd2fb2..2b68cbe 100644 --- a/src/jsonapi/messages/MsgHandlerAccessRights.h +++ b/src/jsonapi/messages/MsgHandlerAccessRights.h @@ -6,9 +6,11 @@ #pragma once +#include "context/AuthContext.h" #include "MsgContext.h" #include "MsgHandler.h" -#include "context/AuthContext.h" + +#include namespace governikus { @@ -19,9 +21,10 @@ class MsgHandlerAccessRights private: void setError(const QLatin1String& pError); - void handleSetRawData(const QJsonArray& pRaw, const QSharedPointer& pContext); + void handleSetChatData(const QJsonArray& pChat, const QSharedPointer& pContext); QJsonArray getAccessRights(const QSet& pRights) const; void fillAccessRights(const QSharedPointer& pContext); + QJsonObject getAuxiliaryData(const QSharedPointer& pContext); public: MsgHandlerAccessRights(const MsgContext& pContext); diff --git a/src/jsonapi/messages/MsgHandlerCertificate.cpp b/src/jsonapi/messages/MsgHandlerCertificate.cpp index 9b5d83b..e150c4f 100644 --- a/src/jsonapi/messages/MsgHandlerCertificate.cpp +++ b/src/jsonapi/messages/MsgHandlerCertificate.cpp @@ -24,6 +24,7 @@ MsgHandlerCertificate::MsgHandlerCertificate(const MsgContext& pContext) desc["issuerName"] = certificateDescription->getIssuerName(); desc["issuerUrl"] = certificateDescription->getIssuerUrl(); desc["termsOfUsage"] = certificateDescription->getTermsOfUsage(); + desc["purpose"] = certificateDescription->getPurpose(); CVCertificateBody body = eac1->getCvCertificates().at(0)->getBody(); QJsonObject validity; diff --git a/src/jsonapi/messages/MsgHandlerEnterNumber.h b/src/jsonapi/messages/MsgHandlerEnterNumber.h index 2f151f0..3f7f519 100644 --- a/src/jsonapi/messages/MsgHandlerEnterNumber.h +++ b/src/jsonapi/messages/MsgHandlerEnterNumber.h @@ -6,9 +6,9 @@ #pragma once +#include "context/WorkflowContext.h" #include "MsgContext.h" #include "MsgHandler.h" -#include "context/WorkflowContext.h" #include diff --git a/src/jsonapi/messages/MsgHandlerEnterPuk.cpp b/src/jsonapi/messages/MsgHandlerEnterPuk.cpp index fd0438f..ef63b6a 100644 --- a/src/jsonapi/messages/MsgHandlerEnterPuk.cpp +++ b/src/jsonapi/messages/MsgHandlerEnterPuk.cpp @@ -12,3 +12,16 @@ MsgHandlerEnterPuk::MsgHandlerEnterPuk(const MsgContext& pContext) : MsgHandlerEnterNumber(MsgType::ENTER_PUK, pContext) { } + + +MsgHandlerEnterPuk::MsgHandlerEnterPuk(const QJsonObject& pObj, MsgContext& pContext) + : MsgHandlerEnterPuk(pContext) +{ + parseValue(pObj, [&](const QString& pNumber) + { + auto ctx = pContext.getWorkflowContext(); + ctx->setPuk(pNumber); + ctx->setStateApproved(); + setVoid(); + }, 10); +} diff --git a/src/jsonapi/messages/MsgHandlerEnterPuk.h b/src/jsonapi/messages/MsgHandlerEnterPuk.h index 36eabb2..7c3b845 100644 --- a/src/jsonapi/messages/MsgHandlerEnterPuk.h +++ b/src/jsonapi/messages/MsgHandlerEnterPuk.h @@ -17,6 +17,7 @@ class MsgHandlerEnterPuk { public: MsgHandlerEnterPuk(const MsgContext& pContext); + MsgHandlerEnterPuk(const QJsonObject& pObj, MsgContext& pContext); }; diff --git a/src/jsonapi/messages/MsgHandlerReader.cpp b/src/jsonapi/messages/MsgHandlerReader.cpp index 0597a1d..d873e02 100644 --- a/src/jsonapi/messages/MsgHandlerReader.cpp +++ b/src/jsonapi/messages/MsgHandlerReader.cpp @@ -66,6 +66,7 @@ void MsgHandlerReader::setReaderInfo(QJsonObject& pObj, const ReaderInfo& pInfo, { QJsonObject card; card["deactivated"] = pInfo.isPinDeactivated(); + card["inoperative"] = pInfo.isPukInoperative(); card["retryCounter"] = pInfo.getRetryCounter(); pObj["card"] = card; } diff --git a/src/jsonapi/messages/MsgTypes.h b/src/jsonapi/messages/MsgTypes.h index d45a55a..4205cd3 100644 --- a/src/jsonapi/messages/MsgTypes.h +++ b/src/jsonapi/messages/MsgTypes.h @@ -43,6 +43,7 @@ defineEnumType(MsgCmdType, GET_ACCESS_RIGHTS, SET_ACCESS_RIGHTS, SET_PIN, - SET_CAN) + SET_CAN, + SET_PUK) } /* namespace governikus */ diff --git a/src/main.cpp b/src/main.cpp index 86b53d2..f0fc548 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,16 +1,16 @@ -#include "CommandLineParser.h" -#include "MetaTypeRegister.h" -#include "SignalHandler.h" #include "controller/AppController.h" #include "core/DeviceInfo.h" +#include "CommandLineParser.h" #include "global/BuildHelper.h" #include "global/LogHandler.h" +#include "MetaTypeRegister.h" +#include "SignalHandler.h" #include #include #include -#include #include +#include #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) || defined(Q_OS_WINRT) #include @@ -40,7 +40,7 @@ Q_IMPORT_PLUGIN(IntentActivationHandler) Q_IMPORT_PLUGIN(CustomSchemeActivationHandler) #endif -#if defined(Q_OS_ANDROID) || defined(Q_OS_LINUX) || defined(Q_OS_IOS) +#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) || (defined(Q_OS_LINUX) && !defined(QT_NO_DEBUG)) Q_IMPORT_PLUGIN(BluetoothReaderManagerPlugIn) #endif diff --git a/src/network/DatagramHandlerImpl.h b/src/network/DatagramHandlerImpl.h index 6c2dd8f..8e53460 100644 --- a/src/network/DatagramHandlerImpl.h +++ b/src/network/DatagramHandlerImpl.h @@ -23,7 +23,7 @@ class DatagramHandlerImpl Q_OBJECT private: - friend class::test_DatagramHandlerImpl; + friend class ::test_DatagramHandlerImpl; friend struct QtSharedPointer::CustomDeleter; static quint16 cPort; diff --git a/src/network/HttpRequest.h b/src/network/HttpRequest.h index 3965c69..b581530 100644 --- a/src/network/HttpRequest.h +++ b/src/network/HttpRequest.h @@ -6,8 +6,8 @@ #pragma once -#include "HttpResponse.h" #include "http_parser/http_parser.h" +#include "HttpResponse.h" #include #include @@ -27,7 +27,7 @@ class HttpRequest Q_OBJECT private: - friend class::test_WebserviceActivationHandler; + friend class ::test_WebserviceActivationHandler; static int onMessageBegin(http_parser* pParser); static int onMessageComplete(http_parser* pParser); diff --git a/src/qml/ApplicationModel.cpp b/src/qml/ApplicationModel.cpp index e388aea..4b6d10e 100644 --- a/src/qml/ApplicationModel.cpp +++ b/src/qml/ApplicationModel.cpp @@ -4,12 +4,12 @@ #include "ApplicationModel.h" -#include "ReaderInfo.h" -#include "ReaderManager.h" -#include "SingletonHelper.h" #include "context/AuthContext.h" #include "context/ChangePinContext.h" #include "context/SelfAuthenticationContext.h" +#include "ReaderInfo.h" +#include "ReaderManager.h" +#include "SingletonHelper.h" #if defined(Q_OS_LINUX) || defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #include @@ -132,7 +132,11 @@ void ApplicationModel::setBluetoothEnabled(bool pEnabled) { QBluetoothLocalDevice localDevice; localDevice.powerOn(); - qDebug() << "Bluetooth" << (pEnabled ? "Enabled" : "Disabled"); + qDebug() << "Bluetooth enabled"; + } + else + { + qWarning() << "Cannot disable Bluetooth: not supported"; } #else qWarning() << (pEnabled ? "Enabling" : "Disabling") << "Bluetooth not supported on this platform"; diff --git a/src/qml/AuthModel.cpp b/src/qml/AuthModel.cpp index cbdd9a8..c79452c 100644 --- a/src/qml/AuthModel.cpp +++ b/src/qml/AuthModel.cpp @@ -4,8 +4,8 @@ #include "AuthModel.h" -#include "ReaderManagerPlugInInfo.h" #include "context/AuthContext.h" +#include "ReaderManagerPlugInInfo.h" using namespace governikus; diff --git a/src/qml/CertificateDescriptionModel.cpp b/src/qml/CertificateDescriptionModel.cpp index f5ec66e..2e22c60 100644 --- a/src/qml/CertificateDescriptionModel.cpp +++ b/src/qml/CertificateDescriptionModel.cpp @@ -2,11 +2,11 @@ * \copyright Copyright (c) 2016 Governikus GmbH & Co. KG */ -#include "AppSettings.h" -#include "CertificateDescriptionModel.h" #include "asn1/CertificateDescription.h" +#include "AppSettings.h" #include "context/AuthContext.h" #include "context/SelfAuthenticationContext.h" +#include "CertificateDescriptionModel.h" using namespace governikus; diff --git a/src/qml/ChangePinModel.cpp b/src/qml/ChangePinModel.cpp index 60d12e5..61a53c9 100644 --- a/src/qml/ChangePinModel.cpp +++ b/src/qml/ChangePinModel.cpp @@ -4,8 +4,8 @@ #include "ChangePinModel.h" -#include "ReaderManager.h" #include "context/ChangePinContext.h" +#include "ReaderManager.h" #include diff --git a/src/qml/ChatModel.cpp b/src/qml/ChatModel.cpp index 17c18e4..4a755a3 100644 --- a/src/qml/ChatModel.cpp +++ b/src/qml/ChatModel.cpp @@ -4,11 +4,11 @@ * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ -#include "AppSettings.h" -#include "ChatModel.h" #include "asn1/AccessRoleAndRight.h" #include "asn1/CVCertificate.h" +#include "AppSettings.h" #include "context/SelfAuthenticationContext.h" +#include "ChatModel.h" using namespace governikus; diff --git a/src/qml/NumberModel.cpp b/src/qml/NumberModel.cpp index 8ec1402..9955ed1 100644 --- a/src/qml/NumberModel.cpp +++ b/src/qml/NumberModel.cpp @@ -4,9 +4,9 @@ #include "NumberModel.h" -#include "ReaderManager.h" #include "context/ChangePinContext.h" #include "context/WorkflowContext.h" +#include "ReaderManager.h" using namespace governikus; diff --git a/src/qml/ProviderModel.h b/src/qml/ProviderModel.h index 566ccca..f99f84a 100644 --- a/src/qml/ProviderModel.h +++ b/src/qml/ProviderModel.h @@ -21,7 +21,7 @@ namespace governikus class ProviderModel : public QAbstractListModel { - friend class::test_ProviderModel; + friend class ::test_ProviderModel; Q_OBJECT diff --git a/src/qml/SelfAuthenticationModel.cpp b/src/qml/SelfAuthenticationModel.cpp index eceb8d6..2211c5b 100644 --- a/src/qml/SelfAuthenticationModel.cpp +++ b/src/qml/SelfAuthenticationModel.cpp @@ -2,8 +2,8 @@ * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ -#include "SelfAuthenticationModel.h" #include "context/SelfAuthenticationContext.h" +#include "SelfAuthenticationModel.h" using namespace governikus; diff --git a/src/qml/ShareUtil.java b/src/qml/ShareUtil.java index 3e426d3..1380bf0 100644 --- a/src/qml/ShareUtil.java +++ b/src/qml/ShareUtil.java @@ -1,8 +1,8 @@ package com.governikus.ausweisapp2; -import android.Manifest; import android.app.Activity; import android.content.*; +import android.Manifest; import android.net.Uri; import android.os.Environment; import android.util.Log; diff --git a/src/qml/UIPlugInQml.cpp b/src/qml/UIPlugInQml.cpp index 25fdf54..98b5af3 100644 --- a/src/qml/UIPlugInQml.cpp +++ b/src/qml/UIPlugInQml.cpp @@ -3,13 +3,13 @@ */ #include "AppSettings.h" +#include "context/AuthContext.h" +#include "context/ChangePinContext.h" +#include "context/SelfAuthenticationContext.h" #include "DpiCalculator.h" #include "FileDestination.h" #include "UIPlugInQml.h" #include "Updater.h" -#include "context/AuthContext.h" -#include "context/ChangePinContext.h" -#include "context/SelfAuthenticationContext.h" #ifdef Q_OS_ANDROID #include diff --git a/src/services/DriverParser.cpp b/src/services/DriverParser.cpp index 1cafc98..a28dfdb 100644 --- a/src/services/DriverParser.cpp +++ b/src/services/DriverParser.cpp @@ -77,7 +77,8 @@ EntryParser::EntryParser(const QJsonValue& pJsonValue) , mMacVersion({ {"MV_10_9", QSysInfo::MV_10_9}, {"MV_10_10", QSysInfo::MV_10_10}, - {"MV_10_11", QSysInfo::MV_10_11} + {"MV_10_11", QSysInfo::MV_10_11}, + {"MV_10_12", QSysInfo::MV_10_12} } ) { diff --git a/src/services/ProviderParser.cpp b/src/services/ProviderParser.cpp index d7ac400..da06584 100644 --- a/src/services/ProviderParser.cpp +++ b/src/services/ProviderParser.cpp @@ -5,7 +5,6 @@ #include "LanguageString.h" #include "ProviderParser.h" -#include #include #include @@ -17,6 +16,36 @@ Q_DECLARE_LOGGING_CATEGORY(update) using namespace governikus; +namespace +{ + +inline QLatin1String getCurrentOS() +{ +#if defined(Q_OS_WIN) + return QLatin1String("win"); + +#elif defined(Q_OS_MACOS) + return QLatin1String("mac"); + +#elif defined(Q_OS_IOS) + return QLatin1String("ios"); + +#elif defined(Q_OS_ANDROID) + return QLatin1String("android"); + +#elif defined(Q_OS_LINUX) + return QLatin1String("linux"); + +#elif defined(Q_OS_BSD4) + return QLatin1String("bsd"); + +#else +#error OS not implemented +#endif +} + + +} ProviderParser::ProviderParser() : SettingsParser() @@ -30,6 +59,12 @@ ProviderParser::~ProviderParser() QSharedPointer ProviderParser::parse(const QByteArray& pData) +{ + return parse(pData, getCurrentOS()); +} + + +QSharedPointer ProviderParser::parse(const QByteArray& pData, QLatin1String pCurrentOS) { QJsonParseError jsonError; const auto& json = QJsonDocument::fromJson(pData, &jsonError); @@ -57,14 +92,21 @@ QSharedPointer ProviderParser::parse(const QByteArray& pData) } providerSettings->setCallCosts(callCosts); - QJsonArray array = doc["provider"].toArray(); - QVector providers(array.size()); - for (int i = 0; i < array.size(); ++i) + const QJsonArray& array = doc["provider"].toArray(); + QVector providers; + providers.reserve(array.size()); + for (const auto& entry : array) { - const QJsonObject prov = array[i].toObject(); + const QJsonObject prov = entry.toObject(); + + if (isExcludedPlatform(prov["exclude"].toArray(), pCurrentOS)) + { + continue; + } + const QString postalAddressCamel = prov["postalAddress"].toString(); const QString postalAddressLower = prov["postaladdress"].toString(); - providers[i] = Provider( + providers << Provider( LanguageString(prov["shortName"]), LanguageString(prov["longName"]), LanguageString(prov["shortDescription"]), @@ -85,3 +127,21 @@ QSharedPointer ProviderParser::parse(const QByteArray& pData) return providerSettings; } + + +bool ProviderParser::isExcludedPlatform(const QJsonArray& pExcludedArray, QLatin1String pCurrentOS) +{ + const QLatin1String osType = pCurrentOS == QLatin1String("ios") || pCurrentOS == QLatin1String("android") + ? QLatin1String("mobile") + : QLatin1String("desktop"); + + for (const auto& entry : pExcludedArray) + { + const QString& value = entry.toString().toLower(); + if (value == pCurrentOS || value == osType) + { + return true; + } + } + return false; +} diff --git a/src/services/ProviderParser.h b/src/services/ProviderParser.h index 287b205..4860440 100644 --- a/src/services/ProviderParser.h +++ b/src/services/ProviderParser.h @@ -1,26 +1,32 @@ /*! - * ProviderParser.h - * * \brief Parser for provider configuration files * - * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG + * \copyright Copyright (c) 2014-2017 Governikus GmbH & Co. KG, Germany */ #pragma once - #include "ProviderSettings.h" #include "SettingsParser.h" +#include +#include + +class test_ProviderParser; + namespace governikus { class ProviderParser : public SettingsParser { + private: + friend class ::test_ProviderParser; + static bool isExcludedPlatform(const QJsonArray& pExcludedArray, QLatin1String pCurrentOS); + QSharedPointer parse(const QByteArray& pData, QLatin1String pCurrentOS); + public: ProviderParser(); - - ~ProviderParser(); + virtual ~ProviderParser(); /*! * Parses the configuration data and returns ProviderSettings. diff --git a/src/settings/AppSettings.h b/src/settings/AppSettings.h index 1bd5cbb..23f4b05 100644 --- a/src/settings/AppSettings.h +++ b/src/settings/AppSettings.h @@ -31,7 +31,7 @@ class AppSettings : public AbstractSettings { Q_OBJECT - friend class::test_AppSettings; + friend class ::test_AppSettings; friend bool operator==(const AppSettings& pLeft, const AppSettings& pRight); private: diff --git a/src/settings/GeneralSettings.h b/src/settings/GeneralSettings.h index 9a4af08..800f07f 100644 --- a/src/settings/GeneralSettings.h +++ b/src/settings/GeneralSettings.h @@ -36,7 +36,7 @@ class GeneralSettings Q_OBJECT friend class AppSettings; - friend class::test_GeneralSettings; + friend class ::test_GeneralSettings; friend bool operator==(const GeneralSettings& pLeft, const GeneralSettings& pRight); private: diff --git a/src/settings/HistorySettings.h b/src/settings/HistorySettings.h index 27f7ee3..c3d5d62 100644 --- a/src/settings/HistorySettings.h +++ b/src/settings/HistorySettings.h @@ -92,7 +92,7 @@ class HistorySettings { Q_OBJECT friend class AppSettings; - friend class::test_HistorySettings; + friend class ::test_HistorySettings; private: bool mEnabled; diff --git a/src/settings/PreVerificationSettings.h b/src/settings/PreVerificationSettings.h index 1477d61..4ca94f3 100644 --- a/src/settings/PreVerificationSettings.h +++ b/src/settings/PreVerificationSettings.h @@ -22,8 +22,8 @@ class PreVerificationSettings Q_OBJECT friend class AppSettings; - friend class::test_PreVerificationSettings; - friend class::test_StatePreVerification; + friend class ::test_PreVerificationSettings; + friend class ::test_StatePreVerification; private: QByteArrayList mLinkCertificates; diff --git a/src/settings/ProviderSettings.h b/src/settings/ProviderSettings.h index 9ab1a3f..c108c9e 100644 --- a/src/settings/ProviderSettings.h +++ b/src/settings/ProviderSettings.h @@ -118,8 +118,8 @@ class ProviderSettings friend class AppSettings; friend class ProviderParser; - friend class::test_ProviderSettings; - friend class::test_ProviderParser; + friend class ::test_ProviderSettings; + friend class ::test_ProviderParser; friend bool operator==(const ProviderSettings& pLeft, const ProviderSettings& pRight); private: diff --git a/src/settings/RemoteReaderSettings.h b/src/settings/RemoteReaderSettings.h index 08a51ba..7a913fe 100644 --- a/src/settings/RemoteReaderSettings.h +++ b/src/settings/RemoteReaderSettings.h @@ -21,7 +21,7 @@ class RemoteReaderSettings Q_OBJECT friend class AppSettings; - friend class::test_RemoteReaderSettings; + friend class ::test_RemoteReaderSettings; private: QString mServerName; diff --git a/src/settings/SecureStorage.h b/src/settings/SecureStorage.h index 9a77cd8..05cc78b 100644 --- a/src/settings/SecureStorage.h +++ b/src/settings/SecureStorage.h @@ -34,7 +34,7 @@ using SignatureAlgorithmPair = QPair #include #include -#include #include +#include #define CLI_VERIFY(cmd) cmd; QVERIFY(!QTest::currentTestFailed()) diff --git a/test/helper/MockReader.h b/test/helper/MockReader.h index 0a52c2c..d659f00 100644 --- a/test/helper/MockReader.h +++ b/test/helper/MockReader.h @@ -9,9 +9,9 @@ #pragma once +#include "asn1/SecurityInfos.h" #include "MockCard.h" #include "Reader.h" -#include "asn1/SecurityInfos.h" namespace governikus diff --git a/test/helper/TestAuthContext.cpp b/test/helper/TestAuthContext.cpp index 1ddba75..06666cb 100644 --- a/test/helper/TestAuthContext.cpp +++ b/test/helper/TestAuthContext.cpp @@ -2,9 +2,9 @@ * \copyright Copyright (c) 2016 Governikus GmbH & Co. KG */ +#include "paos/retrieve/DidAuthenticateEac1Parser.h" #include "TestAuthContext.h" #include "TestFileHelper.h" -#include "paos/retrieve/DidAuthenticateEac1Parser.h" using namespace governikus; diff --git a/test/helper/WebSocketHelper.h b/test/helper/WebSocketHelper.h index 3f4a7fa..e104e35 100644 --- a/test/helper/WebSocketHelper.h +++ b/test/helper/WebSocketHelper.h @@ -4,9 +4,9 @@ #pragma once +#include #include #include -#include namespace governikus { diff --git a/test/qt/aidl/test_PskManager.cpp b/test/qt/aidl/test_PskManager.cpp index d3de053..82c361d 100644 --- a/test/qt/aidl/test_PskManager.cpp +++ b/test/qt/aidl/test_PskManager.cpp @@ -38,20 +38,6 @@ class test_PskManager } - void generatePskWithClientPartial() - { - QByteArray prev("0xABCDEF"); - for (int i = 0; i < 100; ++i) - { - const auto& tmp = PskManager::getInstance().generatePsk(prev); - QVERIFY(prev != tmp); - QCOMPARE(tmp, PskManager::getInstance().getPsk()); - QVERIFY(PskManager::getInstance().isSecureRandomPsk()); - prev = tmp; - } - } - - }; QTEST_GUILESS_MAIN(test_PskManager) diff --git a/test/qt/card/asn1/test_AccessRoleAndRight.cpp b/test/qt/card/asn1/test_AccessRoleAndRight.cpp new file mode 100644 index 0000000..7d34ede --- /dev/null +++ b/test/qt/card/asn1/test_AccessRoleAndRight.cpp @@ -0,0 +1,134 @@ +/*! + * \brief Unit tests for \ref AccessRoleAndRight + * + * \copyright Copyright (c) 2017 Governikus GmbH & Co. KG + */ + +#include "asn1/AccessRoleAndRight.h" + +#include + +using namespace governikus; + +class test_AccessRoleAndRight + : public QObject +{ + Q_OBJECT + + void fillTestData() + { + QTest::addColumn("value"); + + QTest::newRow("ResidencePermitII") << AccessRight::READ_DG20; + QTest::newRow("ResidencePermitI") << AccessRight::READ_DG19; + QTest::newRow("CommunityID") << AccessRight::READ_DG18; + QTest::newRow("Address") << AccessRight::READ_DG17; + QTest::newRow("BirthName") << AccessRight::READ_DG13; + QTest::newRow("Nationality") << AccessRight::READ_DG10; + QTest::newRow("PlaceOfBirth") << AccessRight::READ_DG09; + QTest::newRow("DateOfBirth") << AccessRight::READ_DG08; + QTest::newRow("DoctoralDegree") << AccessRight::READ_DG07; + QTest::newRow("ArtisticName") << AccessRight::READ_DG06; + QTest::newRow("FamilyName") << AccessRight::READ_DG05; + QTest::newRow("GivenNames") << AccessRight::READ_DG04; + QTest::newRow("ValidUntil") << AccessRight::READ_DG03; + QTest::newRow("IssuingCountry") << AccessRight::READ_DG02; + QTest::newRow("DocumentType") << AccessRight::READ_DG01; + QTest::newRow("Pseudonym") << AccessRight::RESTRICTED_IDENTIFICATION; + QTest::newRow("AddressVerification") << AccessRight::COMMUNITY_ID_VERIFICATION; + QTest::newRow("AgeVerification") << AccessRight::AGE_VERIFICATION; + } + + + private Q_SLOTS: + void checkAccessRightNames_data() + { + fillTestData(); + QTest::newRow("") << AccessRight::WRITE_DG17; + QTest::newRow("") << AccessRight::RFU_32; + QTest::newRow("") << AccessRight::CAN_ALLOWED; + QTest::newRow("") << AccessRight::PRIVILEGED_TERMINAL; + } + + + void checkAccessRightNames() + { + QFETCH(AccessRight, value); + QCOMPARE(AccessRoleAndRightsUtil::toTechnicalName(value), QLatin1String(QTest::currentDataTag())); + } + + + void checkFromTechnicalName_data() + { + fillTestData(); + } + + + void checkFromTechnicalName() + { + QFETCH(AccessRight, value); + const AccessRight undefined = static_cast(UINT_MAX); + AccessRight right = undefined; + const auto& func = [&](AccessRight pRight){ + right = pRight; + }; + + bool success = AccessRoleAndRightsUtil::fromTechnicalName(QTest::currentDataTag(), func); + if (right != value) + { + QVERIFY(!success); + } + QCOMPARE(right, value); + QVERIFY(success); + + QVERIFY(right != undefined); + } + + + void checkFromTechnicalNameInvalid() + { + const AccessRight undefined = static_cast(UINT_MAX); + AccessRight right = undefined; + const auto& func = [&](AccessRight pRight){ + right = pRight; + }; + + QVERIFY(!AccessRoleAndRightsUtil::fromTechnicalName("crap", func)); + QCOMPARE(right, undefined); + + QVERIFY(!AccessRoleAndRightsUtil::fromTechnicalName("CAN_ALLOWED", func)); + QCOMPARE(right, undefined); + + QVERIFY(!AccessRoleAndRightsUtil::fromTechnicalName("CanAllowed", func)); + QCOMPARE(right, undefined); + + QVERIFY(!AccessRoleAndRightsUtil::fromTechnicalName("familyname", func)); + QCOMPARE(right, undefined); + } + + + /** + * We use UINT_MAX as "undefined" state in AccessRoleAndRightsUtil::fromTechnicalName. + * Ensure that we never use UINT_MAX as a valid value! + */ + void checkUndefinedUsage() + { + const auto& names = Enum::getList(); + for (AccessRightNames entry : names) + { + QVERIFY(entry != static_cast(UINT_MAX)); + } + + const auto& rights = Enum::getList(); + for (AccessRight entry : rights) + { + QVERIFY(entry != static_cast(UINT_MAX)); + } + } + + +}; + + +QTEST_GUILESS_MAIN(test_AccessRoleAndRight) +#include "test_AccessRoleAndRight.moc" diff --git a/test/qt/card/asn1/test_CVCertificate.cpp b/test/qt/card/asn1/test_CVCertificate.cpp index a10a440..62860aa 100644 --- a/test/qt/card/asn1/test_CVCertificate.cpp +++ b/test/qt/card/asn1/test_CVCertificate.cpp @@ -7,10 +7,10 @@ #include "asn1/CVCertificate.h" -#include "LogHandler.h" -#include "TestFileHelper.h" #include "asn1/ASN1Util.h" #include "asn1/KnownOIDs.h" +#include "LogHandler.h" +#include "TestFileHelper.h" #include diff --git a/test/qt/card/asn1/test_CVCertificateBody.cpp b/test/qt/card/asn1/test_CVCertificateBody.cpp index f481a07..bb5df92 100644 --- a/test/qt/card/asn1/test_CVCertificateBody.cpp +++ b/test/qt/card/asn1/test_CVCertificateBody.cpp @@ -7,10 +7,10 @@ #include #include -#include "TestFileHelper.h" #include "asn1/ASN1Util.h" #include "asn1/CVCertificate.h" #include "asn1/KnownOIDs.h" +#include "TestFileHelper.h" using namespace governikus; diff --git a/test/qt/card/asn1/test_CVCertificateChainBuilder.cpp b/test/qt/card/asn1/test_CVCertificateChainBuilder.cpp index 86a50a7..a0de1ab 100644 --- a/test/qt/card/asn1/test_CVCertificateChainBuilder.cpp +++ b/test/qt/card/asn1/test_CVCertificateChainBuilder.cpp @@ -7,8 +7,8 @@ #include #include -#include "TestFileHelper.h" #include "asn1/CVCertificateChainBuilder.h" +#include "TestFileHelper.h" using namespace governikus; diff --git a/test/qt/card/asn1/test_CertificateDescription.cpp b/test/qt/card/asn1/test_CertificateDescription.cpp index a4d490d..f7be159 100644 --- a/test/qt/card/asn1/test_CertificateDescription.cpp +++ b/test/qt/card/asn1/test_CertificateDescription.cpp @@ -34,6 +34,7 @@ const QByteArray HEX_STRING("30 8202E0" " 04 20 9D8EB0BDF36B19C4AF3147E57401FD792845F0413102A7BD784DF9418098BEBE" ""); +const QByteArray SELF_AUTH_CERT_2017("308202e6060a04007f00070301030101a10e0c0c442d547275737420476d6248a2181316687474703a2f2f7777772e642d74727573742e6e6574a31a0c18476f7665726e696b757320476d6248202620436f2e204b47a41a131868747470733a2f2f7777772e617574656e746170702e6465a582020a0c820206efbbbf4e616d652c20416e7363687269667420756e6420452d4d61696c2d4164726573736520646573204469656e737465616e626965746572733a0d0a476f7665726e696b757320476d6248202620436f2e204b470d0a416d2046616c6c7475726d20390d0a3238333539204272656d656e0d0a6b6f6e74616b7440676f7665726e696b75732e636f6d0d0a0d0a4765736368c3a46674737a7765636b3a200d0a53656c6273746175736b756e66740d0a0d0a48696e7765697320617566206469652066c3bc722064656e204469656e737465616e626965746572207a757374c3a46e646967656e205374656c6c656e2c20646965206469652045696e68616c74756e672064657220566f7273636872696674656e207a756d20446174656e73636875747a206b6f6e74726f6c6c696572656e3a0d0a446965204c616e64657362656175667472616774652066c3bc7220446174656e73636875747a20756e6420496e666f726d6174696f6e736672656968656974206465722046726569656e2048616e73657374616474204272656d656e0d0a41726e647473747261c39f6520310d0a3237353730204272656d6572686176656e0d0a303432312f3539362d323031300d0a6f666669636540646174656e73636875747a2e6272656d656e2e64650d0a687474703a2f2f7777772e646174656e73636875747a2e6272656d656e2e64650d0aa76831660420a30a9a4617dc153926f731064043bba624b0cdd3b458ed8723c1cda33f1ffdd70420ab9fce5da4ba24d0b2664450fcced618f68fe9cbcdc4ee6e0bb0c59bd2aa86b60420fbf9f26b56b74cdf1c6e5cb1811bec1a8283a174c629b1974de17dc058b31bda"); } @@ -195,6 +196,7 @@ class test_CertificateDescription void termsOfUsagePlain() { + // "\r\n" isn't normalized to "\n" because getTermsOfUsage() returns the raw data QString termosOfUsage = QStringLiteral("Name, Anschrift und E-Mail-Adresse des Diensteanbieters:\r\n" "Governikus GmbH & Co.KG\r\n" "Am Fallturm 9\r\n" @@ -222,37 +224,63 @@ class test_CertificateDescription void providerAddressFromTermsOfUsage() { - const QString providerAddress("Governikus GmbH & Co.KG\r\n" - "Am Fallturm 9\r\n" - "28359 Bremen\r\n" + const QString providerAddress("Governikus GmbH & Co.KG\n" + "Am Fallturm 9\n" + "28359 Bremen\n" "kontakt@governikus.com"); auto certDescr = CertificateDescription::fromHex(HEX_STRING); - QVERIFY(certDescr != nullptr); + QVERIFY(certDescr); QCOMPARE(certDescr->getServiceProviderAddress(), providerAddress); + + const QString providerAddress2017("Governikus GmbH & Co. KG\n" + "Am Fallturm 9\n" + "28359 Bremen\n" + "kontakt@governikus.com"); + certDescr = CertificateDescription::fromHex(SELF_AUTH_CERT_2017); + QVERIFY(certDescr); + QCOMPARE(certDescr->getServiceProviderAddress(), providerAddress2017); + } void purposeFromTermsOfUsage() { + const QString expectedPurpose("Selbstauskunft"); + auto certDescr = CertificateDescription::fromHex(HEX_STRING); - QVERIFY(certDescr != nullptr); - QCOMPARE(certDescr->getPurpose(), QStringLiteral("Selbstauskunft")); + QVERIFY(certDescr); + QCOMPARE(certDescr->getPurpose(), expectedPurpose); + + certDescr = CertificateDescription::fromHex(SELF_AUTH_CERT_2017); + QVERIFY(certDescr); + QCOMPARE(certDescr->getPurpose(), expectedPurpose); } void dataSecurityOfficerFromTermsOfUsage() { - const QString dataSecurityOfficer = QStringLiteral("Der Landesbeauftragte f\u00FCr Datenschutz und Informationsfreiheit der Freien Hansestadt Bremen\r\n" - "Arndtstra\u00DFe 1\r\n" - "27570 Bremerhaven\r\n" - "0421/361-2010\r\n" - "office@datenschutz.bremen.de\r\n" + const QString dataSecurityOfficer = QStringLiteral("Der Landesbeauftragte f\u00FCr Datenschutz und Informationsfreiheit der Freien Hansestadt Bremen\n" + "Arndtstra\u00DFe 1\n" + "27570 Bremerhaven\n" + "0421/361-2010\n" + "office@datenschutz.bremen.de\n" "http://www.datenschutz.bremen.de"); auto certDescr = CertificateDescription::fromHex(HEX_STRING); - QVERIFY(certDescr != nullptr); + QVERIFY(certDescr); QCOMPARE(certDescr->getDataSecurityOfficer(), dataSecurityOfficer); + + const QString dataSecurityOfficer2017 = QStringLiteral("Die Landesbeauftragte f\u00FCr Datenschutz und Informationsfreiheit der Freien Hansestadt Bremen\n" + "Arndtstra\u00DFe 1\n" + "27570 Bremerhaven\n" + "0421/596-2010\n" + "office@datenschutz.bremen.de\n" + "http://www.datenschutz.bremen.de"); + + certDescr = CertificateDescription::fromHex(SELF_AUTH_CERT_2017); + QVERIFY(certDescr); + QCOMPARE(certDescr->getDataSecurityOfficer(), dataSecurityOfficer2017); } @@ -310,25 +338,24 @@ class test_CertificateDescription } - QString hexString("30 82038D" - " 06 0A 04007F00070301030103" - " A1 0E 0C0C442D547275737420476D6248" - " A2 18 1316687474703A2F2F7777772E642D74727573742E6E6574" - " A3 3A 0C38476573616D7476657262616E64206465722064657574736368656E20566572736963686572756E67737769727473636861667420652E562E" - " A4 1F 131D68747470733A2F2F7777772E6764762D74657374706F7274616C2E6465" - " A5 820248" - " 04 820244 4E616D652C20416E7363687269667420756E6420452D4D61696C2D4164726573736520646573204469656E737465616E626965746572733A0D0A476573616D7476657262616E64206465722064657574736368656E20566572736963686572756E67737769727473636861667420652E562E0D0A57696C68656C6D73747261C39F652034332F3433670D0A3130313137204265726C696E0D0A6265726C696E406764762E64650D0A0D0A4765736368C3A46674737A7765636B3A0D0A2D52656769737472696572756E6720756E64204C6F67696E20616D204744562D4D616B6C6572706F7274616C2D0D0A0D0A48696E7765697320617566206469652066C3BC722064656E204469656E737465616E626965746572207A757374C3A46E646967656E205374656C6C656E2C20646965206469652045696E68616C74756E672064657220566F7273636872696674656E207A756D20446174656E73636875747A206B6F6E74726F6C6C696572656E3A0D0A4265726C696E6572204265617566747261677465722066C3BC7220446174656E73636875747A20756E6420496E666F726D6174696F6E7366726569686569740D0A416E20646572205572616E696120342D31300D0A3130373837204265726C696E0D0A3033302F3133382038392D300D0A6D61696C626F7840646174656E73636875747A2D6265726C696E2E64650D0A687474703A2F2F7777772E646174656E73636875747A2D6265726C696E2E64650D0A416E737072656368706172746E65723A2044722E20416C6578616E64657220446978" - " A6 1E 131C68747470733a2f2f7777772e72656469726563742d746573742e6465" - " A7 818B" - " 31 8188" - " 04 20 0617A64C37179860FEA3044A14052505FB4F8EF4D61F047B6A30130CD06718E6" - " 04 20 718FA21C2DF3A81BEF1B7A53360481C78C017F1EC7170266C2C4E9BB654B0E3B" - " 04 20 94B0AA7E8114F3E6DFCD52DA9F43E8B13CCB0589B8957E364728198FB4971AE6" - " 04 20 E85E1E8A78864E9246C86CF1C2A3810603EEEE75746C70CD51ACB86B5E2655D8" - ""); - - QCOMPARE(certDescr->encode().toHex().toUpper(), QByteArray::fromHex(hexString.toLatin1()).toHex().toUpper()); + QByteArray hexString("30 82038D" + " 06 0A 04007F00070301030103" + " A1 0E 0C0C442D547275737420476D6248" + " A2 18 1316687474703A2F2F7777772E642D74727573742E6E6574" + " A3 3A 0C38476573616D7476657262616E64206465722064657574736368656E20566572736963686572756E67737769727473636861667420652E562E" + " A4 1F 131D68747470733A2F2F7777772E6764762D74657374706F7274616C2E6465" + " A5 820248" + " 04 820244 4E616D652C20416E7363687269667420756E6420452D4D61696C2D4164726573736520646573204469656E737465616E626965746572733A0D0A476573616D7476657262616E64206465722064657574736368656E20566572736963686572756E67737769727473636861667420652E562E0D0A57696C68656C6D73747261C39F652034332F3433670D0A3130313137204265726C696E0D0A6265726C696E406764762E64650D0A0D0A4765736368C3A46674737A7765636B3A0D0A2D52656769737472696572756E6720756E64204C6F67696E20616D204744562D4D616B6C6572706F7274616C2D0D0A0D0A48696E7765697320617566206469652066C3BC722064656E204469656E737465616E626965746572207A757374C3A46E646967656E205374656C6C656E2C20646965206469652045696E68616C74756E672064657220566F7273636872696674656E207A756D20446174656E73636875747A206B6F6E74726F6C6C696572656E3A0D0A4265726C696E6572204265617566747261677465722066C3BC7220446174656E73636875747A20756E6420496E666F726D6174696F6E7366726569686569740D0A416E20646572205572616E696120342D31300D0A3130373837204265726C696E0D0A3033302F3133382038392D300D0A6D61696C626F7840646174656E73636875747A2D6265726C696E2E64650D0A687474703A2F2F7777772E646174656E73636875747A2D6265726C696E2E64650D0A416E737072656368706172746E65723A2044722E20416C6578616E64657220446978" + " A6 1E 131C68747470733a2f2f7777772e72656469726563742d746573742e6465" + " A7 818B" + " 31 8188" + " 04 20 0617A64C37179860FEA3044A14052505FB4F8EF4D61F047B6A30130CD06718E6" + " 04 20 718FA21C2DF3A81BEF1B7A53360481C78C017F1EC7170266C2C4E9BB654B0E3B" + " 04 20 94B0AA7E8114F3E6DFCD52DA9F43E8B13CCB0589B8957E364728198FB4971AE6" + " 04 20 E85E1E8A78864E9246C86CF1C2A3810603EEEE75746C70CD51ACB86B5E2655D8" + ""); + QCOMPARE(certDescr->encode().toHex().toUpper(), QByteArray::fromHex(hexString).toHex().toUpper()); CertificateDescription_free(certDescr); } diff --git a/test/qt/card/asn1/test_ChainBuilder.cpp b/test/qt/card/asn1/test_ChainBuilder.cpp index c014322..ac16c99 100644 --- a/test/qt/card/asn1/test_ChainBuilder.cpp +++ b/test/qt/card/asn1/test_ChainBuilder.cpp @@ -4,9 +4,9 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ +#include #include #include -#include #include "asn1/ChainBuilder.h" diff --git a/test/qt/card/asn1/test_EcdsaPublicKey.cpp b/test/qt/card/asn1/test_EcdsaPublicKey.cpp index 9163457..f50613b 100644 --- a/test/qt/card/asn1/test_EcdsaPublicKey.cpp +++ b/test/qt/card/asn1/test_EcdsaPublicKey.cpp @@ -4,9 +4,9 @@ * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ -#include "TestFileHelper.h" #include "asn1/CVCertificate.h" #include "asn1/EcdsaPublicKey.h" +#include "TestFileHelper.h" #include #include diff --git a/test/qt/card/asn1/test_SignatureChecker.cpp b/test/qt/card/asn1/test_SignatureChecker.cpp index 1229766..2af5bb0 100644 --- a/test/qt/card/asn1/test_SignatureChecker.cpp +++ b/test/qt/card/asn1/test_SignatureChecker.cpp @@ -13,9 +13,9 @@ #include #include -#include "TestFileHelper.h" #include "asn1/CVCertificate.h" #include "asn1/SignatureChecker.h" +#include "TestFileHelper.h" #include #include "pace/ec/EcUtil.h" diff --git a/test/qt/card/asn1/test_efCardAccess.cpp b/test/qt/card/asn1/test_efCardAccess.cpp index 7d10659..222d880 100644 --- a/test/qt/card/asn1/test_efCardAccess.cpp +++ b/test/qt/card/asn1/test_efCardAccess.cpp @@ -2,10 +2,10 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "TestFileHelper.h" #include "asn1/ChipAuthenticationInfo.h" #include "asn1/PACEInfo.h" #include "asn1/SecurityInfos.h" +#include "TestFileHelper.h" #include diff --git a/test/qt/card/asn1/test_efCardSecurity.cpp b/test/qt/card/asn1/test_efCardSecurity.cpp index 1281d9e..b963f62 100644 --- a/test/qt/card/asn1/test_efCardSecurity.cpp +++ b/test/qt/card/asn1/test_efCardSecurity.cpp @@ -4,8 +4,8 @@ * \copyright Copyright (c) 2015 Governikus GmbH & Co. KG */ -#include "TestFileHelper.h" #include "asn1/EFCardSecurity.h" +#include "TestFileHelper.h" #include #include diff --git a/test/qt/card/pace/test_EcUtil.cpp b/test/qt/card/pace/test_EcUtil.cpp index 3c8afd1..9e2e603 100644 --- a/test/qt/card/pace/test_EcUtil.cpp +++ b/test/qt/card/pace/test_EcUtil.cpp @@ -5,9 +5,9 @@ #include "pace/ec/EcUtil.h" #include "pace/ec/EllipticCurveFactory.h" +#include #include #include -#include using namespace governikus; diff --git a/test/qt/card/pace/test_EcdhKeyAgreement.cpp b/test/qt/card/pace/test_EcdhKeyAgreement.cpp index b24c2e5..3294889 100644 --- a/test/qt/card/pace/test_EcdhKeyAgreement.cpp +++ b/test/qt/card/pace/test_EcdhKeyAgreement.cpp @@ -8,9 +8,9 @@ #include "pace/ec/EcdhKeyAgreement.h" +#include "asn1/PACEInfo.h" #include "MockReader.h" #include "TestFileHelper.h" -#include "asn1/PACEInfo.h" #include #include diff --git a/test/qt/card/pace/test_EllipticCurveFactory.cpp b/test/qt/card/pace/test_EllipticCurveFactory.cpp index 1349b0d..553f373 100644 --- a/test/qt/card/pace/test_EllipticCurveFactory.cpp +++ b/test/qt/card/pace/test_EllipticCurveFactory.cpp @@ -4,9 +4,9 @@ #include "pace/ec/EllipticCurveFactory.h" +#include #include #include -#include using namespace governikus; diff --git a/test/qt/card/pace/test_SymmetricCipher.cpp b/test/qt/card/pace/test_SymmetricCipher.cpp index 7ea8bbf..207d247 100644 --- a/test/qt/card/pace/test_SymmetricCipher.cpp +++ b/test/qt/card/pace/test_SymmetricCipher.cpp @@ -6,8 +6,8 @@ #include "pace/KeyDerivationFunction.h" #include "pace/SymmetricCipher.h" -#include #include +#include using namespace governikus; diff --git a/test/qt/core/context/test_AuthContext.cpp b/test/qt/core/context/test_AuthContext.cpp index 85d2cc0..5b1f918 100644 --- a/test/qt/core/context/test_AuthContext.cpp +++ b/test/qt/core/context/test_AuthContext.cpp @@ -6,9 +6,9 @@ * \copyright Copyright (c) 2016 Governikus GmbH & Co. KG */ +#include "testMacros.h" #include "TestAuthContext.h" #include "TestFileHelper.h" -#include "testMacros.h" #include #include diff --git a/test/qt/core/controller/test_ChangePinController.cpp b/test/qt/core/controller/test_ChangePinController.cpp index 5fdea97..69be90a 100644 --- a/test/qt/core/controller/test_ChangePinController.cpp +++ b/test/qt/core/controller/test_ChangePinController.cpp @@ -10,10 +10,10 @@ #include #include -#include "PersoSimController.h" -#include "ReaderManager.h" #include "context/AuthContext.h" #include "controller/ChangePinController.h" +#include "PersoSimController.h" +#include "ReaderManager.h" #include "testMacros.h" diff --git a/test/qt/core/paos/invoke/test_DidAuthenticateResponseEAC1.cpp b/test/qt/core/paos/invoke/test_DidAuthenticateResponseEAC1.cpp index 12e7e19..d480eb6 100644 --- a/test/qt/core/paos/invoke/test_DidAuthenticateResponseEAC1.cpp +++ b/test/qt/core/paos/invoke/test_DidAuthenticateResponseEAC1.cpp @@ -6,8 +6,8 @@ #include "paos/invoke/DidAuthenticateResponseEac1.h" -#include "TestFileHelper.h" #include "asn1/CVCertificate.h" +#include "TestFileHelper.h" #include diff --git a/test/qt/core/paos/retrieve/test_DidAuthenticateEac1.cpp b/test/qt/core/paos/retrieve/test_DidAuthenticateEac1.cpp index 026e819..b199a8c 100644 --- a/test/qt/core/paos/retrieve/test_DidAuthenticateEac1.cpp +++ b/test/qt/core/paos/retrieve/test_DidAuthenticateEac1.cpp @@ -6,9 +6,9 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "TestFileHelper.h" #include "paos/retrieve/DidAuthenticateEac1.h" #include "paos/retrieve/DidAuthenticateEac1Parser.h" +#include "TestFileHelper.h" #include #include diff --git a/test/qt/core/paos/retrieve/test_DidAuthenticateEac2.cpp b/test/qt/core/paos/retrieve/test_DidAuthenticateEac2.cpp index 5263e2b..a836b60 100644 --- a/test/qt/core/paos/retrieve/test_DidAuthenticateEac2.cpp +++ b/test/qt/core/paos/retrieve/test_DidAuthenticateEac2.cpp @@ -6,9 +6,9 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "TestFileHelper.h" #include "paos/retrieve/DidAuthenticateEac2.h" #include "paos/retrieve/DidAuthenticateEac2Parser.h" +#include "TestFileHelper.h" #include #include diff --git a/test/qt/core/paos/retrieve/test_DidAuthenticateEacAdditional.cpp b/test/qt/core/paos/retrieve/test_DidAuthenticateEacAdditional.cpp index 62206ed..f410c82 100644 --- a/test/qt/core/paos/retrieve/test_DidAuthenticateEacAdditional.cpp +++ b/test/qt/core/paos/retrieve/test_DidAuthenticateEacAdditional.cpp @@ -6,8 +6,8 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "TestFileHelper.h" #include "paos/retrieve/DidAuthenticateEacAdditional.h" +#include "TestFileHelper.h" #include #include diff --git a/test/qt/core/paos/retrieve/test_InitializeFramework.cpp b/test/qt/core/paos/retrieve/test_InitializeFramework.cpp index dbb1a55..41dffa6 100644 --- a/test/qt/core/paos/retrieve/test_InitializeFramework.cpp +++ b/test/qt/core/paos/retrieve/test_InitializeFramework.cpp @@ -6,8 +6,8 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "TestFileHelper.h" #include "paos/retrieve/InitializeFramework.h" +#include "TestFileHelper.h" #include #include diff --git a/test/qt/core/paos/retrieve/test_StartPAOSResponse.cpp b/test/qt/core/paos/retrieve/test_StartPAOSResponse.cpp index 16c23ab..0b8a223 100644 --- a/test/qt/core/paos/retrieve/test_StartPAOSResponse.cpp +++ b/test/qt/core/paos/retrieve/test_StartPAOSResponse.cpp @@ -6,8 +6,8 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "TestFileHelper.h" #include "paos/retrieve/StartPaosResponse.h" +#include "TestFileHelper.h" #include #include diff --git a/test/qt/core/paos/retrieve/test_transmit.cpp b/test/qt/core/paos/retrieve/test_transmit.cpp index 7e1d026..bb96e65 100644 --- a/test/qt/core/paos/retrieve/test_transmit.cpp +++ b/test/qt/core/paos/retrieve/test_transmit.cpp @@ -6,9 +6,9 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "TestFileHelper.h" #include "paos/retrieve/Transmit.h" #include "paos/retrieve/TransmitParser.h" +#include "TestFileHelper.h" #include #include diff --git a/test/qt/core/paos/test_paoshandler.cpp b/test/qt/core/paos/test_paoshandler.cpp index 463693b..c18ed09 100644 --- a/test/qt/core/paos/test_paoshandler.cpp +++ b/test/qt/core/paos/test_paoshandler.cpp @@ -7,8 +7,8 @@ #include #include -#include "TestFileHelper.h" #include "paos/PaosHandler.h" +#include "TestFileHelper.h" using namespace governikus; diff --git a/test/qt/core/states/test_StateCertificateDescriptionCheck.cpp b/test/qt/core/states/test_StateCertificateDescriptionCheck.cpp index 7348d65..e0b13a4 100644 --- a/test/qt/core/states/test_StateCertificateDescriptionCheck.cpp +++ b/test/qt/core/states/test_StateCertificateDescriptionCheck.cpp @@ -4,16 +4,16 @@ #include "states/StateCertificateDescriptionCheck.h" -#include "Result.h" -#include "TestFileHelper.h" #include "asn1/ASN1Util.h" #include "asn1/CVCertificate.h" #include "context/AuthContext.h" +#include "Result.h" +#include "TestFileHelper.h" #include "TestAuthContext.h" -#include #include #include +#include using namespace governikus; diff --git a/test/qt/core/states/test_StateCheckRefreshAddress.cpp b/test/qt/core/states/test_StateCheckRefreshAddress.cpp index 3e9feb7..6bd1d41 100644 --- a/test/qt/core/states/test_StateCheckRefreshAddress.cpp +++ b/test/qt/core/states/test_StateCheckRefreshAddress.cpp @@ -4,13 +4,13 @@ #include "states/StateCheckRefreshAddress.h" -#include "MockNetworkManager.h" #include "context/AuthContext.h" +#include "MockNetworkManager.h" #include "states/StateBuilder.h" -#include #include #include +#include using namespace governikus; diff --git a/test/qt/core/states/test_StateGenericSendReceive.cpp b/test/qt/core/states/test_StateGenericSendReceive.cpp index 685f4f6..7a6fb18 100644 --- a/test/qt/core/states/test_StateGenericSendReceive.cpp +++ b/test/qt/core/states/test_StateGenericSendReceive.cpp @@ -2,12 +2,12 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "TestAuthContext.h" #include "controller/AuthController.h" #include "paos/invoke/InitializeFrameworkResponse.h" #include "paos/retrieve/InitializeFramework.h" #include "states/StateBuilder.h" #include "states/StateGenericSendReceive.h" +#include "TestAuthContext.h" #include "MockNetworkManager.h" diff --git a/test/qt/core/states/test_StateInitializeFramework.cpp b/test/qt/core/states/test_StateInitializeFramework.cpp index 9e0912b..93a2813 100644 --- a/test/qt/core/states/test_StateInitializeFramework.cpp +++ b/test/qt/core/states/test_StateInitializeFramework.cpp @@ -2,14 +2,14 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include "TestFileHelper.h" #include "controller/AuthController.h" #include "states/StateBuilder.h" #include "states/StateInitializeFramework.h" +#include "TestFileHelper.h" -#include #include #include +#include using namespace governikus; diff --git a/test/qt/core/states/test_StatePreVerification.cpp b/test/qt/core/states/test_StatePreVerification.cpp index 70ac6b2..47129b1 100644 --- a/test/qt/core/states/test_StatePreVerification.cpp +++ b/test/qt/core/states/test_StatePreVerification.cpp @@ -7,8 +7,8 @@ #include "states/StatePreVerification.h" #include "AppSettings.h" -#include "TestFileHelper.h" #include "paos/retrieve/DidAuthenticateEac1.h" +#include "TestFileHelper.h" #include "TestAuthContext.h" #include diff --git a/test/qt/core/states/test_StateProcessCertificatesFromEac2.cpp b/test/qt/core/states/test_StateProcessCertificatesFromEac2.cpp index 08f805d..daa032a 100644 --- a/test/qt/core/states/test_StateProcessCertificatesFromEac2.cpp +++ b/test/qt/core/states/test_StateProcessCertificatesFromEac2.cpp @@ -6,13 +6,13 @@ #include "states/StateProcessCertificatesFromEac2.h" -#include "Commands.h" -#include "TestAuthContext.h" -#include "TestFileHelper.h" #include "asn1/CVCertificateChainBuilder.h" +#include "Commands.h" #include "paos/retrieve/DidAuthenticateEac1.h" #include "paos/retrieve/DidAuthenticateEac1Parser.h" #include "paos/retrieve/DidAuthenticateEac2Parser.h" +#include "TestAuthContext.h" +#include "TestFileHelper.h" #include #include diff --git a/test/qt/core/states/test_StateRedirectBrowser.cpp b/test/qt/core/states/test_StateRedirectBrowser.cpp index add9f27..62b51b1 100644 --- a/test/qt/core/states/test_StateRedirectBrowser.cpp +++ b/test/qt/core/states/test_StateRedirectBrowser.cpp @@ -5,12 +5,12 @@ #include "states/StateRedirectBrowser.h" #include "MockActivationContext.h" -#include "TestFileHelper.h" #include "states/StateBuilder.h" +#include "TestFileHelper.h" -#include #include #include +#include using namespace governikus; diff --git a/test/qt/core/states/test_StateStartPaosResponse.cpp b/test/qt/core/states/test_StateStartPaosResponse.cpp index b9d881a..ac8f468 100644 --- a/test/qt/core/states/test_StateStartPaosResponse.cpp +++ b/test/qt/core/states/test_StateStartPaosResponse.cpp @@ -2,15 +2,15 @@ * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG */ -#include #include #include +#include -#include "TestFileHelper.h" #include "controller/AuthController.h" #include "paos/retrieve/StartPaosResponse.h" #include "states/StateBuilder.h" #include "states/StateStartPaosResponse.h" +#include "TestFileHelper.h" using namespace governikus; diff --git a/test/qt/core/states/test_TermsOfUsage.cpp b/test/qt/core/states/test_TermsOfUsage.cpp index 166ef7e..9261503 100644 --- a/test/qt/core/states/test_TermsOfUsage.cpp +++ b/test/qt/core/states/test_TermsOfUsage.cpp @@ -1,20 +1,14 @@ /*! - * test_TermsOfUsage.cpp - * * \brief Tests the Terms of Usage of CertificateDescription * - * \copyright Copyright (c) 2014 Governikus GmbH & Co. KG + * \copyright Copyright (c) 2014-2017 Governikus GmbH & Co. KG */ -#include -#include - +#include "asn1/CertificateDescription.h" #include "TestFileHelper.h" -#include "asn1/ASN1TemplateUtil.h" -#include "asn1/ASN1Util.h" -#include "asn1/CertificateDescription.h" +#include using namespace governikus; @@ -23,55 +17,49 @@ class test_TermsOfUsage { Q_OBJECT - private: - QStringList mCVCList; - QStringList mPurposeList; - private Q_SLOTS: - void init() + void testPurposeOf_2014_07_03_cvcDescription_data() { - mPurposeList << QStringLiteral("Demonstration des eID-Service") - << QStringLiteral("Abwicklung von Verwaltungsleistungen mit Identifikationsbedarf ohne Registrierung im Sinne der GemO Rheinland-Pfalz") - << QStringLiteral("- Anmeldung und Registrierung im Portal der Bundesagentur f\u00FCr Arbeit (BA) f\u00FCr Gesch\u00E4ftsvorf\u00E4lle, die im Portal der BA verf\u00FCgbar sind -") - << QStringLiteral("- Authentisierung der Studierenden beim Login an Hochschuldiensten -") - << QStringLiteral("Registrierung / Login f\u00FCr \"Meine TK\"") - << QStringLiteral("Permanentes B\u00FCrgerkonto") - << QStringLiteral("- Registrierung und Login f\u00FCr ein Benutzerkonto im HamburgService -") - << QStringLiteral("- Altersverifikation f\u00FCr Online-Shop- und eCommerce-Anbieter per Web-Schnittstelle -") - << QStringLiteral("- Abwicklung von Verwaltungsleistungen mit Identifikationsbedarf ohne Registrierung -") - << QStringLiteral("Abwicklung von Verwaltungsleistungen ohne Registrierung") - << QStringLiteral("- Online Bearbeitung f\u00FCr Antr\u00E4ge nach dem SGB IX -") - << QStringLiteral("- Tempor\u00E4res B\u00FCrgerkonto -") - << QStringLiteral("BONIGO") - << QStringLiteral("Registrierung / Login f\u00FCr \"meinCosmosDirekt\"") - << QStringLiteral("- Selbstauskunft -") - << QStringLiteral("- Login B\u00FCrgerkonto \"Mein Hagen\" -") - << QStringLiteral("- Verifikation von Personendaten zur Alters- und Identit\u00E4tsfeststellung -") - << QStringLiteral("- Registrierung f\u00FCr die Virtuelle Poststelle bei der Deutschen Emissionshandelsstelle -") - << QString(); + QTest::addColumn("purpose"); - mCVCList << ":/core/step/2014_07_03_cvcDescription0.bin" << ":/core/step/2014_07_03_cvcDescription1.bin" - << ":/core/step/2014_07_03_cvcDescription2.bin" << ":/core/step/2014_07_03_cvcDescription3.bin" - << ":/core/step/2014_07_03_cvcDescription4.bin" << ":/core/step/2014_07_03_cvcDescription5.bin" - << ":/core/step/2014_07_03_cvcDescription6.bin" << ":/core/step/2014_07_03_cvcDescription7.bin" - << ":/core/step/2014_07_03_cvcDescription8.bin" << ":/core/step/2014_07_03_cvcDescription9.bin" - << ":/core/step/2014_07_03_cvcDescription10.bin" << ":/core/step/2014_07_03_cvcDescription11.bin" - << ":/core/step/2014_07_03_cvcDescription12.bin" << ":/core/step/2014_07_03_cvcDescription13.bin" - << ":/core/step/2014_07_03_cvcDescription14.bin" << ":/core/step/2014_07_03_cvcDescription15.bin" - << ":/core/step/2014_07_03_cvcDescription16.bin" << ":/core/step/2014_07_03_cvcDescription17.bin" - << ":/core/step/2014_07_03_cvcDescription18.bin"; + QTest::newRow("0") << QStringLiteral("- Anmeldung und Registrierung im Portal der Bundesagentur f\u00FCr Arbeit (BA) f\u00FCr Gesch\u00E4ftsvorf\u00E4lle, die im Portal der BA verf\u00FCgbar sind -"); + QTest::newRow("1") << QStringLiteral("- Authentisierung der Studierenden beim Login an Hochschuldiensten -"); + QTest::newRow("2") << QStringLiteral("Registrierung / Login f\u00FCr \"Meine TK\""); + QTest::newRow("3") << QStringLiteral("Permanentes B\u00FCrgerkonto"); + QTest::newRow("4") << QStringLiteral("- Selbstauskunft -"); + QTest::newRow("5") << QStringLiteral("- Registrierung und Login f\u00FCr ein Benutzerkonto im HamburgService -"); + QTest::newRow("6") << QStringLiteral("- Altersverifikation f\u00FCr Online-Shop- und eCommerce-Anbieter per Web-Schnittstelle -"); + QTest::newRow("7") << QStringLiteral("- Abwicklung von Verwaltungsleistungen mit Identifikationsbedarf ohne Registrierung -"); + QTest::newRow("8") << QStringLiteral("Abwicklung von Verwaltungsleistungen ohne Registrierung"); + QTest::newRow("9") << QStringLiteral("- Tempor\u00E4res B\u00FCrgerkonto -"); + QTest::newRow("10") << QStringLiteral("- Tempor\u00E4res B\u00FCrgerkonto -"); + QTest::newRow("11") << QStringLiteral("- Online Bearbeitung f\u00FCr Antr\u00E4ge nach dem SGB IX -"); + QTest::newRow("12") << QStringLiteral("- Tempor\u00E4res B\u00FCrgerkonto -"); + QTest::newRow("13") << QStringLiteral("BONIGO"); + QTest::newRow("14") << QStringLiteral("Registrierung / Login f\u00FCr \"meinCosmosDirekt\""); + QTest::newRow("15") << QStringLiteral("- Selbstauskunft -"); + QTest::newRow("16") << QStringLiteral("- Login B\u00FCrgerkonto \"Mein Hagen\" -"); + QTest::newRow("17") << QStringLiteral("- Verifikation von Personendaten zur Alters- und Identit\u00E4tsfeststellung -"); + QTest::newRow("18") << QStringLiteral("- Registrierung f\u00FCr die Virtuelle Poststelle bei der Deutschen Emissionshandelsstelle -"); + } + + + void testPurposeOf_2014_07_03_cvcDescription() + { + QFETCH(QString, purpose); + + const auto& filename = QStringLiteral(":/core/step/2014_07_03_cvcDescription%1.bin").arg(QString::fromLatin1(QTest::currentDataTag())); + QSharedPointer certDescr = CertificateDescription::fromHex(TestFileHelper::readFile(filename).toHex()); + QVERIFY(certDescr); + QCOMPARE(certDescr->getPurpose(), purpose); } void testGetDescTestAutentServer() { QByteArray hexValue("3082022F060A04007F00070301030101A12D0C2B446575747363686520506F737420436F6D2C204765736368C3A466747366656C64205369676E7472757374A2191317687474703A2F2F7777772E7369676E74727573742E6465A3080C06626F73204B47A429132768747470733A2F2F6465762D64656D6F2E676F7665726E696B75732D6569642E64653A38343433A58201580C820154416E736368726966743A0D0A6272656D656E206F6E6C696E6520736572766963657320476D6248202620436F2E204B470D0A416D2046616C6C7475726D20390D0A3238333539204272656D656E0D0A0D0A452D4D61696C2D416472657373653A0D0A686240626F732D6272656D656E2E64650D0A0D0A5A7765636B20646573204175736C657365766F7267616E67733A0D0A44656D6F6E7374726174696F6E20646573206549442D536572766963650D0A0D0A5A757374C3A46E6469676520446174656E73636875747A61756673696368743A0D0A446965204C616E64657362656175667472616774652066C3BC7220446174656E73636875747A20756E6420496E666F726D6174696F6E736672656968656974206465722046726569656E2048616E73657374616474204272656D656E0D0A41726E647473747261C39F6520310D0A3237353730204272656D6572686176656EA74631440420761099A58BFD5334E93A7A78E4F18B760FFCF8F513A4730C8AE9B59BCC0FE8C90420CEABB7E427174BCFFFB3499BF925A5D4A7887AD4FCF7747867912DEBB58D684C"); - QSharedPointer certDescr = CertificateDescription::fromHex(hexValue); - - if (!mPurposeList.contains(certDescr->getPurpose())) - { - QFAIL(certDescr->getPurpose().toUtf8().constData()); - } + QSharedPointer certDescr = CertificateDescription::fromHex(hexValue); + QVERIFY(certDescr); QCOMPARE(certDescr->getPurpose(), QStringLiteral("Demonstration des eID-Service")); } @@ -79,42 +67,17 @@ class test_TermsOfUsage void testGetDescRlpDirektServer() { QByteArray hexValue("30820312060A04007F00070301030101A10E0C0C442D547275737420476D6248A2181316687474703A2F2F7777772E642D74727573742E6E6574A33E0C3C4B6F6D6D5769732D476573656C6C73636861667420662E204B6F6D6D756E696B6174696F6E20752E2057697373656E737472616E73666572206D6248A416131468747470733A2F2F74626B2E65776F69732E6465A58201F20C8201EEEFBBBF4E616D652C20416E7363687269667420756E6420452D4D61696C2D4164726573736520646573204469656E7374616E626965746572733A0D0A4B6F6D6D5769732D476573656C6C73636861667420662E204B6F6D6D756E696B6174696F6E20752E2057697373656E737472616E73666572206D62480D0A48696E64656E62757267706C61747A20330D0A3535313138204D61696E7A0D0A737570706F7274406B6F6D6D7769732E64650D0A0D0A4765736368C3A46674737A7765636B3A0D0A41627769636B6C756E6720766F6E2056657277616C74756E67736C65697374756E67656E206D6974204964656E746966696B6174696F6E73626564617266206F686E652052656769737472696572756E6720696D2053696E6E65206465722047656D4F20526865696E6C616E642D5066616C7A0D0A0D0A5A757374C3A46E6469676520446174656E73636875747A626568C3B67264653A0D0A4175667369636874732D20756E64204469656E73746C65697374756E6773646972656B74696F6E2028414444290D0A54726965720D0A57696C6C792D4272616E64742D506C61747A20330D0A35343239302054726965720D0A303635312F393439342D300D0A706F73747374656C6C65406164642E726C702E64650D0A7777772E646174656E73636875747A2E726C702E6465A7818B31818804205B100843E6D2569F2FB5108A2D327D1929ED7EC814531D014B84C2B76B67FE6904209D8EB0BDF36B19C4AF3147E57401FD792845F0413102A7BD784DF9418098BEBE0420DB37C8E02D6D715EFBFB819D9620C0D411BB6D5F8000200148FFCFA3467F71580420EBD2A9610AA53AE1C159B2C7B238451E2C6AF06F7034723BD4B9743196E6A720"); - QSharedPointer certDescr = CertificateDescription::fromHex(hexValue); - - if (!mPurposeList.contains(certDescr->getPurpose())) - { - QFAIL(certDescr->getPurpose().toUtf8().constData()); - } - QCOMPARE(certDescr->getPurpose(), - QString("Abwicklung von Verwaltungsleistungen mit Identifikationsbedarf ohne Registrierung im Sinne der GemO Rheinland-Pfalz")); + QSharedPointer certDescr = CertificateDescription::fromHex(hexValue); + QCOMPARE(certDescr->getPurpose(), QStringLiteral("Abwicklung von Verwaltungsleistungen mit Identifikationsbedarf ohne Registrierung im Sinne der GemO Rheinland-Pfalz")); } void testGetDescAgetoServer() { QByteArray hexValue("3082029E060A04007F00070301030101A1140C12414745544F205365727669636520476D6248A2161314687474703A2F2F7777772E616765746F2E6E6574A3170C15414745544F20496E6E6F766174696F6E20476D6248A421131F68747470733A2F2F6569642E73657276696365732E616765746F2E6E65742FA58201DC0C8201D84E616D652C20416E7363687269667420756E6420452D4D61696C2D4164726573736520646573204469656E7374616E626965746572733A0A414745544F20496E6E6F766174696F6E20476D62480A57696E7A65726C616572205374722E20320A3037373435204A656E610A6E706140616765746F2E6E65740A0A5A7765636B2064657220446174656EC3BC6265726D6974746C756E673A0A4964656E746966697A696572756E6720756E642052656769737472696572756E67207A756D2070657273C3B66E6C696368656E204B756E64656E6B6F6E746F0A0A5A757374C3A46E6469676520446174656E73636875747A626568C3B67264653A0A5468C3BC72696E676572204C616E64657376657277616C74756E6773616D740A5265666572617420486F6865697473616E67656C6567656E68656974656E2C20476566616872656E6162776568720A5765696D6172706C61747A20340A3939343233205765696D61720A0A54656C3A20283033203631292033372037332037322035380A4661783A20283033203631292033372037332037332034360A706F73747374656C6C6540746C7677612E7468756572696E67656E2E64650A416E737072656368706172746E65723A204672617520416E6B65204E65756D616E6EA746314404202E78EBFA001EE9D9F02CCE6B5D93535FC8492FA634BE5BDD679EF430C73864000420D9D682F644CDC3685747104A7CA7C1B3302D81D2A17A88607143F664BF23FF90"); - QSharedPointer certDescr = CertificateDescription::fromHex(hexValue); - - QVERIFY(certDescr != nullptr); - if (!mPurposeList.contains(certDescr->getPurpose())) - { - QFAIL(certDescr->getPurpose().toUtf8().constData()); - } - QCOMPARE(certDescr->getPurpose(), QString()); - } - - - void testPurposeList() - { - for (const auto& fileName : qAsConst(mCVCList)) - { - QByteArray bytes = TestFileHelper::readFile(fileName); - QSharedPointer certDescr = CertificateDescription::fromHex(bytes.toHex()); - if (!mPurposeList.contains(certDescr->getPurpose())) - { - QFAIL(certDescr->getPurpose().toUtf8().constData()); - } - } + QSharedPointer certDescr = CertificateDescription::fromHex(hexValue); + QVERIFY(certDescr); + QCOMPARE(certDescr->getPurpose(), QStringLiteral("Identifizierung und Registrierung zum pers\u00F6nlichen Kundenkonto")); } diff --git a/test/qt/core/test_CertificateChecker.cpp b/test/qt/core/test_CertificateChecker.cpp index 1bf101e..cf264e8 100644 --- a/test/qt/core/test_CertificateChecker.cpp +++ b/test/qt/core/test_CertificateChecker.cpp @@ -5,17 +5,17 @@ */ #include "AppSettings.h" +#include "context/AuthContext.h" #include "CertificateChecker.h" #include "LogHandler.h" #include "SecureStorage.h" -#include "context/AuthContext.h" #include "MockActivationContext.h" #include "TestFileHelper.h" +#include #include #include -#include using namespace governikus; diff --git a/test/qt/drivers/test_ReaderDetector.cpp b/test/qt/drivers/test_ReaderDetector.cpp index 1a9d3ef..9b40146 100644 --- a/test/qt/drivers/test_ReaderDetector.cpp +++ b/test/qt/drivers/test_ReaderDetector.cpp @@ -65,7 +65,7 @@ namespace #if defined(Q_OS_WIN) static const QString KOMFORT_DRIVER_URL("https://appl.governikus-asp.de/ausweisapp2/driver/bc_7_2_3.exe"); #elif defined(Q_OS_OSX) -static const QString KOMFORT_DRIVER_URL = QSysInfo::MacintoshVersion == QSysInfo::MV_10_11 ? +static const QString KOMFORT_DRIVER_URL = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_11 ? QStringLiteral("https://appl.governikus-asp.de/ausweisapp2/driver/01_pcsc-cyberjack_3.99.5final.SP08-universal-osx10.11-signed.pkg") : QStringLiteral("https://appl.governikus-asp.de/ausweisapp2/driver/pcsc-cyberjack_3.99.5final.SP07-universal-signed.pkg"); #elif defined(Q_OS_LINUX) @@ -120,7 +120,7 @@ class test_ReaderDetector " \"URL\": \"https://appl.governikus-asp.de/ausweisapp2/driver/pcsc-cyberjack_3.99.5final.SP07-universal-signed.pkg\"\n" " },\n" " {\n" - " \"Platforms\": [\"MV_10_11\"],\n" + " \"Platforms\": [\"MV_10_11\", \"MV_10_12\"],\n" " \"URL\": \"https://appl.governikus-asp.de/ausweisapp2/driver/01_pcsc-cyberjack_3.99.5final.SP08-universal-osx10.11-signed.pkg\"\n" " },\n" " {\n" @@ -300,7 +300,7 @@ class test_ReaderDetector " \"URL\": \"https://appl.governikus-asp.de/ausweisapp2/driver/pcsc-cyberjack_3.99.5final.SP07-universal-signed.pkg\"\n" " },\n" " {\n" - " \"Platforms\": [\"MV_10_11\"],\n" + " \"Platforms\": [\"MV_10_11\", \"MV_10_12\"],\n" " \"URL\": \"https://appl.governikus-asp.de/ausweisapp2/driver/01_pcsc-cyberjack_3.99.5final.SP08-universal-osx10.11-signed.pkg\"\n" " },\n" " {\n" diff --git a/test/qt/global/test_VersionNumber.cpp b/test/qt/global/test_VersionNumber.cpp index 277a336..af7f489 100644 --- a/test/qt/global/test_VersionNumber.cpp +++ b/test/qt/global/test_VersionNumber.cpp @@ -148,6 +148,10 @@ class test_VersionNumber void isDeveloper() { + QString empty; + VersionNumber number0(empty); + QVERIFY(number0.isDeveloperVersion()); + VersionNumber number1("1.5.0"); QVERIFY(number1.isDeveloperVersion()); diff --git a/test/qt/gui/test_HelpAction.cpp b/test/qt/gui/test_HelpAction.cpp index afb9045..024250f 100644 --- a/test/qt/gui/test_HelpAction.cpp +++ b/test/qt/gui/test_HelpAction.cpp @@ -8,8 +8,8 @@ #include -#include "LanguageLoader.h" #include "generic/HelpAction.h" +#include "LanguageLoader.h" using namespace governikus; diff --git a/test/qt/jsonapi/test_MsgHandlerAccessRights.cpp b/test/qt/jsonapi/test_MsgHandlerAccessRights.cpp index c628ff9..c951253 100644 --- a/test/qt/jsonapi/test_MsgHandlerAccessRights.cpp +++ b/test/qt/jsonapi/test_MsgHandlerAccessRights.cpp @@ -30,19 +30,33 @@ class test_MsgHandlerAccessRights QSharedPointer getContextWithChat() { QSharedPointer context(new TestAuthContext(new InternalActivationContext(QUrl("http://dummy")), ":/paos/DIDAuthenticateEAC1.xml")); - context->setRequiredAccessRights({AccessRight::READ_DG01, AccessRight::READ_DG04}); + context->setRequiredAccessRights({AccessRight::READ_DG01, AccessRight::READ_DG04, AccessRight::READ_DG17}); context->setOptionalAccessRights({AccessRight::AGE_VERIFICATION, AccessRight::READ_DG05}); return context; } +#define AUX R"({"aux":{"ageVerificationDate":"1992-12-06","communityId":"02760400110000","requiredAge":"24","validityDate":"2013-12-06"},)" + private Q_SLOTS: + void nonExistingTransactionInfo() + { + QSharedPointer context(new TestAuthContext(new InternalActivationContext(QUrl("http://dummy")), ":/paos/DIDAuthenticateEAC1_2.xml")); + MessageDispatcher dispatcher; + dispatcher.init(context); + + QCOMPARE(dispatcher.processStateChange("StateEditAccessRights"), + QByteArray(R"({"chat":{"effective":["ResidencePermitI","Address","BirthName","Nationality","PlaceOfBirth","DateOfBirth","DoctoralDegree","ArtisticName","FamilyName","GivenNames","ValidUntil","IssuingCountry","DocumentType","Pseudonym"],"optional":["ResidencePermitI","Address","BirthName","Nationality","PlaceOfBirth","DateOfBirth","DoctoralDegree","ArtisticName","FamilyName","GivenNames","ValidUntil","IssuingCountry","DocumentType","Pseudonym"],"required":[]},"msg":"ACCESS_RIGHTS"})")); + } + + void state() { MessageDispatcher dispatcher; dispatcher.init(getContextWithChat()); - QCOMPARE(dispatcher.processStateChange("StateEditAccessRights"), QByteArray("{\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8,0],\"optional\":[12,0],\"required\":[11,8]}}")); + QCOMPARE(dispatcher.processStateChange("StateEditAccessRights"), + QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})")); } @@ -50,11 +64,11 @@ class test_MsgHandlerAccessRights { MessageDispatcher dispatcher; - QByteArray msg = QByteArray("{\"cmd\": \"GET_ACCESS_RIGHTS\"}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"GET_ACCESS_RIGHTS\",\"msg\":\"BAD_STATE\"}")); + const auto& msg = QByteArray(R"( {"cmd": "GET_ACCESS_RIGHTS"} )"); + QCOMPARE(dispatcher.processCommand(msg), QByteArray(R"({"error":"GET_ACCESS_RIGHTS","msg":"BAD_STATE"})")); dispatcher.init(getContextWithChat()); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"GET_ACCESS_RIGHTS\",\"msg\":\"BAD_STATE\"}")); + QCOMPARE(dispatcher.processCommand(msg), QByteArray(R"({"error":"GET_ACCESS_RIGHTS","msg":"BAD_STATE"})")); } @@ -68,11 +82,10 @@ class test_MsgHandlerAccessRights QVERIFY(!dispatcher.processStateChange("StateEditAccessRights").isEmpty()); QVERIFY(!context->isStateApproved()); - QByteArray msg = QByteArray("{\"cmd\": \"GET_ACCESS_RIGHTS\"}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8,0],\"optional\":[12,0],\"required\":[11,8]}}")); + QCOMPARE(dispatcher.processCommand(QByteArray(R"( {"cmd": "GET_ACCESS_RIGHTS"} )")), + QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})")); - msg = QByteArray("{\"cmd\": \"ACCEPT\"}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray()); + QCOMPARE(dispatcher.processCommand(QByteArray(R"( {"cmd": "ACCEPT"} )")), QByteArray()); QVERIFY(context->isStateApproved()); } @@ -83,40 +96,77 @@ class test_MsgHandlerAccessRights dispatcher.init(getContextWithChat()); QVERIFY(!dispatcher.processStateChange("StateEditAccessRights").isEmpty()); - QByteArray msg = QByteArray("{\"cmd\": \"GET_ACCESS_RIGHTS\"}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8,0],\"optional\":[12,0],\"required\":[11,8]}}")); + QCOMPARE(dispatcher.processCommand(QByteArray(R"( {"cmd": "GET_ACCESS_RIGHTS"} )")), + QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})")); + } + + + void setAccessRights_data() + { + QTest::addColumn("cmd"); + QTest::addColumn("msg"); + + QTest::newRow("chat_invalid") << QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["8",11]} )") + << QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"error":"Entry in 'chat' data needs to be string","msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})"); + + QTest::newRow("chat_needs_be_string") << QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": [8,"11"]} )") + << QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"error":"Entry in 'chat' data is invalid","msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})"); + + QTest::newRow("chat_unknown_id") << QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["y", "123"]} )") + << QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"error":"Entry in 'chat' data is invalid","msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})"); + + QTest::newRow("chat_set_optional") << QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["FamilyName"]} )") + << QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})"); + + QTest::newRow("chat_mixed_valid_and_required") << QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["AgeVerification", "GivenNames"]} )") + << QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"error":"Entry in 'chat' data is not available","msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})"); + + QTest::newRow("chat_both_optional") << QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["AgeVerification", "FamilyName"]} )") + << QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})"); + + QTest::newRow("chat_single_optional") << QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["AgeVerification"]} )") + << QByteArray(AUX R"("chat":{"effective":["Address","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})"); + + QTest::newRow("chat_disable_optional") << QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": []} )") + << QByteArray(AUX R"("chat":{"effective":["Address","GivenNames","DocumentType"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})"); } void setAccessRights() { + QFETCH(QByteArray, cmd); + QFETCH(QByteArray, msg); + MessageDispatcher dispatcher; dispatcher.init(getContextWithChat()); QVERIFY(!dispatcher.processStateChange("StateEditAccessRights").isEmpty()); - QByteArray msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": [8,\"11\"]}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"Entry in 'raw' data needs to be integer\",\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8,0],\"optional\":[12,0],\"required\":[11,8]}}")); + // check original state + QCOMPARE(dispatcher.processCommand(QByteArray(R"( {"cmd": "GET_ACCESS_RIGHTS"} )")), + QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})")); - msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": [0, 123]}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"Entry in 'raw' data is invalid\",\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8,0],\"optional\":[12,0],\"required\":[11,8]}}")); + // check cmd + QCOMPARE(dispatcher.processCommand(cmd), msg); + } - msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": [12]}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8],\"optional\":[12,0],\"required\":[11,8]}}")); - msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": [0, 11]}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"Entry in 'raw' data is invalid\",\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8],\"optional\":[12,0],\"required\":[11,8]}}")); + void setAccessRightsWithMultipleCmds() + { + MessageDispatcher dispatcher; + dispatcher.init(getContextWithChat()); + QVERIFY(!dispatcher.processStateChange("StateEditAccessRights").isEmpty()); - msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": [0,12]}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8,0],\"optional\":[12,0],\"required\":[11,8]}}")); + // check original state + QCOMPARE(dispatcher.processCommand(QByteArray(R"( {"cmd": "GET_ACCESS_RIGHTS"} )")), + QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})")); - msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": [0]}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[11,8,0],\"optional\":[12,0],\"required\":[11,8]}}")); + // check cmds + QCOMPARE(dispatcher.processCommand(QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["FamilyName"]} )")), + QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})")); - msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": [0,12]}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8,0],\"optional\":[12,0],\"required\":[11,8]}}")); - - msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": []}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[11,8],\"optional\":[12,0],\"required\":[11,8]}}")); + // 11 is not valid, 0 is valid ... we do not accept partial valid values! + QCOMPARE(dispatcher.processCommand(QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["AgeVerification", "GivenNames"]} )")), + QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"error":"Entry in 'chat' data is not available","msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})")); } @@ -129,31 +179,43 @@ class test_MsgHandlerAccessRights dispatcher.init(context); QVERIFY(!dispatcher.processStateChange("StateEditAccessRights").isEmpty()); - QByteArray msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": [0]}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"No optional access rights available\",\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[11,8],\"optional\":[],\"required\":[11,8]}}")); + QCOMPARE(dispatcher.processCommand(QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["AgeVerification"]} )")), + QByteArray(AUX R"("chat":{"effective":["Address","GivenNames","DocumentType"],"optional":[],"required":["Address","GivenNames","DocumentType"]},"error":"No optional access rights available","msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})")); context->setOptionalAccessRights({AccessRight::AGE_VERIFICATION}); - msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": [0]}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[11,8,0],\"optional\":[0],\"required\":[11,8]}}")); + QCOMPARE(dispatcher.processCommand(QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["AgeVerification"]} )")), + QByteArray(AUX R"("chat":{"effective":["Address","GivenNames","DocumentType","AgeVerification"],"optional":["AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})")); - context->setRequiredAccessRights({AccessRight::AGE_VERIFICATION}); + context->setRequiredAccessRights({AccessRight::AGE_VERIFICATION, AccessRight::READ_DG17}); context->setOptionalAccessRights({}); - msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": [0]}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"No optional access rights available\",\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[0],\"optional\":[],\"required\":[0]}}")); + QCOMPARE(dispatcher.processCommand(QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": ["AgeVerification"]} )")), + QByteArray(AUX R"("chat":{"effective":["Address","AgeVerification"],"optional":[],"required":["Address","AgeVerification"]},"error":"No optional access rights available","msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})")); + } + + + void crap_data() + { + QTest::addColumn("cmd"); + QTest::addColumn("msg"); + + QTest::newRow("chat_null") << QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "chat": null} )") + << QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"error":"Invalid 'chat' data","msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})"); + + QTest::newRow("CHAT") << QByteArray(R"( {"cmd": "SET_ACCESS_RIGHTS", "CHAT": []} )") + << QByteArray(AUX R"("chat":{"effective":["Address","FamilyName","GivenNames","DocumentType","AgeVerification"],"optional":["FamilyName","AgeVerification"],"required":["Address","GivenNames","DocumentType"]},"error":"'chat' cannot be undefined","msg":"ACCESS_RIGHTS","transactionInfo":"this is a test for TransactionInfo"})"); } void crap() { + QFETCH(QByteArray, cmd); + QFETCH(QByteArray, msg); + MessageDispatcher dispatcher; dispatcher.init(getContextWithChat()); QVERIFY(!dispatcher.processStateChange("StateEditAccessRights").isEmpty()); - QByteArray msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"raw\": null}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"Invalid 'raw' data\",\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8,0],\"optional\":[12,0],\"required\":[11,8]}}")); - - msg = QByteArray("{\"cmd\": \"SET_ACCESS_RIGHTS\", \"RAW\": []}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"'raw' cannot be undefined\",\"msg\":\"ACCESS_RIGHTS\",\"raw\":{\"effective\":[12,11,8,0],\"optional\":[12,0],\"required\":[11,8]}}")); + QCOMPARE(dispatcher.processCommand(cmd), msg); } diff --git a/test/qt/jsonapi/test_MsgHandlerCertificate.cpp b/test/qt/jsonapi/test_MsgHandlerCertificate.cpp index 239054f..a1acf75 100644 --- a/test/qt/jsonapi/test_MsgHandlerCertificate.cpp +++ b/test/qt/jsonapi/test_MsgHandlerCertificate.cpp @@ -51,7 +51,7 @@ class test_MsgHandlerCertificate QVERIFY(!dispatcher.processStateChange("StateEditAccessRights").isEmpty()); QByteArray msg = "{\"cmd\": \"GET_CERTIFICATE\"}"; - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"description\":{\"issuerName\":\"Deutsche Post Com, Gesch\xC3\xA4" "ftsfeld Signtrust\",\"issuerUrl\":\"http://www.signtrust.de\",\"subjectName\":\"bos KG\",\"subjectUrl\":\"https://dev-demo.governikus-eid.de:8443\",\"termsOfUsage\":\"Anschrift:\\r\\nbremen online services GmbH & Co. KG\\r\\nAm Fallturm 9\\r\\n28359 Bremen\\r\\n\\r\\nE-Mail-Adresse:\\r\\nhb@bos-bremen.de\\r\\n\\r\\nZweck des Auslesevorgangs:\\r\\nDemonstration des eID-Service\\r\\n\\r\\nZust\xC3\xA4ndige Datenschutzaufsicht:\\r\\nDie Landesbeauftragte f\xC3\xBCr Datenschutz und Informationsfreiheit der Freien Hansestadt Bremen\\r\\nArndtstra\xC3\x9F" "e 1\\r\\n27570 Bremerhaven\"},\"msg\":\"CERTIFICATE\",\"validity\":{\"effectiveDate\":\"2013-11-27\",\"expirationDate\":\"2013-12-26\"}}")); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"description\":{\"issuerName\":\"Deutsche Post Com, Gesch\xC3\xA4" "ftsfeld Signtrust\",\"issuerUrl\":\"http://www.signtrust.de\",\"purpose\":\"Demonstration des eID-Service\",\"subjectName\":\"bos KG\",\"subjectUrl\":\"https://dev-demo.governikus-eid.de:8443\",\"termsOfUsage\":\"Anschrift:\\r\\nbremen online services GmbH & Co. KG\\r\\nAm Fallturm 9\\r\\n28359 Bremen\\r\\n\\r\\nE-Mail-Adresse:\\r\\nhb@bos-bremen.de\\r\\n\\r\\nZweck des Auslesevorgangs:\\r\\nDemonstration des eID-Service\\r\\n\\r\\nZust\xC3\xA4ndige Datenschutzaufsicht:\\r\\nDie Landesbeauftragte f\xC3\xBCr Datenschutz und Informationsfreiheit der Freien Hansestadt Bremen\\r\\nArndtstra\xC3\x9F" "e 1\\r\\n27570 Bremerhaven\"},\"msg\":\"CERTIFICATE\",\"validity\":{\"effectiveDate\":\"2013-11-27\",\"expirationDate\":\"2013-12-26\"}}")); } diff --git a/test/qt/jsonapi/test_MsgHandlerEnterCan.cpp b/test/qt/jsonapi/test_MsgHandlerEnterCan.cpp index f97cdba..f8e3d9f 100644 --- a/test/qt/jsonapi/test_MsgHandlerEnterCan.cpp +++ b/test/qt/jsonapi/test_MsgHandlerEnterCan.cpp @@ -10,8 +10,8 @@ #include "MockReaderManagerPlugIn.h" #include "ReaderManager.h" -#include #include +#include Q_IMPORT_PLUGIN(MockReaderManagerPlugIn) @@ -136,9 +136,9 @@ class test_MsgHandlerEnterCan context->setReaderName("MockReader CARD"); - QCOMPARE(dispatcher.processStateChange("StateEstablishPaceCan"), QByteArray("{\"msg\":\"ENTER_CAN\",\"reader\":{\"attached\":true,\"card\":{\"deactivated\":false,\"retryCounter\":-1},\"name\":\"MockReader CARD\"}}")); + QCOMPARE(dispatcher.processStateChange("StateEstablishPaceCan"), QByteArray("{\"msg\":\"ENTER_CAN\",\"reader\":{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"name\":\"MockReader CARD\"}}")); msg = "{\"cmd\": \"SET_CAN\", \"value\": \"54321\"}"; - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"You must provide 6 digits\",\"msg\":\"ENTER_CAN\",\"reader\":{\"attached\":true,\"card\":{\"deactivated\":false,\"retryCounter\":-1},\"name\":\"MockReader CARD\"}}")); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"You must provide 6 digits\",\"msg\":\"ENTER_CAN\",\"reader\":{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"name\":\"MockReader CARD\"}}")); } diff --git a/test/qt/jsonapi/test_MsgHandlerEnterPin.cpp b/test/qt/jsonapi/test_MsgHandlerEnterPin.cpp index 89170c1..c8db6f5 100644 --- a/test/qt/jsonapi/test_MsgHandlerEnterPin.cpp +++ b/test/qt/jsonapi/test_MsgHandlerEnterPin.cpp @@ -10,8 +10,8 @@ #include "MockReaderManagerPlugIn.h" #include "ReaderManager.h" -#include #include +#include Q_IMPORT_PLUGIN(MockReaderManagerPlugIn) @@ -136,9 +136,9 @@ class test_MsgHandlerEnterPin context->setReaderName("MockReader CARD"); - QCOMPARE(dispatcher.processStateChange("StateEstablishPacePin"), QByteArray("{\"msg\":\"ENTER_PIN\",\"reader\":{\"attached\":true,\"card\":{\"deactivated\":false,\"retryCounter\":-1},\"name\":\"MockReader CARD\"}}")); + QCOMPARE(dispatcher.processStateChange("StateEstablishPacePin"), QByteArray("{\"msg\":\"ENTER_PIN\",\"reader\":{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"name\":\"MockReader CARD\"}}")); msg = "{\"cmd\": \"SET_PIN\", \"value\": \"54321\"}"; - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"You must provide 6 digits\",\"msg\":\"ENTER_PIN\",\"reader\":{\"attached\":true,\"card\":{\"deactivated\":false,\"retryCounter\":-1},\"name\":\"MockReader CARD\"}}")); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"You must provide 6 digits\",\"msg\":\"ENTER_PIN\",\"reader\":{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"name\":\"MockReader CARD\"}}")); } diff --git a/test/qt/jsonapi/test_MsgHandlerEnterPuk.cpp b/test/qt/jsonapi/test_MsgHandlerEnterPuk.cpp index d8739a1..b6dd2b5 100644 --- a/test/qt/jsonapi/test_MsgHandlerEnterPuk.cpp +++ b/test/qt/jsonapi/test_MsgHandlerEnterPuk.cpp @@ -7,9 +7,11 @@ #include "messages/MsgHandlerEnterPuk.h" #include "MessageDispatcher.h" +#include "MockReaderManagerPlugIn.h" +#include "ReaderManager.h" -#include #include +#include Q_IMPORT_PLUGIN(MockReaderManagerPlugIn) @@ -36,6 +38,19 @@ class test_MsgHandlerEnterPuk private Q_SLOTS: + void initTestCase() + { + ReaderManager::getInstance().init(); + ReaderManager::getInstance().getPlugInInfos(); // just to wait until initialization finished + } + + + void cleanupTestCase() + { + ReaderManager::getInstance().shutdown(); + } + + void stateMsg() { MessageDispatcher dispatcher; @@ -43,6 +58,85 @@ class test_MsgHandlerEnterPuk } + void undefined() + { + MessageDispatcher dispatcher; + setValidState(dispatcher); + + QByteArray msg("{\"cmd\": \"SET_PUK\"}"); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"Value cannot be undefined\",\"msg\":\"ENTER_PUK\"}")); + } + + + void invalid() + { + MessageDispatcher dispatcher; + setValidState(dispatcher); + + QByteArray msg("{\"cmd\": \"SET_PUK\", \"value\": 12345667890}"); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"Invalid value\",\"msg\":\"ENTER_PUK\"}")); + } + + + void badInput() + { + MessageDispatcher dispatcher; + setValidState(dispatcher); + + QByteArray msg("{\"cmd\": \"SET_PUK\", \"value\": \"123456\"}"); + QByteArray expected("{\"error\":\"You must provide 10 digits\",\"msg\":\"ENTER_PUK\"}"); + QCOMPARE(dispatcher.processCommand(msg), expected); + + msg = "{\"cmd\": \"SET_PUK\", \"value\": \"12345\"}"; + QCOMPARE(dispatcher.processCommand(msg), expected); + } + + + void badState() + { + MessageDispatcher dispatcher; + setValidState(dispatcher, QStringLiteral("invalid")); + + QByteArray msg("{\"cmd\": \"SET_PUK\", \"value\": \"12345\"}"); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"SET_PUK\",\"msg\":\"BAD_STATE\"}")); + + msg = "{\"cmd\": \"SET_PUK\", \"value\": \"123456\"}"; + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"SET_PUK\",\"msg\":\"BAD_STATE\"}")); + } + + + void noDirectResponseIfPukLooksValid() + { + MessageDispatcher dispatcher; + setValidState(dispatcher); + + QByteArray msg("{\"cmd\": \"SET_PUK\", \"value\": \"1234567890\"}"); + QCOMPARE(dispatcher.processCommand(msg), QByteArray()); + } + + + void readerInfo() + { + MockReader* reader = MockReaderManagerPlugIn::getInstance().addReader("MockReader CARD"); + reader->setCard(MockCardConfig()); + + QSharedPointer context(new WorkflowContext()); + MessageDispatcher dispatcher; + dispatcher.init(context); + + context->setReaderName("MockReader"); + QCOMPARE(dispatcher.processStateChange("StateEstablishPacePuk"), QByteArray("{\"msg\":\"ENTER_PUK\"}")); + QByteArray msg = "{\"cmd\": \"SET_PUK\", \"value\": \"654321\"}"; + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"You must provide 10 digits\",\"msg\":\"ENTER_PUK\"}")); + + + context->setReaderName("MockReader CARD"); + QCOMPARE(dispatcher.processStateChange("StateEstablishPacePuk"), QByteArray("{\"msg\":\"ENTER_PUK\",\"reader\":{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"name\":\"MockReader CARD\"}}")); + msg = "{\"cmd\": \"SET_PUK\", \"value\": \"654321\"}"; + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"error\":\"You must provide 10 digits\",\"msg\":\"ENTER_PUK\",\"reader\":{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"name\":\"MockReader CARD\"}}")); + } + + }; QTEST_GUILESS_MAIN(test_MsgHandlerEnterPuk) diff --git a/test/qt/jsonapi/test_MsgHandlerInsertCard.cpp b/test/qt/jsonapi/test_MsgHandlerInsertCard.cpp index ce2c9de..d70a71f 100644 --- a/test/qt/jsonapi/test_MsgHandlerInsertCard.cpp +++ b/test/qt/jsonapi/test_MsgHandlerInsertCard.cpp @@ -10,8 +10,8 @@ #include "MockReaderManagerPlugIn.h" #include "ReaderManager.h" -#include #include +#include Q_IMPORT_PLUGIN(MockReaderManagerPlugIn) diff --git a/test/qt/jsonapi/test_MsgHandlerReader.cpp b/test/qt/jsonapi/test_MsgHandlerReader.cpp index 12c1548..df4e468 100644 --- a/test/qt/jsonapi/test_MsgHandlerReader.cpp +++ b/test/qt/jsonapi/test_MsgHandlerReader.cpp @@ -82,7 +82,7 @@ class test_MsgHandlerReader MessageDispatcher dispatcher; QByteArray msg("{\"cmd\": \"GET_READER\", \"name\": \"MockReader 0815\"}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"attached\":true,\"card\":{\"deactivated\":false,\"retryCounter\":-1},\"msg\":\"READER\",\"name\":\"MockReader 0815\"}")); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"msg\":\"READER\",\"name\":\"MockReader 0815\"}")); } @@ -107,10 +107,10 @@ class test_MsgHandlerReader MessageDispatcher dispatcher; QByteArray msg("{\"cmd\": \"GET_READER\", \"name\": \"MockReader 0815\"}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"attached\":true,\"card\":{\"deactivated\":false,\"retryCounter\":-1},\"msg\":\"READER\",\"name\":\"MockReader 0815\"}")); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"msg\":\"READER\",\"name\":\"MockReader 0815\"}")); msg = "{\"cmd\": \"GET_READER\", \"name\": \"ReaderMock\"}"; - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"attached\":true,\"card\":{\"deactivated\":false,\"retryCounter\":-1},\"msg\":\"READER\",\"name\":\"ReaderMock\"}")); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"msg\":\"READER\",\"name\":\"ReaderMock\"}")); msg = "{\"cmd\": \"GET_READER\", \"name\": \"ReaderMockXYZ\"}"; QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"attached\":true,\"card\":null,\"msg\":\"READER\",\"name\":\"ReaderMockXYZ\"}")); @@ -119,7 +119,7 @@ class test_MsgHandlerReader QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"attached\":true,\"card\":null,\"msg\":\"READER\",\"name\":\"SpecialMock\"}")); msg = "{\"cmd\": \"GET_READER\", \"name\": \"SpecialMockWithGermanCard\"}"; - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"attached\":true,\"card\":{\"deactivated\":true,\"retryCounter\":3},\"msg\":\"READER\",\"name\":\"SpecialMockWithGermanCard\"}")); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"attached\":true,\"card\":{\"deactivated\":true,\"inoperative\":false,\"retryCounter\":3},\"msg\":\"READER\",\"name\":\"SpecialMockWithGermanCard\"}")); } diff --git a/test/qt/jsonapi/test_MsgHandlerReaderList.cpp b/test/qt/jsonapi/test_MsgHandlerReaderList.cpp index 2003854..dd750fe 100644 --- a/test/qt/jsonapi/test_MsgHandlerReaderList.cpp +++ b/test/qt/jsonapi/test_MsgHandlerReaderList.cpp @@ -4,10 +4,10 @@ * \copyright Copyright (c) 2016 Governikus GmbH & Co. KG */ +#include "messages/MsgHandlerReader.h" #include "MessageDispatcher.h" #include "MockReaderManagerPlugIn.h" #include "ReaderManager.h" -#include "messages/MsgHandlerReader.h" #include @@ -59,7 +59,7 @@ class test_MsgHandlerReaderList MessageDispatcher dispatcher; QByteArray msg("{\"cmd\": \"GET_READER_LIST\"}"); - QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"msg\":\"READER_LIST\",\"reader\":[{\"attached\":true,\"card\":{\"deactivated\":false,\"retryCounter\":-1},\"name\":\"MockReader 0815\"}]}")); + QCOMPARE(dispatcher.processCommand(msg), QByteArray("{\"msg\":\"READER_LIST\",\"reader\":[{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"name\":\"MockReader 0815\"}]}")); } @@ -86,11 +86,11 @@ class test_MsgHandlerReaderList QByteArray msg("{\"cmd\": \"GET_READER_LIST\"}"); QByteArray expected("{\"msg\":\"READER_LIST\",\"reader\":[" - "{\"attached\":true,\"card\":{\"deactivated\":false,\"retryCounter\":-1},\"name\":\"MockReader 0815\"}," - "{\"attached\":true,\"card\":{\"deactivated\":false,\"retryCounter\":-1},\"name\":\"ReaderMock\"}," + "{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"name\":\"MockReader 0815\"}," + "{\"attached\":true,\"card\":{\"deactivated\":false,\"inoperative\":false,\"retryCounter\":-1},\"name\":\"ReaderMock\"}," "{\"attached\":true,\"card\":null,\"name\":\"ReaderMockXYZ\"}," "{\"attached\":true,\"card\":null,\"name\":\"SpecialMock\"}," - "{\"attached\":true,\"card\":{\"deactivated\":true,\"retryCounter\":3},\"name\":\"SpecialMockWithGermanCard\"}" + "{\"attached\":true,\"card\":{\"deactivated\":true,\"inoperative\":false,\"retryCounter\":3},\"name\":\"SpecialMockWithGermanCard\"}" "]}"); QCOMPARE(dispatcher.processCommand(msg), expected); diff --git a/test/qt/services/test_ProviderParser.cpp b/test/qt/services/test_ProviderParser.cpp index 4fb09de..7204f65 100644 --- a/test/qt/services/test_ProviderParser.cpp +++ b/test/qt/services/test_ProviderParser.cpp @@ -11,6 +11,7 @@ using namespace governikus; +Q_DECLARE_METATYPE(QLatin1String) class test_ProviderParser : public QObject @@ -267,6 +268,96 @@ class test_ProviderParser } + void platformCount_data() + { + QTest::addColumn("count"); + + const int desktop = 64; + QTest::newRow("win") << desktop; + QTest::newRow("mac") << desktop; + QTest::newRow("linux") << desktop; + QTest::newRow("android") << desktop; + QTest::newRow("ios") << desktop; + } + + + void platformCount() + { + QFETCH(int, count); + + QByteArray data = TestFileHelper::readFile(QCoreApplication::applicationDirPath() + "/default-providers.json"); + QSharedPointer providerSettings = parser.parse(data, QLatin1String(QTest::currentDataTag())); + + QVERIFY(providerSettings); + QCOMPARE(providerSettings->getProviders().size(), count); + } + + + void checkExcludedPlatform_data() + { + QTest::addColumn("content"); + QTest::addColumn("currentOS"); + QTest::addColumn("excluded"); + + QTest::newRow("mobile") + << QByteArray(R"( ["mobile"] )") << QLatin1String("android") << true; + + QTest::newRow("android") + << QByteArray(R"( ["mac", "android"] )") << QLatin1String("android") << true; + + QTest::newRow("desktop_excluded_mac") + << QByteArray(R"( ["android", "desktop"] )") << QLatin1String("mac") << true; + + QTest::newRow("ios") + << QByteArray(R"( ["android", "desktop"] )") << QLatin1String("ios") << false; + + QTest::newRow("ios") + << QByteArray(R"( ["android", "win"] )") << QLatin1String("ios") << false; + + QTest::newRow("mobile_excluded") + << QByteArray(R"( ["win", "mobile"] )") << QLatin1String("android") << true; + + QTest::newRow("mobile_excluded") + << QByteArray(R"( ["mobile", "win"] )") << QLatin1String("ios") << true; + + QTest::newRow("win_excluded") + << QByteArray(R"( ["win"] )") << QLatin1String("win") << true; + + QTest::newRow("desktop_excluded_single") + << QByteArray(R"( ["desktop"] )") << QLatin1String("win") << true; + + QTest::newRow("win") + << QByteArray(R"( ["mac", "bla", "bsd", "linux", "mobile", "ios", "android"] )") << QLatin1String("win") << false; + + QTest::newRow("desktop_excluded_multi") + << QByteArray(R"( ["mac", "bla", "bsd", "linux", "desktop", "ios", "android"] )") << QLatin1String("win") << true; + + QTest::newRow("win_excluded") + << QByteArray(R"( ["mac", "bla", "dummy", "win"] )") << QLatin1String("win") << true; + + QTest::newRow("nothing") + << QByteArray(R"( [] )") << QLatin1String("win") << false; + } + + + void checkExcludedPlatform() + { + QFETCH(QByteArray, content); + QFETCH(QLatin1String, currentOS); + QFETCH(bool, excluded); + + const auto& doc = QJsonDocument::fromJson(content); + QVERIFY(!doc.isNull()); + QCOMPARE(ProviderParser::isExcludedPlatform(doc.array(), currentOS), excluded); + } + + + void checkExcludedPlatformEmpty() + { + QCOMPARE(ProviderParser::isExcludedPlatform(QJsonArray(), QLatin1String("ios")), false); + } + + }; QTEST_GUILESS_MAIN(test_ProviderParser) diff --git a/test/qt/settings/test_PreVerificationSettings.cpp b/test/qt/settings/test_PreVerificationSettings.cpp index 37ea9a2..625f91c 100644 --- a/test/qt/settings/test_PreVerificationSettings.cpp +++ b/test/qt/settings/test_PreVerificationSettings.cpp @@ -5,9 +5,9 @@ */ #include +#include "asn1/CVCertificate.h" #include "PreVerificationSettings.h" #include "TestFileHelper.h" -#include "asn1/CVCertificate.h" using namespace governikus; diff --git a/test/qt/websocket/test_UIPlugInWebSocket.cpp b/test/qt/websocket/test_UIPlugInWebSocket.cpp index bc04d03..94a66b0 100644 --- a/test/qt/websocket/test_UIPlugInWebSocket.cpp +++ b/test/qt/websocket/test_UIPlugInWebSocket.cpp @@ -7,10 +7,10 @@ #include "UIPlugInWebSocket.h" #include "WebSocketHelper.h" +#include #include #include #include -#include using namespace governikus;