Skip to content

Commit

Permalink
Merge release branch 1.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dainnilsson committed Apr 4, 2024
2 parents 2a81df9 + ec79d7f commit 6bc2e7e
Show file tree
Hide file tree
Showing 12 changed files with 134 additions and 38 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/windows-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.11.1'
python-version: '3.11.8'
architecture: 'x64'

- name: Install Qt
uses: jurplel/install-qt-action@v2.10.0
uses: jurplel/install-qt-action@v3
with:
version: '5.14.1'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2017_64'
aqtversion: '==0.9.7'

- name: Download dependencies
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/windows-x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.11.1'
python-version: '3.11.8'
architecture: 'x86'

- name: Install Qt
uses: jurplel/install-qt-action@v2.10.0
uses: jurplel/install-qt-action@v3
with:
version: '5.14.1'
host: 'windows'
target: 'desktop'
arch: 'win32_msvc2017'
aqtversion: '==0.9.7'

- name: Download dependencies
run: |
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Version 1.2.6 (released 2024-04-04)
** Windows-only security fix, see advisory:
https://www.yubico.com/support/security-advisories/ysa-2024-01/

* Version 1.2.5 (released 2023-02-02)
** Compatibility update for ykman 5.0.1.
** Update to Python 3.11.
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
yubikey-manager==5.0.1
yubikey-manager==5.0.1
cryptography==39.0.0
6 changes: 6 additions & 0 deletions ykman-cli/ykman-cli.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ mac|win32 {
QMAKE_CLEAN += -r pymodules
}

win32 {
QMAKE_CFLAGS += /guard:cf
QMAKE_CXXFLAGS += /guard:cf
QMAKE_LFLAGS += /guard:cf
}

macx {
pip.commands = python3 -m venv pymodules && source pymodules/bin/activate && pip3 install -r ../requirements.txt && deactivate
}
Expand Down
14 changes: 13 additions & 1 deletion ykman-gui/qml/ContentStack.qml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ StackView {
callback)
}

function otpUrl(url) {
copyableConfirmationPopup.show(
qsTr("Upload"), qsTr(
"Complete the upload of your credential by visiting the following URL: %1").arg(
url),
)
}

function otpWriteError() {
snackbarError.show(
qsTr("Failed to modify %1. Make sure the YubiKey does not have restricted access.").arg(
Expand Down Expand Up @@ -337,6 +345,10 @@ StackView {
id: confirmationPopup
}

CopyableConfirmationPopup {
id: copyableConfirmationPopup
}

PivPinPopup {
id: pivPinPopup
}
Expand All @@ -360,4 +372,4 @@ StackView {
SnackBarError {
id: snackbarError
}
}
}
37 changes: 37 additions & 0 deletions ykman-gui/qml/CopyableConfirmationPopup.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.2

InlinePopup {

property var acceptCallback
standardButtons: Dialog.Ok
focus: true

function show(heading, message) {
confirmationHeading.text = heading
confirmationLbl.text = message
open()
}

ColumnLayout {
width: parent.width
spacing: 20
Heading2 {
id: confirmationHeading
width: parent.width
Layout.maximumWidth: parent.width
}

TextInput {
id: confirmationLbl
wrapMode: Text.WordWrap
font.pixelSize: constants.h3
color: yubicoBlue
selectByMouse: true
readOnly: true
Layout.maximumWidth: parent.width
width: parent.width
}
}
}
13 changes: 10 additions & 3 deletions ykman-gui/qml/Header.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import QtQuick.Dialogs 1.2
import QtQuick.Controls.Material 2.2

ColumnLayout {

spacing: 0
width: app.width
function activeKeyLbl() {
Expand All @@ -19,6 +20,7 @@ ColumnLayout {
}
}


RowLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignRight
Expand All @@ -33,14 +35,17 @@ ColumnLayout {
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
color: yubicoBlue
font.pixelSize: constants.h4
}
}
CustomButton {

flat: true
text: qsTr("Help")
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
iconSource: "../images/help.svg"
toolTipText: qsTr("Visit Yubico Support in your web browser")
onClicked: Qt.openUrlExternally("https://www.yubico.com/kb")
onClicked: yubiKey.isWinAdmin ? helpPopup.show(
qsTr("Help"), qsTr(
"Visit the following URL for support with YubiKey Manager: https://www.yubico.com/kb")) : Qt.openUrlExternally("https://www.yubico.com/kb")
font.pixelSize: constants.h4
}
CustomButton {
Expand All @@ -52,6 +57,8 @@ ColumnLayout {
onClicked: aboutPage.open()
font.pixelSize: constants.h4
}


}
}

Expand Down Expand Up @@ -134,4 +141,4 @@ ColumnLayout {
Layout.fillHeight: true
color: yubicoGreen
}
}
}
58 changes: 34 additions & 24 deletions ykman-gui/qml/OtpYubiOtpView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import "slotutils.js" as SlotUtils
import QtQuick.Controls.Material 2.2

ColumnLayout {
property bool upload
property string url

function useSerial() {
if (useSerialCb.checked) {
Expand Down Expand Up @@ -40,12 +42,21 @@ ColumnLayout {
enableUpload.checked, function (resp) {
if (resp.success) {
if (resp.upload_url) {
if (Qt.openUrlExternally(resp.upload_url)) {
snackbarSuccess.show(qsTr("Configured Yubico OTP credential. Preparing upload in web browser."))
views.otp()
} else {
snackbarError.show(qsTr("Configured Yubico OTP credential. Failed to open upload in web browser!"))
}
if (yubiKey.isWinAdmin) {
upload = true
url = resp.upload_url
otpUrl(url, views.otp())

views.otp()
} else {
if (Qt.openUrlExternally(resp.upload_url)) {
snackbarSuccess.show(qsTr("Configured Yubico OTP credential. Preparing upload in web browser."))
views.otp()
} else {
snackbarError.show(qsTr("Configured Yubico OTP credential. Failed to open upload in web browser!"))
}
}

} else {
snackbarSuccess.show(
qsTr("Configured Yubico OTP credential"))
Expand Down Expand Up @@ -180,34 +191,33 @@ ColumnLayout {
flat: true
Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
}

Row {
id: row
spacing: 5
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
CheckBox {
id: enableUpload
text: qsTr("Upload")
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
ToolTip.delay: 1000
font.pixelSize: constants.h3
ToolTip.visible: hovered
ToolTip.text: qsTr("Upload credential to YubiCloud (opens a web browser)")
Material.foreground: yubicoBlue
}
text: qsTr("Upload")
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
ToolTip.delay: 1000
font.pixelSize: constants.h3
ToolTip.visible: hovered
ToolTip.text: qsTr("Upload credential to YubiCloud (opens a web browser)")
Material.foreground: yubicoBlue
}

FinishButton {
FinishButton {

onClicked: finish()
enabled: publicIdInput.acceptableInput
&& privateIdInput.acceptableInput
&& secretKeyInput.acceptableInput
toolTipText: qsTr("Finish and write the configuration to the YubiKey")
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
}
onClicked: finish()
enabled: publicIdInput.acceptableInput
&& privateIdInput.acceptableInput
&& secretKeyInput.acceptableInput
toolTipText: qsTr("Finish and write the configuration to the YubiKey")
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
}

}

}
}
}
}
11 changes: 11 additions & 0 deletions ykman-gui/qml/YubiKey.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Python {
property string serial
property bool canWriteConfig
property bool configurationLocked
property bool isWinAdmin: true

property var applicationsEnabledOverUsb: []
property var applicationsEnabledOverNfc: []
Expand Down Expand Up @@ -77,6 +78,16 @@ Python {
path = path + '/pymodules'
}

if (Qt.platform.os === "windows") {
importModule('ctypes', function () {
call('ctypes.windll.shell32.IsUserAnAdmin', [], function (res) {
isWinAdmin = (res === 1)
})
})
} else {
isWinAdmin = false
}

importModule('site', function () {
call('site.addsitedir', [path], function () {
addImportPath(urlPrefix + '/py')
Expand Down
4 changes: 4 additions & 0 deletions ykman-gui/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,8 @@ ApplicationWindow {
AboutPagePopup {
id: aboutPage
}

CopyableConfirmationPopup {
id: helpPopup
}
}
12 changes: 9 additions & 3 deletions ykman-gui/ykman-gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ SOURCES += main.cpp

# This is the internal verson number, Windows requires 4 digits.
win32|win64 {
VERSION = 1.2.5.0
VERSION = 1.2.6.0
} else {
VERSION = 1.2.5
VERSION = 1.2.6
}
# This is the version shown on the About page
DEFINES += APP_VERSION=\\\"1.2.5\\\"
DEFINES += APP_VERSION=\\\"1.2.6\\\"

message(Version of this build: $$VERSION)

Expand Down Expand Up @@ -42,6 +42,12 @@ macx {
pip.commands = pip3 install -r ../requirements.txt --target pymodules
}

win32 {
QMAKE_CFLAGS += /guard:cf
QMAKE_CXXFLAGS += /guard:cf
QMAKE_LFLAGS += /guard:cf
}

# Default rules for deployment.
include(deployment.pri)

Expand Down

0 comments on commit 6bc2e7e

Please sign in to comment.