Commit 6c0ce95a authored by Klas Lindfors's avatar Klas Lindfors

Imported Upstream version 3.1.8

parent d8bcf3c8
2013-03-18 Klas Lindfors <klas@yubico.com>
* NEWS: release 3.1.8
2013-03-15 Klas Lindfors <klas@yubico.com>
* src/ui/oathpage.cpp, src/ui/oathpage.h: correctly add the MUI part
to public id for oath fixes #12 broken in 5fa2fb7 and released in 3.1.3..
2013-03-14 Klas Lindfors <klas@yubico.com>
* NEWS, YKPersonalization.pro, src/version.h: bump versions
post-release
2013-03-14 Klas Lindfors <klas@yubico.com>
* build-homepage.sh: no -e for homepage build
2013-03-14 Klas Lindfors <klas@yubico.com>
* NEWS: release 3.1.7
2013-03-14 Klas Lindfors <klas@yubico.com>
* src/ui/otppage.cpp: switch to using fromLocalFile() to construct
instead of specing file://
2013-03-14 Klas Lindfors <klas@yubico.com>
* NEWS: NEWS for 3.1.7
2013-03-13 Klas Lindfors <klas@yubico.com>
* README: LED_INV didn't appear until version 1.12
2013-03-13 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/settingpage.cpp, src/ui/settingpage.ui,
src/yubikeyconfig.cpp, src/yubikeyconfig.h, src/yubikeyfinder.cpp,
src/yubikeyfinder.h, src/yubikeywriter.cpp: move around and add
LED_INV support
2013-03-11 Klas Lindfors <klas@yubico.com>
* src/ui/oathpage.cpp, src/ui/oathpage.h: cleanup, remove unused
stuff m_pubIdFormat was never read, calls to update...() didn't have any
effect.
2013-03-11 Klas Lindfors <klas@yubico.com>
* src/ui/oathpage.cpp: drop commented code
2013-03-11 Klas Lindfors <klas@yubico.com>
* src/ui/oathpage.cpp: fixup entering of MUI contained code that overwrote the bounds of m_pubid and did other
unnecessary things. Fixes #11
2013-02-28 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/otppage.cpp, src/ui/otppage.h: change around
so we don't send the uploaded key as a GET instead write a temp file with an auto-submitting form that does a
POST to upload.yubico.com
2013-02-26 Klas Lindfors <klas@yubico.com>
* src/ui/staticpage.ui: add a + to indicate that it's version 2.2
and later
2013-02-21 Klas Lindfors <klas@yubico.com>
* NEWS, YKPersonalization.pro, src/version.h: bump versions
post-release
2013-02-21 Klas Lindfors <klas@yubico.com>
* NEWS: news for override box
2013-02-21 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/confirmbox.cpp, src/ui/toolpage.cpp: make the
override box on ndef without http work
2013-02-21 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: point to rcc for win32 build
2013-02-21 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: declare that we use exceptions
2013-02-21 Klas Lindfors <klas@yubico.com>
* NEWS: release 3.1.6
2013-02-18 Klas Lindfors <klas@yubico.com>
* src/yubikeywriter.cpp: only set imf if the key is capable of it
2013-02-18 Dain Nilsson <dain@yubico.com>
* src/yubikeyfinder.cpp: Fixed memory leak introduced in last
commit.
2013-02-08 Dain Nilsson <dain@yubico.com>
* src/yubikeyfinder.cpp: Only lock the YubiKey when we have window
focus.
2013-01-10 Klas Lindfors <klas@yubico.com>
* NEWS, YKPersonalization.pro, src/version.h: bump versions after
release
2013-01-10 Klas Lindfors <klas@yubico.com>
* NEWS: release 3.1.5
......
yubikey-personalization-gui NEWS -- History of user-visible changes. -*- outline -*-
* Version 3.1.8 (released 2013-03-18)
** Fix programming of OATH MUI
Identifier was never added to the token, broken since release 3.1.3.
* Version 3.1.7 (released 2013-03-14)
** Try to make some version dependencies in the GUI clearer.
** Change around the "Upload to Yubico" feature:
It used to spawn a web browser with a standard URL with all fields, instead
write down a html page with a self-submitting POST form to a temp directory
and point the web browser at that.
** Fixup entering of OATH MUI.
** Add support for new YubiKey feature: Inversed LED, appearing in firmware
2.4 and 3.1.
* Version 3.1.6 (released 2013-02-21)
** Only lock the key when window has focus.
** Fix OATH configuration for 2.1 keys.
** Make the override box on the http warning for NDEF work.
* Version 3.1.5 (released 2013-01-10)
** Fixup building on osx.
......
......@@ -47,7 +47,7 @@ directory:
Dependencies
------------
yubikey-personalization-gui depends on version 1.11.0 or higher of
yubikey-personalization-gui depends on version 1.12.0 or higher of
libykpers.
When building on Windows you will need binary releases of libykpers
......
#
# global definitions
#
VERSION = "3.1.5"
VERSION = "3.1.8"
APP_NAME = $$quote(YubiKey Personalization Tool)
#
......@@ -14,6 +14,8 @@ TARGET = yubikey-personalization-gui
DEFINES += VERSION=\\\"$${VERSION}\\\"
CONFIG += exceptions
CONFIG += silent
CONFIG(debug, debug|release) {
......@@ -137,6 +139,7 @@ cross {
QMAKE_MOC = $$[QT_INSTALL_BINS]/moc
QMAKE_UIC = $$[QT_INSTALL_BINS]/uic
QMAKE_IDC = $$[QT_INSTALL_BINS]/idc
QMAKE_RCC = $$[QT_INSTALL_BINS]/rcc
QMAKE_LFLAGS += -static-libstdc++ -static-libgcc
}
......
#!/bin/sh
set -e
README_FILE=`mktemp '/tmp/README.XXXXXX'`
NEWS_FILE=`mktemp '/tmp/NEWS.XXXXXX'`
......
......@@ -64,7 +64,7 @@ typedef std::vector<int>::size_type size_t;
#define OUT_CHAR_RATE_SLOWDOWN_60 3
#define SUPPORT_EMAIL tr("mailto:support@yubico.com")
#define UPLOAD_URL tr("https://upload.yubico.com/?serial=%1&prefix=%2&uid=%3&aeskey=%4")
#define UPLOAD_URL tr("<!doctype html><html><title>upload</title></head><body><form action='https://upload.yubico.com/' method='post' id='upload'>serial:<input name='serial' value='%1'/><br/>prefix:<input name='prefix' value='%2'/><br/>uid:<input name='uid' value='%3'/><br/>aeskey:<input name='aeskey' value='%4'/><br/><input type='submit'/><br/></form><script type='text/javascript'>window.onload=function(){document.getElementById('upload').submit();}</script></body></html>")
//Timeouts
......@@ -163,10 +163,12 @@ typedef std::vector<int>::size_type size_t;
#define SG_ALLOW_UPDATE "Flag/AllowUpdate"
#define SG_FAST_TRIG "Flag/FastTrig"
#define SG_USE_NUMERIC_KEYPAD "Flag/UseNumericKeypad"
#define SG_LED_INVERT "Flag/LedInvert"
#define SG_OVERWRITE_CONF_SLOT1 "DontAsk/Slot1Overwriting"
#define SG_DIFF_PUBLIC_ID_LEN "DontAsk/PublicIdLen"
#define SG_ENABLE_CONF_PROTECTION "DontAsk/ConfProtection"
#define SG_NDEF_WITHOUT_HTTP "DontAsk/NdefWithoutHttp"
#define SG_ANIMATIONS_PREFERENCE "Preference/Animations"
......
......@@ -96,5 +96,9 @@ void ConfirmBox::on_dontaskCheck_stateChanged(int state) {
case Confirm_ConfigurationProtection:
settings.setValue(SG_ENABLE_CONF_PROTECTION, checked);
break;
case Confirm_NdefWithoutHttp:
settings.setValue(SG_NDEF_WITHOUT_HTTP, checked);
break;
}
}
......@@ -49,7 +49,6 @@ OathPage::OathPage(QWidget *parent) :
m_customerPrefix = -1;
memset(&m_pubId, 0, sizeof(m_pubId));
m_pubIdMUI = 0;
m_pubIdFormat = 0;
m_ykConfig = 0;
m_keyPresent = false;
clearState();
......@@ -318,7 +317,12 @@ void OathPage::updatePrefix() {
break;
case OATH_FIXED_MODHEX:
muiTxt = YubiKeyUtil::qstrModhexEncode((unsigned char*)&m_pubIdMUI, 4);
unsigned char tempMUI[4];
tempMUI[0] = (m_pubIdMUI >> 24) & 0xff;
tempMUI[1] = (m_pubIdMUI >> 16) & 0xff;
tempMUI[2] = (m_pubIdMUI >> 8) & 0xff;
tempMUI[3] = m_pubIdMUI & 0xff;
muiTxt = YubiKeyUtil::qstrModhexEncode(tempMUI, 4);
ui->advOMPTxt->setText(pubIdModhexTxt.left(2));
ui->advTTTxt->setText(pubIdModhexTxt.mid(2, 2));
ui->advMUITxt->setText(muiTxt);
......@@ -495,8 +499,7 @@ void OathPage::writeQuickConfig() {
//Public ID...
if(ui->quickPubIdCheck->isChecked()) {
QString pubIdTxt = YubiKeyUtil::qstrModhexEncode(m_pubId, 2);
m_ykConfig->setPubIdTxt(pubIdTxt);
m_ykConfig->setPubIdTxt(getPublicId(true));
//OATH Public ID Type...
m_ykConfig->setOathFixedModhex2(true);
......@@ -668,48 +671,7 @@ void OathPage::on_advPubIdCheck_stateChanged(int state) {
}
void OathPage::on_advPubIdFormatCombo_currentIndexChanged(int index) {
updateAdvOMP(m_pubIdFormat);
updateAdvTT(m_pubIdFormat);
updateAdvMUI(m_pubIdFormat);
// QRegExp modhex2("([b-lnrt-v ]){2}");
// QRegExp modhex8("([b-lnrt-v ]){8}");
// switch(index) {
// case OATH_FIXED_MODHEX1:
// ui->advOMPTxt->setInputMask("");
// ui->advOMPTxt->setValidator(new QRegExpValidator(modhex2, this));
// ui->advTTTxt->setInputMask(tr("00;"));
// ui->advMUITxt->setInputMask(tr("00 00 00 00;"));
// break;
// case OATH_FIXED_MODHEX2:
// ui->advOMPTxt->setInputMask("");
// ui->advOMPTxt->setValidator(new QRegExpValidator(modhex2, this));
// ui->advTTTxt->setInputMask("");
// ui->advTTTxt->setValidator(new QRegExpValidator(modhex2, this));
// ui->advMUITxt->setInputMask(tr("00 00 00 00;"));
// break;
// case OATH_FIXED_MODHEX:
// ui->advOMPTxt->setInputMask("");
// ui->advOMPTxt->setValidator(new QRegExpValidator(modhex2, this));
// ui->advTTTxt->setInputMask("");
// ui->advTTTxt->setValidator(new QRegExpValidator(modhex2, this));
// ui->advMUITxt->setInputMask("");
// ui->advMUITxt->setValidator(new QRegExpValidator(modhex8, this));
// break;
// default:
// ui->advOMPTxt->setInputMask(tr("00;"));
// ui->advTTTxt->setInputMask(tr("00;"));
// ui->advMUITxt->setInputMask(tr("00 00 00 00;"));
// break;
// }
updatePrefix();
m_pubIdFormat = index;
}
void OathPage::updateAdvOMP(int index) {
......@@ -762,20 +724,18 @@ void OathPage::on_advTTTxt_editingFinished() {
void OathPage::updateAdvMUI(int index) {
QString txt = ui->advMUITxt->text();
unsigned char buf[MAX_SIZE];
memset(buf, 0, sizeof(buf));
size_t bufLen = 0;
if (index != OATH_FIXED_MODHEX) {
YubiKeyUtil::qstrClean(&txt, OATH_HOTP_MUI_SIZE * 2, true);
YubiKeyUtil::qstrDecDecode(buf, &bufLen, txt);
m_pubIdMUI = txt.toInt();
} else {
unsigned char buf[MAX_SIZE];
memset(buf, 0, sizeof(buf));
size_t bufLen = 0;
YubiKeyUtil::qstrModhexClean(&txt, OATH_HOTP_MUI_SIZE * 2);
YubiKeyUtil::qstrModhexDecode(buf, &bufLen, txt);
m_pubIdMUI = (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + (buf[3]);
}
ui->advMUITxt->setText(txt);
memcpy(m_pubId + 2, buf, OATH_HOTP_MUI_SIZE);
}
void OathPage::on_advMUITxt_editingFinished() {
......@@ -982,6 +942,29 @@ bool OathPage::validateAdvSettings() {
return true;
}
QString OathPage::getPublicId(bool bcd) {
unsigned char pubId[6];
memcpy(pubId, m_pubId, 2);
if(bcd) {
int part = m_pubIdMUI / 1000000;
pubId[2] = ((part / 10) << 4) + part % 10;
part = m_pubIdMUI / 10000 % 100;
pubId[3] = ((part / 10) << 4) + part % 10;
part = m_pubIdMUI / 100 % 100;
pubId[4] = ((part / 10) << 4) + part % 10;
part = m_pubIdMUI % 100;
pubId[5] = ((part / 10) << 4) + part % 10;
} else {
pubId[2] = (m_pubIdMUI >> 24) & 0xff;
pubId[3] = (m_pubIdMUI >> 16) & 0xff;
pubId[4] = (m_pubIdMUI >> 8) & 0xff;
pubId[5] = m_pubIdMUI & 0xff;
}
QString pubIdTxt = YubiKeyUtil::qstrModhexEncode(pubId, 6);
return pubIdTxt;
}
void OathPage::writeAdvConfig() {
qDebug() << "Writing configuration...";
......@@ -1012,8 +995,8 @@ void OathPage::writeAdvConfig() {
//Public ID...
if(ui->advPubIdCheck->isChecked()) {
QString pubIdTxt = YubiKeyUtil::qstrModhexEncode(m_pubId, 2);
m_ykConfig->setPubIdTxt(pubIdTxt);
bool bcd = ui->advPubIdFormatCombo->currentIndex() < 3 ? true : false;
m_ykConfig->setPubIdTxt(getPublicId(bcd));
//OATH Public ID Type...
switch(ui->advPubIdFormatCombo->currentIndex()) {
......
......@@ -57,7 +57,6 @@ private:
int m_customerPrefix;
unsigned char m_pubId[2];
unsigned int m_pubIdMUI;
int m_pubIdFormat;
enum State {
State_Initial,
......@@ -75,6 +74,7 @@ private:
public slots:
void loadSettings();
QString getPublicId(bool bcd);
private slots:
void connectPages();
......
......@@ -429,7 +429,12 @@ void OtpPage::quickConfigWritten(bool written, const QString &msg) {
}
void OtpPage::uploadQuickConfig() {
QDesktopServices::openUrl(QUrl(m_uploadUrl));
m_tempFile.setFileTemplate(QDir::tempPath() + "/ykpers.XXXXXX.html");
m_tempFile.open();
m_tempFile.write(m_uploadUrl.toAscii(), m_uploadUrl.length());
m_tempFile.close();
qDebug() << "temporary file for upload is: " << m_tempFile.fileName();
QDesktopServices::openUrl(QUrl::fromLocalFile(m_tempFile.fileName()));
}
/*
......
......@@ -30,6 +30,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define OTPPAGE_H
#include <QStackedWidget>
#include <QTemporaryFile>
#include "yubikeyconfig.h"
namespace Ui {
......@@ -73,6 +74,8 @@ private:
QString m_uploadUrl;
QTemporaryFile m_tempFile;
public slots:
void loadSettings();
......
......@@ -76,6 +76,7 @@ SettingPage::SettingPage(QWidget *parent) :
connect(ui->manUpdateCheck, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->updateCheck, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->fastTrigCheck, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->ledInvertCheck, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->useNumericKeypadCheck, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->logTraditionalRadio, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->logYubicoRadio, SIGNAL(clicked()), this, SLOT(save()));
......@@ -251,6 +252,7 @@ void SettingPage::load() {
// extended settings..
ui->fastTrigCheck->setChecked(settings.value(SG_FAST_TRIG).toBool());
ui->useNumericKeypadCheck->setChecked(settings.value(SG_USE_NUMERIC_KEYPAD).toBool());
ui->ledInvertCheck->setChecked(settings.value(SG_LED_INVERT).toBool());
//Logging settings...
if(logDisabled) {
......@@ -348,6 +350,7 @@ void SettingPage::save() {
// Extended settings
settings.setValue(SG_FAST_TRIG, ui->fastTrigCheck->isChecked());
settings.setValue(SG_USE_NUMERIC_KEYPAD, ui->useNumericKeypadCheck->isChecked());
settings.setValue(SG_LED_INVERT, ui->ledInvertCheck->isChecked());
//Logging settings...
if(ui->logOutputCheck->isChecked()) {
......
......@@ -874,7 +874,7 @@ border-radius: 10px;
</string>
</property>
<property name="title">
<string>Serial # Visibility Settings (YubiKey 2.2+)</string>
<string>Serial # Visibility Settings (2.2+)</string>
</property>
<widget class="QCheckBox" name="srBtnVisibleCheck">
<property name="geometry">
......@@ -982,7 +982,7 @@ border-radius: 10px;
</string>
</property>
<property name="title">
<string>Static Password Setttings</string>
<string>Static Password Setttings (2.0+)</string>
</property>
<widget class="QCheckBox" name="manUpdateCheck">
<property name="geometry">
......@@ -997,7 +997,7 @@ border-radius: 10px;
<string notr="true">font-weight: normal;</string>
</property>
<property name="text">
<string>Enable manual update using the button (YubiKey 2)</string>
<string>Enable manual update using the button</string>
</property>
</widget>
<widget class="QPushButton" name="manUpdateHelpBtn">
......@@ -1047,8 +1047,8 @@ border-radius: 10px;
<widget class="QGroupBox" name="UpdateBox">
<property name="geometry">
<rect>
<x>370</x>
<y>380</y>
<x>10</x>
<y>390</y>
<width>350</width>
<height>50</height>
</rect>
......@@ -1058,7 +1058,7 @@ border-radius: 10px;
</string>
</property>
<property name="title">
<string>Update Settings (YubiKey 2.3+)</string>
<string>Update Settings (2.3+)</string>
</property>
<widget class="QCheckBox" name="updateCheck">
<property name="geometry">
......@@ -1123,10 +1123,10 @@ border-radius: 10px;
<widget class="QGroupBox" name="ExtendedBox">
<property name="geometry">
<rect>
<x>10</x>
<y>380</y>
<x>370</x>
<y>340</y>
<width>350</width>
<height>75</height>
<height>100</height>
</rect>
</property>
<property name="styleSheet">
......@@ -1134,7 +1134,7 @@ border-radius: 10px;
</string>
</property>
<property name="title">
<string>Extended Settings (YubiKey 2.3+)</string>
<string>Extended Settings</string>
</property>
<widget class="QCheckBox" name="useNumericKeypadCheck">
<property name="geometry">
......@@ -1149,7 +1149,7 @@ border-radius: 10px;
<string notr="true">font-weight: normal;</string>
</property>
<property name="text">
<string>Use numeric keypad for digits</string>
<string>Use numeric keypad for digits (2.3+)</string>
</property>
</widget>
<widget class="QCheckBox" name="fastTrigCheck">
......@@ -1165,7 +1165,23 @@ border-radius: 10px;
<string notr="true">font-weight: normal;</string>
</property>
<property name="text">
<string>Use fast triggering if only slot 1 is programmed</string>
<string>Use fast triggering if only slot 1 is programmed (2.3+)</string>
</property>
</widget>
<widget class="QCheckBox" name="ledInvertCheck">
<property name="geometry">
<rect>
<x>10</x>
<y>75</y>
<width>331</width>
<height>17</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">font-weight: normal;</string>
</property>
<property name="text">
<string>Invert led behaviour (2.4+/3.1+)</string>
</property>
</widget>
</widget>
......
......@@ -464,7 +464,7 @@ border-radius: 10px;
color: rgb(118, 116, 108)</string>
</property>
<property name="text">
<string>(Max. 38 chars for YubiKey 2.2 and 16 chars for 2.0 and 2.1)</string>
<string>(Max. 38 chars for YubiKey 2.2+ and 16 chars for 2.0 and 2.1)</string>
</property>
</widget>
<widget class="QPushButton" name="quickStaticBkpHelpBtn">
......
......@@ -316,6 +316,7 @@ void ToolPage::resetNdefPage() {
}
void ToolPage::programNdef() {
QSettings settings;
YubiKeyWriter *writer = YubiKeyWriter::getInstance();
bool uri = true;
QString language;
......@@ -333,7 +334,7 @@ void ToolPage::programNdef() {
return;
}
if(uri) {
if(uri && !settings.value(SG_NDEF_WITHOUT_HTTP).toBool()) {
if(!payload.startsWith("http")) {
ConfirmBox confirm(this);
confirm.setConfirmIndex(ConfirmBox::Confirm_NdefWithoutHttp);
......
......@@ -29,8 +29,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef VERSION_H
#define VERSION_H
#define VER_PRODUCTVERSION 3,1,5,0
#define VER_PRODUCTVERSION_STR "3.1.5\0"
#define VER_PRODUCTVERSION 3,1,8,0
#define VER_PRODUCTVERSION_STR "3.1.8\0"
#define VER_FILEDESCRIPTION_STR "YubiKey Personalization Tool"
#define VER_INTERNALNAME_STR "YKPersonalization"
......
......@@ -83,6 +83,8 @@ YubiKeyConfig::YubiKeyConfig() {
m_dormant = false;
m_fastTrig = settings.value(SG_FAST_TRIG).toBool();
m_useNumericKeypad = settings.value(SG_USE_NUMERIC_KEYPAD).toBool();
m_ledInvert = settings.value(SG_LED_INVERT).toBool();
}
void YubiKeyConfig::setPubIdTxt(const QString &pubIdTxt) {
......
......@@ -251,6 +251,11 @@ public:
bool useNumericKeypad() const
{return m_useNumericKeypad;}
void setLedInvert(bool ledInvert)
{m_ledInvert = ledInvert;}
bool ledInvert() const
{return m_ledInvert;}
private:
Mode m_mode;
int m_configSlot;
......@@ -305,6 +310,8 @@ private:
bool m_dormant;
bool m_fastTrig;
bool m_useNumericKeypad;
bool m_ledInvert;
};
#endif // YUBIKEYCONFIG_H
......@@ -45,6 +45,7 @@ const unsigned int YubiKeyFinder::FEATURE_MATRIX[][2] = {
{ YK_VERSION(2,3,0), 0 }, //Feature_ChallengeResponseFixed
{ YK_VERSION(2,3,0), 0 }, //Feature_Updatable
{ YK_VERSION(2,1,4), 0 }, //Feature_Ndef
{ YK_VERSION(2,4,0), 0 }, //Feature_LedInvert
};
// when a featureset should be excluded from versions (NEO, I'm looking at you.)
......@@ -62,6 +63,7 @@ const unsigned int YubiKeyFinder::FEATURE_MATRIX_EXCLUDE[][2] = {
{ 0, 0 }, //Feature_ChallengeResponseFixed
{ 0, 0 }, //Feature_Updatable
{ YK_VERSION(2,2,0), YK_VERSION(3,0,0) }, //Feature_Ndef
{ YK_VERSION(3,0,0), YK_VERSION(3,1,0) }, //Feature_LedInvert
};
YubiKeyFinder::YubiKeyFinder() {
......@@ -192,6 +194,11 @@ bool YubiKeyFinder::closeKey() {
}
void YubiKeyFinder::findKey() {
if(QApplication::activeWindow() == 0) {
//No focus, avoid locking the YubiKey.
return;
}
YK_STATUS *ykst = ykds_alloc();
bool error = false;
......
......@@ -69,6 +69,7 @@ public:
Feature_ChallengeResponseFixed,
Feature_Updatable,
Feature_Ndef,
Feature_LedInvert,
};
State state() const
......
......@@ -116,14 +116,26 @@ void YubiKeyWriter::writeConfig(YubiKeyConfig *ykConfig) {
// Check features support
bool flagSrNoSupport = false;
bool flagUpdateSupport = false;
if(YubiKeyFinder::getInstance()->checkFeatureSupport(
bool flagImfSupport = false;
bool flagLedInvSupport = false;
YubiKeyFinder *finder = YubiKeyFinder::getInstance();
if(finder->checkFeatureSupport(
YubiKeyFinder::Feature_SerialNumber)) {
flagSrNoSupport = true;
}
if(YubiKeyFinder::getInstance()->checkFeatureSupport(
if(finder->checkFeatureSupport(
YubiKeyFinder::Feature_Updatable)) {
flagUpdateSupport = true;
}
if(finder->checkFeatureSupport(
YubiKeyFinder::Feature_MovingFactor)) {
flagImfSupport = true;
}
if(finder->checkFeatureSupport(
YubiKeyFinder::Feature_LedInvert)) {
flagLedInvSupport = true;
}
YubiKeyFinder::getInstance()->stop();
......@@ -190,7 +202,7 @@ void YubiKeyWriter::writeConfig(YubiKeyConfig *ykConfig) {
CFGFLAG(OATH_FIXED_MODHEX, ykConfig->oathFixedModhex());
//Moving Factor Seed...
if(!ykp_set_oath_imf(cfg, ykConfig->oathMovingFactorSeed())) {
if(flagImfSupport && !ykp_set_oath_imf(cfg, ykConfig->oathMovingFactorSeed())) {
throw 0;
}
......@@ -365,6 +377,10 @@ void YubiKeyWriter::writeConfig(YubiKeyConfig *ykConfig) {
EXTFLAG(USE_NUMERIC_KEYPAD, ykConfig->useNumericKeypad());
}
if(flagLedInvSupport) {
EXTFLAG(LED_INV, ykConfig->ledInvert());
}
//Log configuration...
qDebug() << "-------------------------";
qDebug() << "Config data to be written to key configuration...";
......
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