Commit c3b97feb authored by Jan Möbius's avatar Jan Möbius

Added override button to generate a license with an invalid request

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11085 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 2c7f1186
...@@ -58,6 +58,13 @@ ...@@ -58,6 +58,13 @@
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::ExpandingFieldsGrow</enum>
</property> </property>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Filename</string>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="fileNameBox"/> <widget class="QLineEdit" name="fileNameBox"/>
</item> </item>
...@@ -91,16 +98,6 @@ ...@@ -91,16 +98,6 @@
<item row="3" column="1"> <item row="3" column="1">
<widget class="QLineEdit" name="cpuHashBox"/> <widget class="QLineEdit" name="cpuHashBox"/>
</item> </item>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Filename</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="productIDBox"/>
</item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="label_11">
<property name="text"> <property name="text">
...@@ -108,6 +105,9 @@ ...@@ -108,6 +105,9 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1">
<widget class="QLineEdit" name="productIDBox"/>
</item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_12">
<property name="text"> <property name="text">
...@@ -118,6 +118,13 @@ ...@@ -118,6 +118,13 @@
<item row="5" column="1"> <item row="5" column="1">
<widget class="QLineEdit" name="signatureBox"/> <widget class="QLineEdit" name="signatureBox"/>
</item> </item>
<item row="6" column="1">
<widget class="QCheckBox" name="ignoreSigBox">
<property name="text">
<string>Ignore Invalid Signature</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
......
...@@ -85,7 +85,7 @@ void KeyGenWidget::slotAnalyze() { ...@@ -85,7 +85,7 @@ void KeyGenWidget::slotAnalyze() {
QString inputData = requestData->toPlainText(); QString inputData = requestData->toPlainText();
QStringList data = inputData.split('\n',QString::SkipEmptyParts); QStringList data = inputData.split('\n',QString::SkipEmptyParts);
// This is never avalid request! // This is never a valid request!
if ( data.size() < 6 ) { if ( data.size() < 6 ) {
QPalette p = requestData->palette(); QPalette p = requestData->palette();
...@@ -141,6 +141,7 @@ void KeyGenWidget::slotAnalyze() { ...@@ -141,6 +141,7 @@ void KeyGenWidget::slotAnalyze() {
signatureBox->setPalette(p); signatureBox->setPalette(p);
valid_ = false; valid_ = false;
if (! ignoreSigBox->isChecked() )
return; return;
} else { } else {
...@@ -171,6 +172,8 @@ void KeyGenWidget::slotAnalyze() { ...@@ -171,6 +172,8 @@ void KeyGenWidget::slotAnalyze() {
std::cerr << "Full license : \n" << license_.toStdString() << std::endl; std::cerr << "Full license : \n" << license_.toStdString() << std::endl;
// Only set valid, if the the request and the signature boxes match
if ( requestSig == requestSigCheck )
valid_ = true; valid_ = true;
licenseFileName_ = name; licenseFileName_ = name;
...@@ -194,11 +197,16 @@ KeyGenWidget::~KeyGenWidget() { ...@@ -194,11 +197,16 @@ KeyGenWidget::~KeyGenWidget() {
} }
void KeyGenWidget::slotGenerateButton() { void KeyGenWidget::slotGenerateButton() {
if ( ! valid_ ) { if ( ! valid_ ) {
std::cerr << "Invalid! " << std::endl; if ( ! ignoreSigBox->isChecked( ) ) {
std::cerr << "Invalid Request " << std::endl;
return; return;
} else {
std::cerr << "Invalid Request but overriding!!" << std::endl;
}
} }
std::cerr << "Writing License file to output : " << licenseFileName_.toStdString() << std::endl; std::cerr << "Writing License file to output : " << licenseFileName_.toStdString() << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment