Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/libelectronic-id
3 changes: 2 additions & 1 deletion src/controller/certandpininfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ struct EidCertificateAndPinInfo
QSslCertificate certificate {};
CertificateInfo certInfo;
PinInfo pinInfo;
bool cardActive = true;
bool pin1Active = true;
bool pin2Active = true;
};

Q_DECLARE_METATYPE(EidCertificateAndPinInfo)
21 changes: 13 additions & 8 deletions src/controller/command-handlers/certificatereader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace electronic_id;
namespace
{

EidCertificateAndPinInfo getCertificateWithStatusAndInfo(const ElectronicID::ptr& eid,
EidCertificateAndPinInfo getCertificateWithStatusAndInfo(ElectronicID::ptr&& eid,
const CertificateType certificateType)
{
const auto certificateBytes = eid->getCertificate(certificateType);
Expand Down Expand Up @@ -70,19 +70,23 @@ EidCertificateAndPinInfo getCertificateWithStatusAndInfo(const ElectronicID::ptr
info.maxRetry,
},
.readerHasPinPad = eid->smartcard().readerHasPinPad()};
bool cardActivated = info.pinActive;
bool pin1Active = true;
bool pin2Active = true;
if (certificateType == CertificateType::AUTHENTICATION && eid->type() == ElectronicID::EstEID
&& eid->name() == "EstEIDThales") {
cardActivated = eid->signingPinInfo().pinActive;
auto infoOther = certificateType.isAuthentication() ? eid->signingPinInfo() : eid->authPinInfo();
pin1Active = certificateType.isAuthentication() ? info.pinActive : infoOther.pinActive;
pin2Active = certificateType.isAuthentication() ? infoOther.pinActive : info.pinActive;
}

return {
.eid = eid,
.eid = std::move(eid),
.certificateBytesInDer = std::move(certificateDer),
.certificate = certificate,
.certInfo = std::move(certInfo),
.pinInfo = std::move(pinInfo),
.cardActive = cardActivated,
.pin1Active = pin1Active,
.pin2Active = pin2Active,
};
}

Expand All @@ -96,7 +100,7 @@ CertificateReader::CertificateReader(const CommandWithArguments& cmd) : CommandH
}
}

void CertificateReader::run(const std::vector<ElectronicID::ptr>& eids)
void CertificateReader::run(std::vector<ElectronicID::ptr>&& eids)
{
REQUIRE_NOT_EMPTY_CONTAINS_NON_NULL_PTRS(eids)

Expand All @@ -105,9 +109,10 @@ void CertificateReader::run(const std::vector<ElectronicID::ptr>& eids)

std::vector<EidCertificateAndPinInfo> certAndPinInfos;
certAndPinInfos.reserve(eids.size());
for (const auto& eid : eids) {
for (auto& eid : eids) {
try {
certAndPinInfos.push_back(getCertificateWithStatusAndInfo(eid, certificateType));
certAndPinInfos.push_back(
getCertificateWithStatusAndInfo(std::move(eid), certificateType));
} catch (const WrongCertificateTypeError&) {
// Ignore eIDs that don't support the given ceritifcate type.
}
Expand Down
2 changes: 1 addition & 1 deletion src/controller/command-handlers/certificatereader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CertificateReader : public CommandHandler
public:
explicit CertificateReader(const CommandWithArguments& cmd);

void run(const std::vector<electronic_id::ElectronicID::ptr>& eids) override;
void run(std::vector<electronic_id::ElectronicID::ptr>&& eids) override;
void connectSignals(const WebEidUI* window) override;

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/controller/commandhandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CommandHandler : public QObject
public:
using ptr = std::unique_ptr<CommandHandler>;

virtual void run(const std::vector<electronic_id::ElectronicID::ptr>& eids) = 0;
virtual void run(std::vector<electronic_id::ElectronicID::ptr>&& eids) = 0;
virtual void connectSignals(const WebEidUI* window) = 0;
virtual QVariantMap onConfirm(WebEidUI* window,
const EidCertificateAndPinInfo& certAndPinInfo) = 0;
Expand Down
1 change: 0 additions & 1 deletion src/controller/qeid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@

Q_DECLARE_METATYPE(electronic_id::AutoSelectFailed::Reason)
Q_DECLARE_METATYPE(electronic_id::ElectronicID::ptr)
Q_DECLARE_METATYPE(std::vector<electronic_id::ElectronicID::ptr>)
Q_DECLARE_METATYPE(electronic_id::VerifyPinFailed::Status)
2 changes: 1 addition & 1 deletion src/controller/threads/commandhandlerrunthread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CommandHandlerRunThread : public ControllerChildThread
}

private:
void doRun() override { commandHandler.run(eids); }
void doRun() override { commandHandler.run(std::move(eids)); }

CommandHandler& commandHandler;
std::vector<electronic_id::ElectronicID::ptr> eids;
Expand Down
3 changes: 2 additions & 1 deletion src/ui/languageselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ LanguageSelect::LanguageSelect(QWidget* parent) :
{
ui->setupUi(this);
if (Application::isDarkTheme()) {
if (QFile f(QStringLiteral(":dark-languageselect.qss")); f.open(QFile::ReadOnly | QFile::Text)) {
if (QFile f(QStringLiteral(":dark-languageselect.qss"));
f.open(QFile::ReadOnly | QFile::Text)) {
style()->unpolish(this);
setStyleSheet(styleSheet() + QTextStream(&f).readAll());
style()->polish(this);
Expand Down
10 changes: 5 additions & 5 deletions src/ui/translations/cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,13 @@
<translation>Operace se nezdařila</translation>
</message>
<message>
<source>PIN entry disabled</source>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>Zadávání PINu je zakázáno</translation>
</message>
<message>
<source>Card driver error. Please try again.</source>
<translation>Chyba ovladače karty. Zkuste to prosím znovu.</translation>
Expand Down Expand Up @@ -308,10 +312,6 @@
<comment>Active language</comment>
<translation>CS</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>Zadávání PINu je zakázáno.</translation>
</message>
<message>
<source>English</source>
<comment>Active language accessible</comment>
Expand Down
10 changes: 5 additions & 5 deletions src/ui/translations/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@
<translation>Der Vorgang ist fehlgeschlagen</translation>
</message>
<message>
<source>PIN entry disabled</source>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>PIN-Eingabe deaktiviert</translation>
</message>
<message>
<source>Card driver error. Please try again.</source>
<translation>Kartentreiberfehler. Bitte versuche es erneut.</translation>
Expand Down Expand Up @@ -306,10 +310,6 @@
<comment>Active language</comment>
<translation>DE</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>PIN-Eingabe deaktiviert.</translation>
</message>
<message>
<source>English</source>
<comment>Active language accessible</comment>
Expand Down
8 changes: 4 additions & 4 deletions src/ui/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@
<source>Operation failed</source>
<translation>Operation failed</translation>
</message>
<message>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</source>
<translation>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>PIN entry disabled</translation>
Expand Down Expand Up @@ -306,10 +310,6 @@
<comment>Active language</comment>
<translation>EN</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>PIN entry disabled</translation>
</message>
<message>
<source>English</source>
<comment>Active language accessible</comment>
Expand Down
10 changes: 5 additions & 5 deletions src/ui/translations/et.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,17 @@
<source>PinPad timed out waiting for customer interaction.</source>
<translation>PinPad lugeja toiming aegus.</translation>
</message>
<message>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</source>
<translation>ID-kaardiga isikutuvastamine ja allkirjastamine ei ole veel võimalik. ID-kaardi kasutamiseks tuleb see aktiveerida Politsei- ja Piirivalveameti iseteeninduses. &lt;a href=&quot;https://www.politsei.ee/et/iseteenindus&quot;&gt;Aktiveeri ID-kaart&lt;/a&gt;</translation>
</message>
<message>
<source>PIN entry cancelled.</source>
<translation>PIN-koodi sisestamine katkestati.</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation type="unfinished"></translation>
<translation>PIN&apos;i sisestamine on keelatud</translation>
</message>
<message>
<source>Launch the Smart Card service</source>
Expand Down Expand Up @@ -306,10 +310,6 @@
<comment>Active language</comment>
<translation>ET</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>PIN'i sisestamine on keelatud.</translation>
</message>
<message>
<source>English</source>
<comment>Active language accessible</comment>
Expand Down
10 changes: 5 additions & 5 deletions src/ui/translations/fi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,13 @@
<translation>Toiminto epäonnistui</translation>
</message>
<message>
<source>PIN entry disabled</source>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>PIN-koodin syöttö ei ole käytössä</translation>
</message>
<message>
<source>Card driver error. Please try again.</source>
<translation>Kortinlukijan virhe. Yritä uudelleen.</translation>
Expand Down Expand Up @@ -306,10 +310,6 @@
<comment>Active language</comment>
<translation>FI</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>PIN-koodin syöttö ei ole käytössä.</translation>
</message>
<message>
<source>English</source>
<comment>Active language accessible</comment>
Expand Down
10 changes: 5 additions & 5 deletions src/ui/translations/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@
<translation>L&apos;opération a échoué</translation>
</message>
<message>
<source>PIN entry disabled</source>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>Saisie du code PIN désactivée</translation>
</message>
<message>
<source>Card driver error. Please try again.</source>
<translation>Erreur de pilote de carte. Veuillez réessayer.</translation>
Expand Down Expand Up @@ -306,10 +310,6 @@
<comment>Active language</comment>
<translation>FR</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>Saisie du code PIN désactivée.</translation>
</message>
<message>
<source>English</source>
<comment>Active language accessible</comment>
Expand Down
10 changes: 5 additions & 5 deletions src/ui/translations/hr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,13 @@
</translation>
</message>
<message>
<source>PIN entry disabled</source>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>Unos PIN-a onemogućen</translation>
</message>
<message>
<source>PIN is locked. Unblock and try again.</source>
<translation>PIN je zaključan. Odblokirajte ga i pokušajte ponovo.</translation>
Expand Down Expand Up @@ -308,10 +312,6 @@
<comment>Active language</comment>
<translation>HR</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>Unos PIN-a onemogućen.</translation>
</message>
<message>
<source>English</source>
<comment>Active language accessible</comment>
Expand Down
10 changes: 5 additions & 5 deletions src/ui/translations/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@
<translation>Bewerking mislukt</translation>
</message>
<message>
<source>PIN entry disabled</source>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>PIN-invoer uitgeschakeld</translation>
</message>
<message>
<source>Card driver error. Please try again.</source>
<translation>Fout met kaartstuurprogramma. Probeer het opnieuw.</translation>
Expand Down Expand Up @@ -306,10 +310,6 @@
<comment>Active language</comment>
<translation>NL</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>PIN-invoer uitgeschakeld.</translation>
</message>
<message>
<source>English</source>
<comment>Active language accessible</comment>
Expand Down
10 changes: 5 additions & 5 deletions src/ui/translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,13 @@
<source>Operation failed</source>
<translation>Операция не удалась</translation>
</message>
<message>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</source>
<translation>Идентификация и подписание документов с помощью ID карты пока невозможны. Для использования удостоверения личности его необходимо активировать в системе самообслуживания Управления полиции и пограничной охраны. &lt;a href=&quot;https://www.politsei.ee/ru/samoobsluzhivanie&quot;&gt;Активировать ID карту&lt;/a&gt;</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation type="unfinished"></translation>
<translation>Ввод PIN запрещён</translation>
</message>
<message>
<source>Card driver error. Please try again.</source>
Expand Down Expand Up @@ -308,10 +312,6 @@
<comment>Active language</comment>
<translation>RU</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>Ввод PIN запрещён.</translation>
</message>
<message>
<source>English</source>
<comment>Active language accessible</comment>
Expand Down
10 changes: 5 additions & 5 deletions src/ui/translations/sk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,13 @@
<translation>Operácia zlyhala</translation>
</message>
<message>
<source>PIN entry disabled</source>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it. &lt;a href=&quot;https://www.politsei.ee/en/self-service-portal&quot;&gt;Activate ID-card&lt;/a&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>Zadávanie PIN je zakázané</translation>
</message>
<message>
<source>Card driver error. Please try again.</source>
<translation>Chyba ovládača karty. Skúste to prosím znova.</translation>
Expand Down Expand Up @@ -308,10 +312,6 @@
<comment>Active language</comment>
<translation>SK</translation>
</message>
<message>
<source>PIN entry disabled</source>
<translation>Zadávanie PIN je zakázané.</translation>
</message>
<message>
<source>English</source>
<comment>Active language accessible</comment>
Expand Down
Loading