Skip to content

Commit

Permalink
Set User-Agent for signing (#1301)
Browse files Browse the repository at this point in the history
IB-8023

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma authored Nov 18, 2024
1 parent 3c55a63 commit 54b781d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(CMAKE_AUTOMOC ON)
include( GNUInstallDirs )
include( VersionInfo )

find_package(LibDigiDocpp 4.0.0 REQUIRED)
find_package(LibDigiDocpp 4.1.0 REQUIRED)
find_package( LDAP REQUIRED )
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} 5.12.0 REQUIRED COMPONENTS Core Widgets Network PrintSupport Svg LinguistTools)
Expand Down
9 changes: 8 additions & 1 deletion client/DigiDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "Application.h"
#include "CheckConnection.h"
#include "Common.h"
#include "QPCSC.h"
#include "QSigner.h"
#include "SslCertificate.h"
#include "TokenData.h"
Expand Down Expand Up @@ -367,7 +369,7 @@ bool SDocumentModel::removeRow(int row)

try
{
doc->b->removeDataFile(row);
doc->b->removeDataFile(unsigned(row));
doc->modified = true;
emit removed(row);
return true;
Expand Down Expand Up @@ -688,6 +690,11 @@ bool DigiDoc::sign(const QString &city, const QString &state, const QString &zip
roles.push_back(to(role));
signer->setSignerRoles(roles);
signer->setProfile("time-stamp");
signer->setUserAgent(QStringLiteral("%1/%2 (%3) Devices: %4").arg(
QCoreApplication::applicationName(),
QCoreApplication::applicationVersion(),
Common::applicationOs(),
Common::drivers().join(',')).toUtf8().constData());
qApp->waitForTSL( fileName() );
digidoc::Signature *s = b->sign(signer);
return modified = waitFor([&] {
Expand Down

0 comments on commit 54b781d

Please sign in to comment.