From 60d904717f8c1d2860b3d0ee6ba2b5c34c6e0283 Mon Sep 17 00:00:00 2001 From: lauris71 Date: Mon, 29 Jul 2024 15:02:14 +0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Raul Metsma --- src/controller/command-handlers/authenticate.cpp | 8 ++++---- src/controller/command-handlers/sign.cpp | 3 +-- src/controller/command-handlers/signauthutils.cpp | 2 +- src/controller/command-handlers/signauthutils.hpp | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/controller/command-handlers/authenticate.cpp b/src/controller/command-handlers/authenticate.cpp index 5b6c8f8a..b5287678 100644 --- a/src/controller/command-handlers/authenticate.cpp +++ b/src/controller/command-handlers/authenticate.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023 Estonian Information System Authority + * Copyright (c) 2020-2024 Estonian Information System Authority * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -52,7 +52,7 @@ QVariantMap createAuthenticationToken(const QString& signatureAlgorithm, {"format", QStringLiteral("web-eid:1.0")}, {"appVersion", QStringLiteral("https://web-eid.eu/web-eid-app/releases/%1") - .arg(qApp->applicationVersion())}, + .arg(QApplication::applicationVersion())}, }; } @@ -81,8 +81,8 @@ QByteArray createSignature(const QString& origin, const QString& challengeNonce, // The value that is signed is hash(origin)+hash(challenge). const auto hashToBeSignedQBytearray = QCryptographicHash::hash(originHash + challengeNonceHash, hashAlgo); - const auto hashToBeSigned = - pcsc_cpp::byte_vector {hashToBeSignedQBytearray.cbegin(), hashToBeSignedQBytearray.cend()}; + const pcsc_cpp::byte_vector hashToBeSigned {hashToBeSignedQBytearray.cbegin(), + hashToBeSignedQBytearray.cend()}; const auto signature = eid.signWithAuthKey(pin, hashToBeSigned); diff --git a/src/controller/command-handlers/sign.cpp b/src/controller/command-handlers/sign.cpp index f808a353..a56143dd 100644 --- a/src/controller/command-handlers/sign.cpp +++ b/src/controller/command-handlers/sign.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023 Estonian Information System Authority + * Copyright (c) 2020-2024 Estonian Information System Authority * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -110,7 +110,6 @@ QVariantMap Sign::onConfirm(WebEidUI* window, const CardCertificateAndPinInfo& c {QStringLiteral("signatureAlgorithm"), signature.second}}; } catch (const VerifyPinFailed& failure) { - switch (failure.status()) { case electronic_id::VerifyPinFailed::Status::PIN_ENTRY_CANCEL: case electronic_id::VerifyPinFailed::Status::PIN_ENTRY_TIMEOUT: diff --git a/src/controller/command-handlers/signauthutils.cpp b/src/controller/command-handlers/signauthutils.cpp index 0782513c..6b525e16 100644 --- a/src/controller/command-handlers/signauthutils.cpp +++ b/src/controller/command-handlers/signauthutils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023 Estonian Information System Authority + * Copyright (c) 2020-2024 Estonian Information System Authority * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/controller/command-handlers/signauthutils.hpp b/src/controller/command-handlers/signauthutils.hpp index 52f894ae..d18e26d2 100644 --- a/src/controller/command-handlers/signauthutils.hpp +++ b/src/controller/command-handlers/signauthutils.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023 Estonian Information System Authority + * Copyright (c) 2020-2024 Estonian Information System Authority * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal