Commit 19546627 authored by Klas Lindfors's avatar Klas Lindfors

Imported Upstream version 3.1.9

parent 6c0ce95a
2013-04-22 Klas Lindfors <klas@yubico.com>
* NEWS: NEWS
2013-04-22 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/settingpage.cpp, src/yubikeylogger.cpp,
src/yubikeylogger.h, src/yubikeywriter.cpp, src/yubikeywriter.h:
remember selected locations for log and export and reuse resolves #16
2013-04-19 Klas Lindfors <klas@yubico.com>
* src/yubikeylogger.cpp, src/yubikeywriter.cpp: better default paths
for file dialogs
2013-04-19 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/chalresppage.cpp, src/ui/chalresppage.h,
src/ui/mainwindow.cpp, src/ui/oathpage.cpp, src/ui/otppage.cpp,
src/ui/settingpage.cpp, src/ui/settingpage.ui: add a setting for
enable/disable export config
2013-04-18 Klas Lindfors <klas@yubico.com>
* src/yubikeywriter.cpp: YKP_FORMAT_JSON changed to YKP_FORMAT_YCFG
2013-04-18 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: deal with moving qt_menu.nib if it's
already moved
2013-04-18 Klas Lindfors <klas@yubico.com>
* src/ui/settingpage.ui: move around logging settings
2013-04-18 Klas Lindfors <klas@yubico.com>
* : commit 2dab637d23070be7a6e146a1d5e4b2e60673ba0d Author: Klas
Lindfors <klas@yubico.com> Date: Thu Apr 18 13:57:52 2013 +0100
2013-04-18 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: add for_store build flags
2013-04-18 Klas Lindfors <klas@yubico.com>
* resources/mac/Info.plist.in: add application category
2013-04-18 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: for mac use config for_store to select
appropriate certificates
2013-04-18 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: run productbuild instead of pkgbuild
2013-04-16 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: add license files for osx
2013-04-16 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro, installer/win-nsis/ykpers.nsi: include
licenses in windows installer
2013-04-16 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: merge two win32 blocks
2013-04-16 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro, resources/mac/Entitlements.plist: use app
sandbox on osX
2013-04-16 Klas Lindfors <klas@yubico.com>
* README: update instructions
2013-04-16 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: simplify mac build
2013-04-16 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: rework macx build to work with binary
package of libykpers
2013-04-15 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro: change around so the dll files come from
the packed up zip
2013-04-15 Klas Lindfors <klas@yubico.com>
* src/yubikeylogger.cpp, src/yubikeywriter.cpp: set filters for
selected files
2013-04-15 Klas Lindfors <klas@yubico.com>
* src/ui/settingpage.cpp, src/ui/settingpage.h,
src/ui/settingpage.ui, src/yubikeylogger.cpp, src/yubikeylogger.h:
change around for logging to go by QFileDialog With this the user has to select which file to log to when the first
write occurs. solves #3
2013-04-15 Klas Lindfors <klas@yubico.com>
* YKPersonalization.pro, installer/win-nsis/ykpers.nsi: add json dll
for windows build
2013-04-15 Klas Lindfors <klas@yubico.com>
* installer/win32/Installer.sln,
installer/win32/Installer/Installer.vdproj: drop old windows
installer
2013-04-15 Klas Lindfors <klas@yubico.com>
* src/ui/chalresppage.cpp, src/ui/chalresppage.h,
src/ui/chalresppage.ui, src/ui/oathpage.cpp, src/ui/oathpage.h,
src/ui/oathpage.ui, src/ui/otppage.cpp: implement export for oath
and chalresp
2013-04-15 Klas Lindfors <klas@yubico.com>
* src/ui/otppage.cpp: same rules for export as write
2013-04-15 Klas Lindfors <klas@yubico.com>
* src/yubikeywriter.cpp: little bit more error-checking
2013-04-15 Klas Lindfors <klas@yubico.com>
* src/common.h, src/ui/otppage.cpp, src/ui/otppage.h,
src/ui/otppage.ui: add exporting of otp
2013-04-15 Klas Lindfors <klas@yubico.com>
* src/yubikeywriter.cpp, src/yubikeywriter.h: add exportConfig
method and split out assembling the configuration
2013-04-11 Dain Nilsson <dain@yubico.com>
* do-source-release.sh: Use publish script in YUBICO_GITHUB_REPO
2013-04-05 Klas Lindfors <klas@yubico.com>
* build-homepage.sh, do-source-release.sh: change release scripts
around to work with yubico.github.com
2013-04-04 Simon Josefsson <simon@josefsson.org>
* resources/lin/yubikey-personalization-gui.1, src/common.h,
src/crandom.cpp, src/crandom.h, src/main.cpp, src/otpdef.h,
src/ui/aboutpage.cpp, src/ui/aboutpage.h, src/ui/chalresppage.cpp,
src/ui/chalresppage.h, src/ui/confirmbox.cpp, src/ui/confirmbox.h,
src/ui/helpbox.cpp, src/ui/helpbox.h, src/ui/mainwindow.cpp,
src/ui/mainwindow.h, src/ui/oathpage.cpp, src/ui/oathpage.h,
src/ui/otppage.cpp, src/ui/otppage.h, src/ui/scanedit.cpp,
src/ui/scanedit.h, src/ui/settingpage.cpp, src/ui/settingpage.h,
src/ui/staticpage.cpp, src/ui/staticpage.h, src/ui/toolpage.cpp,
src/ui/toolpage.h, src/yubikeyconfig.cpp, src/yubikeyconfig.h,
src/yubikeyfinder.cpp, src/yubikeyfinder.h, src/yubikeylogger.cpp,
src/yubikeylogger.h, src/yubikeyutil.cpp, src/yubikeyutil.h,
src/yubikeywriter.cpp, src/yubikeywriter.h: Bump copyright years.
2013-03-18 Klas Lindfors <klas@yubico.com>
* NEWS, YKPersonalization.pro, src/version.h: bump versions
post-release
2013-03-18 Klas Lindfors <klas@yubico.com>
* NEWS: release 3.1.8
......
yubikey-personalization-gui NEWS -- History of user-visible changes. -*- outline -*-
* Version 3.1.9 (released 2013-04-22)
** Add experimental export support to ycfg-json format.
** Always ask what file to log to when saving configuration.
** Rework build-system to never compile-in libykpers and libyubikey.
* Version 3.1.8 (released 2013-03-18)
** Fix programming of OATH MUI
......
......@@ -47,30 +47,21 @@ directory:
Dependencies
------------
yubikey-personalization-gui depends on version 1.12.0 or higher of
yubikey-personalization-gui depends on version 1.13.0 or higher of
libykpers.
When building on Windows you will need binary releases of libykpers
and libyubikey, these can be downloaded from
http://code.google.com/p/yubikey-personalization/, the dlls
libykpers-1-1.dll and libyubikey-0.dll should then be placed in
libs/win32 and libs/win64 respectively.
When building on Windows and mac you will need a binary buikd of libykpers,
that can be downloaded from http://code.google.com/p/yubikey-personalization/,
the contents should then be places in libs/win32, libs/win64 and libs/macx
respectively.
When building on MAC or Linux you will need sourcecode from yubico-c
and yubikey-personalization. This can be downloaded from
http://code.google.com/p/yubikey-personalization/ and
http://code.google.com/p/yubico-c/ and should be placed unpacked in
deps/libyubikey and deps/libykpers. You also need libusb.h
from http://sourceforge.net/projects/libusb/files/libusb-1.0/
placed in deps/libusb-1.0.
You will need QT Creator and libusb-1.0 development files.
For building on linux pkg-config is used to find these dependencies.
-----------
$ sudo apt-get install libusb-1.0-0-dev qtcreator
$ sudo apt-get install libusb-1.0-0-dev qt4-qmake libykpers-1-dev \
libyubikey-dev
-----------
Command-line build
------------------
......@@ -80,22 +71,12 @@ Run these commands:
$ qmake && make
-----------
An alternative way of building is to let pkg-config find the dependencies,
in that case you need development files for libyubikey and libykpers.
-----------
$ sudo apt-get install libyubikey-dev libykpers-1-dev
$ qmake "CONFIG += debian" && make
-----------
Cross Compiling from Linux
--------------------------
The project can be cross compiled from linux for osX and windows. As
a first step you need a cross-compiler chain for that OS, for windows
you want mingw-w64 and for osX you can follow directions at
https://github.com/Tatsh/xchain/.
you want mingw-w64.
Then you need unpacked qt binaries for that platform, fetchable
from http://qt-project.org/.
......@@ -104,14 +85,6 @@ You can then do (for windows):
TARGET_ARCH=i686-w64-mingw32 QTDIR=<qt location> qmake \
-spec win32-g++-4.6 "CONFIG+=cross"
or (for osX):
TARGET_ARCH=x86_64-apple-darwin11 OSX_SDK=<osx sdk location> \
QT_LIBDIR=<qt libs> QT_PLUGINDIR=<qt plugins> qmake -spec macx-g++ \
"CONFIG +=cross"
Note that you need to point QT_LIBDIR and QT_PLUGINDIR at the
/Library/Frameworks directory of the unpacked distribution.
To build installers you can add build_installer to the CONFIG variable
for qmake. This requires makensis to be in path for windows and
genisoimage and dmg (from libhfs-dmg) for mac.
......
This diff is collapsed.
#!/bin/sh
if [ "x$YUBICO_GITHUB_REPO" = "x" ]; then
echo "YUBICO_GITHUB_REPO not defined"
exit
fi
if [ ! -d $YUBICO_GITHUB_REPO/yubikey-personalization-gui ]; then
echo "$YUBICO_GITHUB_REPO/yubikey-personalization-gui does not exist"
exit
fi
README_FILE=`mktemp '/tmp/README.XXXXXX'`
NEWS_FILE=`mktemp '/tmp/NEWS.XXXXXX'`
asciidoc -s -o $README_FILE README
asciidoc -s -o $NEWS_FILE NEWS
git checkout gh-pages
cd $YUBICO_GITHUB_REPO/yubikey-personalization-gui
cat index.html.in $README_FILE > index.html
echo "</div></body></html>" >> index.html
cat news.html.in $NEWS_FILE > news.html
echo "</div></body></html>" >> news.html
rm $README_FILE
rm -f $README_FILE $NEWS_FILE
git add index.html
git commit -m "updated page with new README"
git add news.html
git commit -m "updated page with new release notes"
git checkout master
git commit -m "updated page with new README and release notes"
echo "Commited new readme and release notes, not pushed."
......@@ -26,6 +26,11 @@ if ! cat src/version.h | grep -q "#define VER_PRODUCTVERSION.*$VERSION"; then
exit
fi
if [ "x$YUBICO_GITHUB_REPO" = "x" ]; then
echo "you need to define YUBICO_GITHUB_REPO"
exit
fi
releasename=yubikey-personalization-gui-${VERSION}
git push
......@@ -38,18 +43,6 @@ git archive $releasename --format=tar | tar -xC $releasedir
git2cl > $releasedir/ChangeLog
tar -cz --directory=$tmpdir --file=${releasename}.tar.gz $releasename
gpg --detach-sign --default-key $PGP_KEYID ${releasename}.tar.gz
stagedir=`mktemp -d`
mv ${releasename}.tar.gz.sig $stagedir
mv ${releasename}.tar.gz $stagedir
git checkout gh-pages
mv $stagedir/${releasename}.tar.gz.sig releases/
mv $stagedir/${releasename}.tar.gz releases/
git add releases/${releasename}.tar.gz.sig
git add releases/${releasename}.tar.gz
x=`ls -1 releases/*.tar.gz | awk -F\- '{print $4}' | sed 's/.tar.gz/,/' | paste -sd ' ' - | sed 's/,$//'`; sed -i -e "2s|\[.*\]|[$x]|" releases.html
git add releases.html
git commit -m "Added release $VERSION"
git checkout master
git push origin gh-pages
$YUBICO_GITHUB_REPO/publish yubikey-personalization-gui $VERSION ${releasename}.tar.gz*
rm -rf $tmpdir
rm -rf $stagedir
......@@ -38,7 +38,6 @@ FunctionEnd
; Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "../../COPYING"
!insertmacro MUI_PAGE_DIRECTORY
;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Yubico\YubiKey Personalization Tool"
......@@ -61,12 +60,15 @@ Section "YubiKey Personalization Tool"
SectionIn RO
SetOutPath $INSTDIR
FILE ../../build/release/yubikey-personalization-gui.exe
FILE ../../build/release/libjson-c-2.dll
FILE ../../build/release/libyubikey-0.dll
FILE ../../build/release/libykpers-1-1.dll
FILE ../../build/release/QtCore4.dll
FILE ../../build/release/QtGui4.dll
FILE ../../build/release/libgcc_s_dw2-1.dll
FILE ../../build/release/mingwm10.dll
SetOutPath $INSTDIR\licenses
FILE /r ../../build/release/licenses/
SetOutPath $INSTDIR\imageformats
FILE ../../build/release/qmng4.dll
SectionEnd
......@@ -113,6 +115,7 @@ Section "Uninstall"
DeleteRegKey HKLM "Software\Yubico\yubikey-personalization-gui"
DELETE "$INSTDIR\yubikey-personalization-gui.exe"
DELETE "$INSTDIR\libjson-c-2.dll"
DELETE "$INSTDIR\libyubikey-0.dll"
DELETE "$INSTDIR\libykpers-1-1.dll"
DELETE "$INSTDIR\QtCore4.dll"
......@@ -121,8 +124,10 @@ Section "Uninstall"
DELETE "$INSTDIR\libgcc_s_sjlj-1.dll"
DELETE "$INSTDIR\libstdc++-6.dll"
DELETE "$INSTDIR\mingwm10.dll"
DELETE "$INSTDIR\licenses\*"
DELETE "$INSTDIR\imageformats\qmng4.dll"
RMDir "$INSTDIR\licenses"
RMDir "$INSTDIR\imageformats"
; Remove uninstaller
......

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Installer", "Installer\Installer.vdproj", "{E7C71BA1-91C3-43D6-BB33-3D47018DCDC7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Default = Debug|Default
Release|Default = Release|Default
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E7C71BA1-91C3-43D6-BB33-3D47018DCDC7}.Debug|Default.ActiveCfg = Release
{E7C71BA1-91C3-43D6-BB33-3D47018DCDC7}.Debug|Default.Build.0 = Release
{E7C71BA1-91C3-43D6-BB33-3D47018DCDC7}.Release|Default.ActiveCfg = Release
{E7C71BA1-91C3-43D6-BB33-3D47018DCDC7}.Release|Default.Build.0 = Release
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
This diff is collapsed.
.\" Copyright (c) 2012 Yubico AB
.\" Copyright (c) 2012-2013 Yubico AB
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
</dict>
</plist>
......@@ -16,5 +16,7 @@
<string>YubiKey Personalization Tool</string>
<key>CFBundleVersion</key>
<string>@@version@@</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
</dict>
</plist>
/*
Copyright (C) 2011-2012 Yubico AB. All rights reserved.
Copyright (C) 2011-2013 Yubico AB. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......@@ -63,6 +63,9 @@ typedef std::vector<int>::size_type size_t;
#define OUT_CHAR_RATE_SLOWDOWN_40 2
#define OUT_CHAR_RATE_SLOWDOWN_60 3
#define WRITE_CONFIG 0
#define EXPORT_CONFIG 1
#define SUPPORT_EMAIL tr("mailto:support@yubico.com")
#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>")
......@@ -103,6 +106,7 @@ typedef std::vector<int>::size_type size_t;
#define NO_KEY_FOUND tr("No YubiKey inserted")
#define KEY_CONFIGURED tr("YubiKey%1 has been successfully configured")
#define KEY_EXPORTED tr("YubiKey configuration has been successfully exported")
#define REMOVE_KEY tr("Please remove this YubiKey")
#define SETTINGS_SAVED tr("Settings have been successfully saved")
#define SETTINGS_RESTORED tr("Default settings have been restored")
......@@ -144,6 +148,8 @@ typedef std::vector<int>::size_type size_t;
#define SG_LOG_FILENAME "Log/Filename"
#define SG_LOG_FORMAT "Log/Format"
#define SG_EXPORT_FILENAME "Export/Filename"
#define SG_TAB_FIRST "Flag/TabTirst"
#define SG_APPEND_TAB1 "Flag/AppendTab1"
#define SG_APPEND_TAB2 "Flag/AppendTab2"
......@@ -171,6 +177,7 @@ typedef std::vector<int>::size_type size_t;
#define SG_NDEF_WITHOUT_HTTP "DontAsk/NdefWithoutHttp"
#define SG_ANIMATIONS_PREFERENCE "Preference/Animations"
#define SG_EXPORT_PREFERENCE "Preference/Export"
//Help messages
......
/*
Copyright (C) 2011-2012 Yubico AB. All rights reserved.
Copyright (C) 2011-2013 Yubico AB. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......
/*
Copyright (C) 2011-2012 Yubico AB. All rights reserved.
Copyright (C) 2011-2013 Yubico AB. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......
/*
Copyright (C) 2011-2012 Yubico AB. All rights reserved.
Copyright (C) 2011-2013 Yubico AB. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......
/*
Copyright (C) 2011-2012 Yubico AB. All rights reserved.
Copyright (C) 2011-2013 Yubico AB. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......
/*
Copyright (C) 2011-2012 Yubico AB. All rights reserved.
Copyright (C) 2011-2013 Yubico AB. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......
/*
Copyright (C) 2011-2012 Yubico AB. All rights reserved.
Copyright (C) 2011-2013 Yubico AB. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......
/*
Copyright (C) 2011-2012 Yubico AB. All rights reserved.
Copyright (C) 2011-2013 Yubico AB. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......@@ -60,6 +60,8 @@ ChalRespPage::ChalRespPage(QWidget *parent) :
ui->quickResultsWidget->resizeColumnsToContents();
ui->advResultsWidget->resizeColumnsToContents();
loadSettings();
}
ChalRespPage::~ChalRespPage() {
......@@ -70,6 +72,13 @@ ChalRespPage::~ChalRespPage() {
delete ui;
}
void ChalRespPage::loadSettings() {
QSettings settings;
ui->advExportConfigBtn->setVisible(settings.value(SG_EXPORT_PREFERENCE).toBool());
ui->quickExportConfigBtn->setVisible(settings.value(SG_EXPORT_PREFERENCE).toBool());
}
/*
Common
*/
......@@ -179,7 +188,9 @@ void ChalRespPage::keyFound(bool found, bool* featuresMatrix) {
if(found) {
if(m_state == State_Initial) {
ui->quickWriteConfigBtn->setEnabled(true);
ui->quickExportConfigBtn->setEnabled(true);
ui->advWriteConfigBtn->setEnabled(true);
ui->advExportConfigBtn->setEnabled(true);
if(!featuresMatrix[YubiKeyFinder::Feature_MultipleConfigurations]) {
ui->quickConfigSlot2Radio->setEnabled(false);
......@@ -202,22 +213,26 @@ void ChalRespPage::keyFound(bool found, bool* featuresMatrix) {
if(this->currentIndex() == Page_Quick) {
if(m_state == State_Programming_Multiple) {
ui->quickWriteConfigBtn->setEnabled(true);
ui->quickExportConfigBtn->setEnabled(true);
} else {
writeQuickConfig();
writeQuickConfig(WRITE_CONFIG);
}
} else {
if(m_state == State_Programming_Multiple) {
ui->advWriteConfigBtn->setEnabled(true);
ui->advExportConfigBtn->setEnabled(true);
} else {
writeAdvConfig();
writeAdvConfig(WRITE_CONFIG);
}
}
}
m_keyPresent = true;
} else {
ui->quickWriteConfigBtn->setEnabled(false);
ui->quickExportConfigBtn->setEnabled(false);
ui->advWriteConfigBtn->setEnabled(false);
ui->advExportConfigBtn->setEnabled(false);
ui->advHmacFixedInputRadio->setEnabled(true);
m_keyPresent = false;
......@@ -285,6 +300,7 @@ void ChalRespPage::freezeQuickPage(bool freeze) {
ui->quickKeyParamsBox->setEnabled(disable);
ui->quickWriteConfigBtn->setEnabled(disable);
ui->quickExportConfigBtn->setEnabled(disable);
ui->quickStopBtn->setEnabled(!disable);
ui->quickResetBtn->setEnabled(disable);
ui->quickBackBtn->setEnabled(disable);
......@@ -405,9 +421,23 @@ void ChalRespPage::on_quickWriteConfigBtn_clicked() {
m_state = State_Programming;
}
writeQuickConfig();
writeQuickConfig(WRITE_CONFIG);
}
void ChalRespPage::on_quickExportConfigBtn_clicked() {
emit showStatusMessage(NULL, -1);
//Validate settings
if(!validateQuickSettings()) {
return;
}
clearState();
freezeQuickPage(true);
writeQuickConfig(EXPORT_CONFIG);
}
void ChalRespPage::on_quickStopBtn_clicked() {
ui->quickStopBtn->setEnabled(false);
m_state = State_Initial;
......@@ -512,7 +542,7 @@ bool ChalRespPage::validateQuickSettings() {
return true;
}
void ChalRespPage::writeQuickConfig() {
void ChalRespPage::writeQuickConfig(int mode) {
qDebug() << "Writing configuration...";
//Disable stop button while configuration is being written
......@@ -563,11 +593,19 @@ void ChalRespPage::writeQuickConfig() {
m_ykConfig->setChalYubico(true);
m_ykConfig->setChalBtnTrig(ui->quickRequireUserInputCheck->isChecked());
//Write
connect(YubiKeyWriter::getInstance(), SIGNAL(configWritten(bool, const QString &)),
this, SLOT(quickConfigWritten(bool, const QString &)));
if(mode == WRITE_CONFIG) {
//Write
connect(YubiKeyWriter::getInstance(), SIGNAL(configWritten(bool, const QString &)),
this, SLOT(quickConfigWritten(bool, const QString &)));
YubiKeyWriter::getInstance()->writeConfig(m_ykConfig);
} else if(mode == EXPORT_CONFIG) {
//Write
connect(YubiKeyWriter::getInstance(), SIGNAL(configWritten(bool, const QString &)),
this, SLOT(quickConfigExported(bool, const QString &)));
YubiKeyWriter::getInstance()->writeConfig(m_ykConfig);
YubiKeyWriter::getInstance()->exportConfig(m_ykConfig);
}
}
void ChalRespPage::quickConfigWritten(bool written, const QString &msg) {
......@@ -602,6 +640,28 @@ void ChalRespPage::quickConfigWritten(bool written, const QString &msg) {
stopQuickConfigWritting();
}
void ChalRespPage::quickConfigExported(bool written, const QString &msg) {
disconnect(YubiKeyWriter::getInstance(), SIGNAL(configWritten(bool, const QString &)),
this, SLOT(quickConfigExported(bool, const QString &)));
QString message;
if(written) {
qDebug() << "Configuration exported....";
message = KEY_EXPORTED;
showStatusMessage(message, 0);
} else {
qDebug() << "Configuration could not be exported....";
message = msg;
}
m_ready = false;
stopQuickConfigWritting();
}
void ChalRespPage::quickUpdateResults(bool written, const QString &msg) {
int row = 0;
......@@ -671,6 +731,7 @@ void ChalRespPage::freezeAdvPage(bool freeze) {
ui->advKeyParamsBox->setEnabled(disable);
ui->advWriteConfigBtn->setEnabled(disable);
ui->advExportConfigBtn->setEnabled(disable);
ui->advStopBtn->setEnabled(!disable);
ui->advResetBtn->setEnabled(disable);
ui->advBackBtn->setEnabled(disable);
......@@ -773,7 +834,22 @@ void ChalRespPage::on_advWriteConfigBtn_clicked() {
m_state = State_Programming;
}
writeAdvConfig();
writeAdvConfig(WRITE_CONFIG);
}
void ChalRespPage::on_advExportConfigBtn_clicked() {
emit showStatusMessage(NULL, -1);
//Validate settings
if(!validateAdvSettings()) {
return;
}
clearState();
freezeAdvPage(true);
writeAdvConfig(EXPORT_CONFIG);
}
void ChalRespPage::on_advStopBtn_clicked() {
......@@ -857,7 +933,7 @@ bool ChalRespPage::validateAdvSettings() {
return true;
}
void ChalRespPage::writeAdvConfig() {
void ChalRespPage::writeAdvConfig(int mode) {
qDebug() << "Writing configuration...";
//Disable stop button while configuration is being written
......@@ -904,11 +980,19 @@ void ChalRespPage::writeAdvConfig() {
m_ykConfig->setHmacLT64(ui->advHmacVarInputRadio->isChecked());
m_ykConfig->setChalBtnTrig(ui->advRequireUserInputCheck->isChecked());
//Write
connect(YubiKeyWriter::getInstance(), SIGNAL(configWritten(bool, const QString &)),
this, SLOT(advConfigWritten(bool, const QString &)));
if(mode == WRITE_CONFIG) {
//Write
connect(YubiKeyWriter::getInstance(), SIGNAL(configWritten(bool, const QString &)),
this, SLOT(advConfigWritten(bool, const QString &)));
YubiKeyWriter::getInstance()->writeConfig(m_ykConfig);
} else if(mode == EXPORT_CONFIG) {
//Write
connect(YubiKeyWriter::getInstance(), SIGNAL(configWritten(bool, const QString &)),
this, SLOT(advConfigExported(bool, const QString &)));
YubiKeyWriter::getInstance()->writeConfig(m_ykConfig);
YubiKeyWriter::getInstance()->exportConfig(m_ykConfig);
}
}
void ChalRespPage::advConfigWritten(bool written, const QString &msg) {
......@@ -943,6 +1027,28 @@ void ChalRespPage::advConfigWritten(bool written, const QString &msg) {
stopAdvConfigWritting();
}
void ChalRespPage::advConfigExported(bool written, const QString &msg) {
disconnect(YubiKeyWriter::getInstance(), SIGNAL(configWritten(bool, const QString &)),
this, SLOT(advConfigExported(bool, const QString &)));
QString message;
if(written) {
qDebug() << "Configuration written....";