Skip to content

Commit

Permalink
Fix compilation warnings (1)
Browse files Browse the repository at this point in the history
Fixes #235

Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
  • Loading branch information
szszszsz committed Mar 31, 2017
1 parent e223678 commit d687c07
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion libnitrokey
4 changes: 2 additions & 2 deletions src/hotpslot.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ class OTPSlot {
~OTPSlot(){
volatile char* p;
p = slotName;
for (int i = 0; i < sizeof(slotName); ++i) {
for (uint64_t i = 0; i < sizeof(slotName); ++i) {
p[i] = 0;
}
p = secret;
for (int i = 0; i < sizeof(secret); ++i) {
for (uint64_t i = 0; i < sizeof(secret); ++i) {
p[i] = 0;
}
slotNumber = 0;
Expand Down
16 changes: 10 additions & 6 deletions src/ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ using nm = nitrokey::NitrokeyManager;
static const QString communication_error_message = QApplication::tr("Communication error. Please reinsert the device.");


MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow),
clipboard(this), auth_admin(this, Authentication::Type::ADMIN),
auth_user(this, Authentication::Type::USER), storage(this, &auth_admin, &auth_user),
tray(this, false, true, &storage),
HOTP_SlotCount(HOTP_SLOT_COUNT), TOTP_SlotCount(TOTP_SLOT_COUNT)
MainWindow::MainWindow(QWidget *parent):
QMainWindow(parent),
ui(new Ui::MainWindow),
clipboard(this),
auth_admin(this, Authentication::Type::ADMIN),
auth_user(this, Authentication::Type::USER),
storage(this, &auth_admin, &auth_user),
tray(this, false, true, &storage),
HOTP_SlotCount(HOTP_SLOT_COUNT),
TOTP_SlotCount(TOTP_SLOT_COUNT)
{

progress_window = std::make_shared<Stick20ResponseDialog>();
Expand Down
11 changes: 5 additions & 6 deletions src/ui/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,23 @@ public :
private:
Q_DISABLE_COPY(MainWindow);

Ui::MainWindow *ui;
Clipboard clipboard;
Authentication auth_admin;
Authentication auth_user;
StorageActions storage;
Tray tray;
Clipboard clipboard;
const unsigned char HOTP_SlotCount;
const unsigned char TOTP_SlotCount;


bool validate_secret(const char *secret) const;
void initialTimeReset();
QMutex check_connection_mutex;
QString nkpro_user_PIN;

void startDebug();
QTimer *keepDeviceOnlineTimer;

Ui::MainWindow *ui;

const unsigned char HOTP_SlotCount;
const unsigned char TOTP_SlotCount;

bool PWS_Access = false;
const int PWS_CreatePWSize = 20;
Expand Down
5 changes: 3 additions & 2 deletions src/ui/pindialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@

#define LOCAL_PASSWORD_SIZE 40 // Todo make define global

PinDialog::PinDialog(PinType pinType, QWidget *parent)
: _pinType(pinType), QDialog(parent)
PinDialog::PinDialog(PinType pinType, QWidget *parent):
QDialog(parent),
_pinType(pinType)
{
ui = std::make_shared<Ui::PinDialog>();
ui->setupUi(this);
Expand Down
8 changes: 5 additions & 3 deletions src/ui/stick20changepassworddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
#include "src/core/ThreadWorker.h"
using nm = nitrokey::NitrokeyManager;

DialogChangePassword::DialogChangePassword(QWidget *parent, PasswordKind _kind)
: QDialog(parent), ui(new Ui::DialogChangePassword), kind(_kind) {
DialogChangePassword::DialogChangePassword(QWidget *parent, PasswordKind _kind):
QDialog(parent),
ui(new Ui::DialogChangePassword),
kind(_kind)
{
ui->setupUi(this);

ui->lineEdit_OldPW->setEchoMode(QLineEdit::Password);
Expand All @@ -50,7 +53,6 @@ DialogChangePassword::~DialogChangePassword() { delete ui; }

void DialogChangePassword::UpdatePasswordRetry() {
QString noTrialsLeft;
int retryCount = 99;
// update password retry values

switch (kind) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/stick20changepassworddialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ private slots:
void on_checkBox_clicked(bool checked);

private:
PasswordKind kind;
Ui::DialogChangePassword *ui;
PasswordKind kind;
void _changePassword();
void accept(void) override;
void UpdatePasswordRetry(void);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/stick20debugdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ DebugDialog::~DebugDialog() {
*******************************************************************************/

void DebugDialog::UpdateDebugText() {
static int nCallCounter = 0;
// static int nCallCounter = 0;

// if (TRUE == DebugingStick20PoolingActive) {
// Send request
Expand Down

0 comments on commit d687c07

Please sign in to comment.