Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Raul Metsma <[email protected]>
  • Loading branch information
lauris71 and metsma authored Jul 29, 2024
1 parent 5826169 commit 60d9047
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/controller/command-handlers/authenticate.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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())},
};
}

Expand Down Expand Up @@ -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);

Expand Down
3 changes: 1 addition & 2 deletions src/controller/command-handlers/sign.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/controller/command-handlers/signauthutils.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/controller/command-handlers/signauthutils.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 60d9047

Please sign in to comment.