Skip to content
Merged
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
30 changes: 16 additions & 14 deletions client/CryptoDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,20 +431,22 @@ bool CryptoDoc::encrypt(const QString &filename, const QString& label, const QBy
if ((d->version == 2) && Settings::CDOC2_USE_KEYSERVER) {
keyserver_id = Settings::CDOC2_DEFAULT_KEYSERVER;
}
// Encrypt for address list
for (const auto &key : d->keys) {
if (!key.rcpt_cert.isNull()) {
QByteArray ba = key.rcpt_cert.toDer();
enc_keys.push_back(libcdoc::Recipient::makeCertificate({}, {ba.cbegin(), ba.cend()}, keyserver_id));
} else {
switch (key.lock.type) {
case libcdoc::Lock::CDOC1:
case libcdoc::Lock::PUBLIC_KEY:
case libcdoc::Lock::SERVER:
enc_keys.push_back(libcdoc::Recipient::makePublicKey(key.lock, keyserver_id));
break;
default:
break;
// Encrypt for address list, password encryption excludes recipients
if (secret.isEmpty()) {
for (const auto &key : d->keys) {
if (!key.rcpt_cert.isNull()) {
QByteArray ba = key.rcpt_cert.toDer();
enc_keys.push_back(libcdoc::Recipient::makeCertificate({}, {ba.cbegin(), ba.cend()}, keyserver_id));
} else {
switch (key.lock.type) {
case libcdoc::Lock::CDOC1:
case libcdoc::Lock::PUBLIC_KEY:
case libcdoc::Lock::SERVER:
enc_keys.push_back(libcdoc::Recipient::makePublicKey(key.lock, keyserver_id));
break;
default:
break;
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion client/common_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ enum Actions : unsigned char {
ContainerEncrypt,

EncryptContainer,
EncryptLT,
EncryptContainerSuccess,
DecryptContainer,
DecryptContainerSuccess,
Expand Down
5 changes: 3 additions & 2 deletions client/dialogs/PasswordDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ PasswordDialog::PasswordDialog(Mode mode, QWidget *parent)
ui->password2Line->setHidden(mode == Mode::DECRYPT);
ui->password2Error->hide();
if(mode == DECRYPT) {
ui->title->setText(tr("Decrypt with password"));
ui->passwordLabel->setText(tr("Enter password to decrypt the document"));
ui->title->setText(tr("Decrypt"));
ui->labelLabel->setText(tr("Envelope name"));
ui->passwordLabel->setText(tr("Envelope password"));
ui->ok->setText(tr("Decrypt"));
ui->passwordLine->setFocus();
}
Expand Down
62 changes: 37 additions & 25 deletions client/dialogs/PasswordDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ font-size: 16px;
QLineEdit[label="error"] {
border-color: #BE7884;
}
QLineEdit[readOnly="true"] {
border: none;
padding: 0px;
background-color: transparent;
font-weight: 700;
}
QLineEdit::disabled {
color: #607496;
background-color: #F3F5F7;
Expand Down Expand Up @@ -114,30 +120,6 @@ margin-left: 6px;
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="labelLayout">
<item>
<widget class="QLabel" name="labelLabel">
<property name="text">
<string>Key label (recipient name or id)</string>
</property>
<property name="buddy">
<cstring>labelLine</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="labelLine">
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="infoWidget" native="true">
<layout class="QHBoxLayout" name="infoWidgetLayout" stretch="0,1">
Expand Down Expand Up @@ -174,6 +156,36 @@ margin-left: 6px;
</layout>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="labelLayout">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="labelLabel">
<property name="text">
<string>Create a name for the envelope</string>
</property>
<property name="buddy">
<cstring>labelLine</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="labelLine">
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
<property name="placeholderText">
<string>E.g. Contracts</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="passwordLayout">
<property name="spacing">
Expand All @@ -182,7 +194,7 @@ margin-left: 6px;
<item>
<widget class="QLabel" name="passwordLabel">
<property name="text">
<string>Enter a password to encrypt the document</string>
<string>Create a password for the envelope</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
Expand Down
3 changes: 3 additions & 0 deletions client/images/icon_check_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<file>icon_checkbox_active.svg</file>
<file>icon_checkbox_disabled.svg</file>
<file>icon_checkbox_hover.svg</file>
<file>icon_check_white.svg</file>
<file>icon_checkbox_check.svg</file>
<file>icon_checkbox_check_active.svg</file>
<file>icon_checkbox_check_disabled.svg</file>
Expand Down
50 changes: 30 additions & 20 deletions client/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,14 @@
<source>DigiDoc4 Client</source>
<translation>DigiDoc4 Client</translation>
</message>
<message>
<source>Encrypt for recipients</source>
<translation>Encrypt for recipients</translation>
</message>
<message>
<source>Encrypt with password</source>
<translation>Encrypt with password</translation>
</message>
<message>
<source>Decrypting</source>
<translation>Decrypting</translation>
Expand Down Expand Up @@ -529,6 +537,10 @@
<source>Change</source>
<translation>Change</translation>
</message>
<message>
<source>Password encryption is meant for long-term storage. The password cannot be changed or recovered.</source>
<translation>Password encryption is meant for long-term storage. The password cannot be changed or recovered.</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancel</translation>
Expand Down Expand Up @@ -1316,12 +1328,6 @@ LDAP server is unavailable.</translation>
<source>Sign</source>
<translation>Sign</translation>
</message>
<message>
<source>Encrypt
long-term</source>
<translation>Encrypt
long-term</translation>
</message>
</context>
<context>
<name>MainWindow</name>
Expand Down Expand Up @@ -1714,16 +1720,24 @@ long-term</translation>
<source>Encrypt with password</source>
<translation>Encrypt with password</translation>
</message>
<message>
<source>Key label (recipient name or id)</source>
<translation>Key label (recipient name or id)</translation>
</message>
<message>
<source>Be sure to save the password in a secure place
- without the password, you won’t be able to open the file again.</source>
<translation>Be sure to save the password in a secure place
- without the password, you won’t be able to open the file again.</translation>
</message>
<message>
<source>Create a name for the envelope</source>
<translation>Create a name for the envelope</translation>
</message>
<message>
<source>E.g. Contracts</source>
<translation>E.g. Contracts</translation>
</message>
<message>
<source>Create a password for the envelope</source>
<translation>Create a password for the envelope</translation>
</message>
<message>
<source>• Length: 20–64 characters
• Contains at least one number (0–9)
Expand All @@ -1747,16 +1761,16 @@ long-term</translation>
<translation>Encrypt</translation>
</message>
<message>
<source>Decrypt with password</source>
<translation>Decrypt with password</translation>
<source>Decrypt</source>
<translation>Decrypt</translation>
</message>
<message>
<source>Enter password to decrypt the document</source>
<translation>Enter password to decrypt the document</translation>
<source>Envelope name</source>
<translation>Envelope name</translation>
</message>
<message>
<source>Decrypt</source>
<translation>Decrypt</translation>
<source>Envelope password</source>
<translation>Envelope password</translation>
</message>
<message>
<source>Password is empty</source>
Expand All @@ -1770,10 +1784,6 @@ long-term</translation>
<source>Passwords do not match</source>
<translation>Passwords do not match</translation>
</message>
<message>
<source>Enter a password to encrypt the document</source>
<translation>Enter a password to encrypt the document</translation>
</message>
</context>
<context>
<name>PinPopup</name>
Expand Down
52 changes: 31 additions & 21 deletions client/translations/et.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,14 @@
<source>DigiDoc4 Client</source>
<translation>DigiDoc4 klient</translation>
</message>
<message>
<source>Encrypt for recipients</source>
<translation>Krüpteeri adressaadi alusel</translation>
</message>
<message>
<source>Encrypt with password</source>
<translation>Krüpteeri parooliga</translation>
</message>
<message>
<source>Decrypting</source>
<translation>Dekrüpteerin</translation>
Expand Down Expand Up @@ -529,6 +537,10 @@
<source>Change</source>
<translation>Muuda</translation>
</message>
<message>
<source>Password encryption is meant for long-term storage. The password cannot be changed or recovered.</source>
<translation>Parooliga krüpteerimine on mõeldud pikaajaliseks salvestamiseks. Parooli ei saa muuta ega taastada.</translation>
</message>
<message>
<source>Cancel</source>
<translation>Katkesta</translation>
Expand Down Expand Up @@ -1316,12 +1328,6 @@ LDAP serveriga ei saa ühendust.</translation>
<source>Sign</source>
<translation>Allkirjasta</translation>
</message>
<message>
<source>Encrypt
long-term</source>
<translation>Krüpteeri
säilitamiseks</translation>
</message>
</context>
<context>
<name>MainWindow</name>
Expand Down Expand Up @@ -1714,16 +1720,24 @@ säilitamiseks</translation>
<source>Encrypt with password</source>
<translation>Krüpteeri parooliga</translation>
</message>
<message>
<source>Key label (recipient name or id)</source>
<translation>Võtme nimi (saaja nimi või kood)</translation>
</message>
<message>
<source>Be sure to save the password in a secure place
- without the password, you won’t be able to open the file again.</source>
<translation>Salvesta parool kindlasti turvalisse kohta
- ilma paroolita ei saa faili enam avada.</translation>
</message>
<message>
<source>Create a name for the envelope</source>
<translation>Loo ümbrikule nimi</translation>
</message>
<message>
<source>E.g. Contracts</source>
<translation>Nt. Lepingud</translation>
</message>
<message>
<source>Create a password for the envelope</source>
<translation>Loo ümbrikule parool</translation>
</message>
<message>
<source>• Length: 20–64 characters
• Contains at least one number (0–9)
Expand All @@ -1747,16 +1761,16 @@ säilitamiseks</translation>
<translation>Krüpteeri</translation>
</message>
<message>
<source>Decrypt with password</source>
<translation>Dekrüpteeri parooliga</translation>
<source>Decrypt</source>
<translation>Dekrüpteeri</translation>
</message>
<message>
<source>Enter password to decrypt the document</source>
<translation>Sisestage parool dokumendi dekrüpteerimiseks</translation>
<source>Envelope name</source>
<translation>Ümbriku nimi</translation>
</message>
<message>
<source>Decrypt</source>
<translation>Dekrüpteeri</translation>
<source>Envelope password</source>
<translation>Ümbriku parool</translation>
</message>
<message>
<source>Password is empty</source>
Expand All @@ -1768,11 +1782,7 @@ säilitamiseks</translation>
</message>
<message>
<source>Passwords do not match</source>
<translation>Paroolid ei ühti</translation>
</message>
<message>
<source>Enter a password to encrypt the document</source>
<translation>Loo ümbrikule parool</translation>
<translation>Paroolid ei kattu</translation>
</message>
</context>
<context>
Expand Down
Loading
Loading