Skip to content

Commit

Permalink
Remove test HOTP TOTP from configuration window #145
Browse files Browse the repository at this point in the history
Remove unused getCode slot. Possibly used with test code from configuration window

Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
  • Loading branch information
szszszsz committed Sep 20, 2016
1 parent 5955d05 commit 84613e2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 155 deletions.
21 changes: 0 additions & 21 deletions src/ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,16 +540,6 @@ MainWindow::MainWindow(StartUpParameter_tst *StartupInfo_st, QWidget *parent)

createIndicator();

if (FALSE == DebugWindowActive) {
ui->frame_6->setVisible(false);
ui->testHOTPButton->setVisible(false);
ui->testTOTPButton->setVisible(false);
ui->testsSpinBox->setVisible(false);
ui->testsSpinBox_2->setVisible(false);
ui->testsLabel->setVisible(false);
ui->testsLabel_2->setVisible(false);
}

initActionsForStick10();
initActionsForStick20();
initCommonActions();
Expand Down Expand Up @@ -3027,17 +3017,6 @@ int MainWindow::stick20SendCommand(uint8_t stick20Command, uint8_t *password) {
return (true);
}

void MainWindow::getCode(uint8_t slotNo) {
uint8_t result[18];

memset(result, 0, 18);
uint32_t code;

cryptostick->getCode(slotNo, currentTime / 30, currentTime, 30, result);
code = result[0] + (result[1] << 8) + (result[2] << 16) + (result[3] << 24);
code = code % 100000000;
}

void MainWindow::on_writeButton_clicked() {
int res;

Expand Down
4 changes: 2 additions & 2 deletions src/ui/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ public slots:
private slots:
void resizeMin();
void checkConnection();
void getCode(uint8_t slotNo);
void on_writeButton_clicked();

void on_writeButton_clicked();
void displayCurrentTotpSlotConfig(uint8_t slotNo);
void displayCurrentHotpSlotConfig(uint8_t slotNo);
void displayCurrentSlotConfig();
Expand Down
132 changes: 0 additions & 132 deletions ui/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -965,134 +965,6 @@
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_6">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<widget class="QLabel" name="label_20">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Tests</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<layout class="QVBoxLayout" name="verticalLayout_20">
<item>
<widget class="QLabel" name="testsLabel">
<property name="text">
<string>Number of tests:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="testsLabel_2">
<property name="text">
<string>HOTP counter:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QSpinBox" name="testsSpinBox">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>65536</number>
</property>
<property name="value">
<number>30</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="testsSpinBox_2">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>3</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="testHOTPButton">
<property name="text">
<string>Test HOTP</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="testTOTPButton">
<property name="text">
<string>Test TOTP</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
Expand Down Expand Up @@ -1406,10 +1278,6 @@
<tabstop>writeButton</tabstop>
<tabstop>enableUserPasswordCheckBox</tabstop>
<tabstop>deleteUserPasswordCheckBox</tabstop>
<tabstop>testsSpinBox</tabstop>
<tabstop>testsSpinBox_2</tabstop>
<tabstop>testHOTPButton</tabstop>
<tabstop>testTOTPButton</tabstop>
<tabstop>generalCancelButton</tabstop>
<tabstop>writeGeneralConfigButton</tabstop>
<tabstop>PWS_EditSlotName</tabstop>
Expand Down

0 comments on commit 84613e2

Please sign in to comment.