-
Notifications
You must be signed in to change notification settings - Fork 0
/
stick20infodialog.cpp
147 lines (109 loc) · 4.74 KB
/
stick20infodialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
* Author: Copyright (C) Rudolf Boeddeker Date: 2013-08-13
*
* This file is part of GPF Crypto Stick 2
*
* GPF Crypto Stick 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* GPF Crypto Stick is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GPF Crypto Stick. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stick20infodialog.h"
#include "ui_stick20infodialog.h"
#include "stick20hid.h"
Stick20InfoDialog::Stick20InfoDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Stick20InfoDialog)
{
ui->setupUi(this);
showStick20Configuration ();
}
Stick20InfoDialog::~Stick20InfoDialog()
{
delete ui;
}
/*******************************************************************************
showStick20Configuration
Changes
Date Author Info
17.04.14 RB Function created
Reviews
Date Reviewer Info
*******************************************************************************/
void Stick20InfoDialog::showStick20Configuration (void)
{
QString OutputText;
OutputText.append(QString("Crypto Stick Storage status\n\n"));
if (TRUE == HID_Stick20Configuration_st.StickKeysNotInitiated)
{
OutputText.append(QString(" *** Warning: Device is not secure ***")).append("\n");
OutputText.append(QString(" *** Select -Init keys- ***")).append("\n").append("\n");
}
OutputText.append(QString("Firmware version "));
OutputText.append(QString("%1").arg(QString::number(HID_Stick20Configuration_st.VersionInfo_au8[0])));
OutputText.append(QString("."));
OutputText.append(QString("%1").arg(QString::number(HID_Stick20Configuration_st.VersionInfo_au8[1])));
OutputText.append(QString("\n"));
if (TRUE == HID_Stick20Configuration_st.FirmwareLocked_u8)
{
OutputText.append(QString("*** Firmware is locked *** ")).append("\n");
}
if (READ_WRITE_ACTIVE == HID_Stick20Configuration_st.ReadWriteFlagUncryptedVolume_u8)
{
OutputText.append(QString("Unencrypted volume READ/WRITE mode ")).append("\n");
}
else
{
OutputText.append(QString("Unencrypted volume READ ONLY mode ")).append("\n");
}
if (0 != (HID_Stick20Configuration_st.VolumeActiceFlag_u8 & (1 << SD_CRYPTED_VOLUME_BIT_PLACE)))
{
OutputText.append(QString("Encrypted volume active")).append("\n");
}
else
{
OutputText.append(QString("Encrypted volume not active")).append("\n");
}
if (0 != (HID_Stick20Configuration_st.VolumeActiceFlag_u8 & (1 << SD_HIDDEN_VOLUME_BIT_PLACE)))
{
OutputText.append(QString("Hidden volume active")).append("\n");
}
OutputText.append(QString("SD change counter "));
OutputText.append(QString("%1").arg(QString::number(HID_Stick20Configuration_st.NewSDCardFound_u8 >> 1))).append("\n");
OutputText.append(QString("SD erase counter "));
OutputText.append(QString("%1").arg(QString::number(HID_Stick20Configuration_st.SDFillWithRandomChars_u8 >> 1))).append("\n");
OutputText.append(QString("\n"));
OutputText.append(QString("SD card info\n"));
OutputText.append(QString(" ID 0x"));
OutputText.append(QString("%1").arg(QString::number(HID_Stick20Configuration_st.ActiveSD_CardID_u32,16))).append("\n");
if (0 != (HID_Stick20Configuration_st.NewSDCardFound_u8 & 0x01))
{
// OutputText.append(QString(" *** New SD card found ***\n"));
}
if (0 == (HID_Stick20Configuration_st.SDFillWithRandomChars_u8 & 0x01))
{
OutputText.append(QString(" *** Storage is not initialized with random data ***\n"));
}
OutputText.append(QString("\n"));
OutputText.append(QString("Smartcard info\n"));
OutputText.append(QString(" ID 0x"));
OutputText.append(QString("%1").arg(QString::number(HID_Stick20Configuration_st.ActiveSmartCardID_u32,16))).append("\n");
OutputText.append(QString(" Password retry counter\n"));
OutputText.append(QString(" Admin : "));
OutputText.append(QString("%1").arg(QString::number(HID_Stick20Configuration_st.AdminPwRetryCount))).append("\n");
OutputText.append(QString(" User : "));
OutputText.append(QString("%1").arg(QString::number(HID_Stick20Configuration_st.UserPwRetryCount))).append("\n");
ui->Infotext->setText(OutputText);
}
void Stick20InfoDialog::on_pushButton_clicked()
{
done(true);
}