[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://github.com/monich/harbour-yubikey.git</param>
<param name="branch">master</param>
- <param name="revision">a91597f</param>
+ <param name="revision">42e3746</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/LICENSE
^
|
@@ -1,33 +1,31 @@
Copyright (C) 2022-2023 Slava Monich <slava@monich.com>
Copyright (C) 2022 Jolla Ltd.
-You may use this file under the terms of BSD license as follows:
+You may use this file under the terms of the BSD license as follows:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
- 3. Neither the names of the copyright holders nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ 3. Neither the names of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation
are those of the authors and should not be interpreted as representing
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/app.pro
^
|
@@ -67,6 +67,7 @@
src/YubiKeyAuth.h \
src/YubiKeyAuthListModel.h \
src/YubiKeyCard.h \
+ src/YubiKeyCardSettings.h \
src/YubiKeyDefs.h \
src/YubiKeyConstants.h \
src/YubiKeyImportModel.h \
@@ -85,6 +86,7 @@
src/YubiKeyAuth.cpp \
src/YubiKeyAuthListModel.cpp \
src/YubiKeyCard.cpp \
+ src/YubiKeyCardSettings.cpp \
src/YubiKeyImportModel.cpp \
src/YubiKeyRecognizer.cpp \
src/YubiKeyTag.cpp \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/qml/YubiKeyAuthListItem.qml
^
|
@@ -10,6 +10,7 @@
property int type
property alias name: nameLabel.text
property string password
+ property bool steam
property bool favorite
property bool expired
property bool refreshable
@@ -69,7 +70,7 @@
bold: favorite
}
truncationMode: TruncationMode.Fade
- text: type === YubiKeyCard.TypeTOTP ? "TOTP" : "HOTP"
+ text: steam ? "Steam" : type === YubiKeyCard.TypeTOTP ? "TOTP" : "HOTP"
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/qml/YubiKeyPage.qml
^
|
@@ -108,6 +108,7 @@
}
onYubiKeyReset: thisPage.yubiKeyReset()
onTotpCodesExpired: otpListModel.totpCodesExpired()
+ onTokenRenamed: otpListModel.tokenRenamed(from, to)
}
Buzz {
@@ -408,6 +409,7 @@
readonly property string itemName: model.name
readonly property string itemPassword: model.password
readonly property bool itemFavorite: model.favorite
+ readonly property bool itemCanBeSteamToken: model.type === YubiKeyCard.TypeTOTP
readonly property bool itemMarkedForRefresh: model.markedForRefresh
readonly property bool itemMarkedForDeletion: model.markedForDeletion
readonly property bool itemCanCopyPassword: !itemMarkedForRefresh && !itemMarkedForDeletion && itemPassword !== ""
@@ -418,6 +420,7 @@
name: itemName
type: model.type
password: itemPassword
+ steam: model.steam
favorite: itemFavorite
expired: model.expired
refreshable: model.refreshable
@@ -439,16 +442,6 @@
}
}
MenuItem {
- id: copyMenuItem
-
- //: Context menu item (copy password to clipboard)
- //% "Copy password"
- text: qsTrId("yubikey-menu-copy_password")
- onEnabledChanged: contextMenu.updateVisibility()
- enabled: delegate.itemCanCopyPassword
- onClicked: delegate.copyPassword()
- }
- MenuItem {
id: renameMenuItem
//: Generic menu item
@@ -496,17 +489,31 @@
enabled: !delegate.itemMarkedForDeletion
onClicked: delegate.toggleFavorite()
}
+ MenuItem {
+ id: steamMenuItem
+
+ text: model.steam ?
+ //: Context menu item
+ //% "Standard token"
+ qsTrId("yubikey-menu-use_as_standard_token") :
+ //: Context menu item
+ //% "Steam token"
+ qsTrId("yubikey-menu-use_as_steam_token")
+ onEnabledChanged: contextMenu.updateVisibility()
+ enabled: delegate.itemCanBeSteamToken && !delegate.itemMarkedForDeletion
+ onClicked: model.steam = !model.steam
+ }
Component.onCompleted: updateVisibility()
onMenuExpandedChanged: updateVisibility()
function updateVisibility() {
if (!menuExpanded) {
- copyMenuItem.visible = copyMenuItem.enabled
renameMenuItem.visible = renameMenuItem.enabled
deleteMenuItem.visible = deleteMenuItem.enabled
cancelMenuItem.visible = cancelMenuItem.enabled
favoriteMenuItem.visible = favoriteMenuItem.enabled
+ steamMenuItem.visible = steamMenuItem.enabled
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/qml/YubiKeyTokenDialog.qml
^
|
@@ -78,7 +78,7 @@
width: counterField.visible ? parent.columnWidth : parent.width
//: Text field label (number of password digits)
- //% "Digits"
+ //% "Digits (leave it 6 for Steam tokens)"
label: qsTrId("yubikey-token-digits-text")
//: Text field placeholder (number of password digits)
//% "Number of password digits"
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKey.cpp
^
|
@@ -8,27 +8,25 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -221,6 +219,7 @@
protected:
bool startOperation() Q_DECL_OVERRIDE;
+ void finished(bool aSuccess) Q_DECL_OVERRIDE;
private:
static void renameResp(Operation*, const GUtilData*, guint, const GError*);
@@ -1856,6 +1855,16 @@
self->finished(!aError);
}
+void
+YubiKey::Private::RenameOperation::finished(
+ bool aSuccess)
+{
+ if (aSuccess) {
+ Q_EMIT iYubiKey->tokenRenamed(iFrom, iTo);
+ }
+ KeyOperation::finished(aSuccess);
+}
+
// ==========================================================================
// YubiKey
// ==========================================================================
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKey.h
^
|
@@ -8,27 +8,25 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -107,6 +105,7 @@
void totpCodesExpired();
void passwordChanged();
void passwordRemoved();
+ void tokenRenamed(const QString, const QString);
void yubiKeyReset();
private:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKeyAuthListModel.cpp
^
|
@@ -8,49 +8,45 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
* any official policies, either expressed or implied.
*/
-#include "YubiKeyConstants.h"
#include "YubiKeyAuthListModel.h"
+#include "YubiKeyCardSettings.h"
+#include "YubiKeyConstants.h"
#include "YubiKeyUtil.h"
#include "HarbourDebug.h"
-#include <QDir>
-#include <QSettings>
-#include <QCryptographicHash>
-
#include <ctype.h>
// Model roles
#define MODEL_ROLES_(first,role,last) \
first(Name,name) \
role(Type,type) \
+ role(Steam,steam) \
role(Algorithm,algorithm) \
role(Password,password) \
role(Favorite,favorite) \
@@ -106,9 +102,9 @@
ModelData(const QByteArray, YubiKeyTokenType, YubiKeyAlgorithm);
QVariant get(Role) const;
+ bool canBeSteamToken() const;
+ bool updatePassword();
- static QString nameHashUtf8(const QByteArray&);
- static QString nameHash(const QString&);
static YubiKeyTokenType toAuthType(uchar);
static YubiKeyAlgorithm toAuthAlgorithm(uchar);
@@ -116,12 +112,16 @@
const QByteArray iUtf8Name;
const QString iName;
const QString iNameHash;
+ const QString iSteamHash;
const YubiKeyTokenType iType;
const YubiKeyAlgorithm iAlgorithm;
QString iPassword;
+ bool iSteam;
bool iFavorite;
bool iExpired;
bool iRefreshable;
+ uint iDigits;
+ uint iMiniHash;
Mark iMark;
};
@@ -131,12 +131,16 @@
YubiKeyAlgorithm aAlgorithm) :
iUtf8Name(aUtf8Name),
iName(QString::fromUtf8(aUtf8Name)),
- iNameHash(nameHashUtf8(aUtf8Name)),
+ iNameHash(YubiKeyUtil::hashUtf8(aUtf8Name)),
+ iSteamHash(YubiKeyUtil::steamHashUtf8(aUtf8Name)),
iType(aType),
iAlgorithm(aAlgorithm),
+ iSteam(false),
iFavorite(false),
iExpired(false),
iRefreshable(aType == YubiKeyTokenType_HOTP),
+ iDigits(0),
+ iMiniHash(0),
iMark(MarkNone)
{
}
@@ -148,6 +152,7 @@
switch (aRole) {
case NameRole: return iName;
case TypeRole: return iType;
+ case SteamRole: return iSteam;
case AlgorithmRole: return iAlgorithm;
case PasswordRole: return iPassword;
case FavoriteRole: return iFavorite;
@@ -159,17 +164,42 @@
return QVariant();
}
-QString
-YubiKeyAuthListModel::ModelData::nameHashUtf8(
- const QByteArray& aUtf8)
+bool
+YubiKeyAuthListModel::ModelData::canBeSteamToken() const
{
- return QCryptographicHash::hash(aUtf8, QCryptographicHash::Sha1).toHex();
+ return iType == YubiKeyTokenType_TOTP;
}
-QString
-YubiKeyAuthListModel::ModelData::nameHash(const QString& aName)
+bool
+YubiKeyAuthListModel::ModelData::updatePassword()
{
- return nameHashUtf8(aName.toUtf8());
+ QString strPass;
+
+ if (iSteam) {
+ static const QString ALPHABET("23456789BCDFGHJKMNPQRTVWXY");
+ uint pass = iMiniHash;
+ // Steam codes always have 5 symbols, ignore the digit count.
+ // And YubiKey requires the number of digits to be at least 6,
+ // PUT command with 5 digits fails with code 6A80 (Wrong syntax)
+ for (uint i = 0; i < 5; i++) {
+ strPass.append(ALPHABET.at(pass % ALPHABET.size()));
+ pass /= ALPHABET.size();
+ }
+ } else {
+ uint maxPass = 10;
+ for (uint i = 1; i < iDigits; i++) {
+ maxPass *= 10;
+ }
+ const uint pass = iMiniHash % maxPass;
+ strPass = QString().sprintf("%0*u", iDigits, pass);
+ }
+
+ if (iPassword != strPass) {
+ iPassword = strPass;
+ return true;
+ } else {
+ return false;
+ }
}
YubiKeyTokenType
@@ -317,9 +347,6 @@
SignalCount
};
- static const QString SETTINGS_FILE;
- static const QString FAVORITE_ENTRY;
-
public:
Private(YubiKeyAuthListModel*);
~Private();
@@ -336,16 +363,15 @@
void updateMarkedForRefresh();
void updateMarkedForDeletion();
void markChanged(ModelData::Mark, QVector<int>*);
- QString getFavoriteName();
+ QString getFavoriteHash();
QVector<int> toggleMark(ModelData*, ModelData::Mark, bool);
- QStringList marked(ModelData::Mark aMark);
+ QStringList marked(ModelData::Mark);
public:
SignalMask iQueuedSignals;
Signal iFirstQueuedSignal;
YubiKeyAuthListModel* iModel;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKeyAuthListModel.h
^
|
@@ -1,6 +1,6 @@
/*
+ * Copyright (C) 2022-2023 Slava Monich <slava@monich.com>
* Copyright (C) 2022 Jolla Ltd.
- * Copyright (C) 2022 Slava Monich <slava@monich.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -8,27 +8,25 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -97,6 +95,7 @@
public Q_SLOTS:
void totpCodesExpired();
+ void tokenRenamed(const QString, const QString);
Q_SIGNALS:
void yubiKeyIdChanged();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKeyCard.cpp
^
|
@@ -8,27 +8,25 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -384,6 +382,9 @@
SIGNAL(operationIdsChanged()),
SIGNAL(operationIdsChanged())));
HVERIFY(card->connect(iYubiKey,
+ SIGNAL(tokenRenamed(QString,QString)),
+ SIGNAL(tokenRenamed(QString,QString))));
+ HVERIFY(card->connect(iYubiKey,
SIGNAL(operationFinished(int,bool)),
SIGNAL(operationFinished(int,bool))));
HVERIFY(connect(iYubiKey,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKeyCard.h
^
|
@@ -8,27 +8,25 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -144,6 +142,7 @@
void accessKeyNotAccepted();
void passwordChanged();
void passwordRemoved();
+ void tokenRenamed(const QString from, const QString to);
void operationFinished(int operationId, bool success);
private:
|
[-]
[+]
|
Added |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKeyCardSettings.cpp
^
|
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2023 Slava Monich <slava@monich.com>
+ *
+ * You may use this file under the terms of the BSD license as follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation
+ * are those of the authors and should not be interpreted as representing
+ * any official policies, either expressed or implied.
+ */
+
+#include "YubiKeyCardSettings.h"
+#include "YubiKeyUtil.h"
+
+#include "HarbourDebug.h"
+
+#include <QAtomicInt>
+#include <QSettings>
+
+// ==========================================================================
+// YubiKeyCardSettings::Private
+// ==========================================================================
+
+class YubiKeyCardSettings::Private :
+ public QObject
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(Private)
+
+ static QMap<QString,Private*> gMap;
+ static const QChar LIST_SEPARATOR;
+ static const QString SETTINGS_FILE;
+ static const QString FAVORITE_ENTRY;
+ static const QString STEAM_ENTRY;
+
+ Private(const QString);
+ ~Private();
+
+public:
+ static Private* get(const QString);
+ static QString getFavoriteHash(QSettings*);
+
+ Private* ref();
+ void unref();
+
+ bool isFavoriteName(const QString);
+ void setFavoriteHash(const QString);
+ void setSteamHashes(const QStringList);
+ void addSteamHash(const QString);
+ void removeSteamHash(const QString);
+ void steamHashesUpdated();
+ void tokenRenamed(const QString, const QString);
+
+Q_SIGNALS:
+ void favoriteHashChanged();
+ void steamHashesChanged();
+
+private:
+ QAtomicInt iRef;
+ QSettings* iSettings;
+
+public:
+ const QString iYubiKeyId;
+ QString iFavoriteHash;
+ QStringList iSteamHashes;
+};
+
+QMap<QString,YubiKeyCardSettings::Private*> YubiKeyCardSettings::Private::gMap;
+const QChar YubiKeyCardSettings::Private::LIST_SEPARATOR(':');
+const QString YubiKeyCardSettings::Private::SETTINGS_FILE("settings");
+const QString YubiKeyCardSettings::Private::FAVORITE_ENTRY("Favorite");
+const QString YubiKeyCardSettings::Private::STEAM_ENTRY("Steam");
+
+YubiKeyCardSettings::Private::Private(
+ const QString aYubiKeyId) :
+ iRef(1),
+ iSettings(Q_NULLPTR),
+ iYubiKeyId(aYubiKeyId)
+{
+ // Add is to the static map
+ HDEBUG(qPrintable(iYubiKeyId));
+ HASSERT(!gMap.value(iYubiKeyId));
+ gMap.insert(iYubiKeyId, this);
+
+ if (!iYubiKeyId.isEmpty()) {
+ QDir configDir(YubiKeyUtil::configDir());
+ const QString settingsFile(configDir.absoluteFilePath(iYubiKeyId) +
+ QDir::separator() + SETTINGS_FILE);
+
+ HDEBUG("Settings" << qPrintable(settingsFile));
+ configDir.mkpath(".");
+ iSettings = new QSettings(settingsFile, QSettings::IniFormat);
+ iFavoriteHash = getFavoriteHash(iSettings);
+ iSteamHashes = iSettings->value(STEAM_ENTRY).toString().split(LIST_SEPARATOR);
+ }
+}
+
+YubiKeyCardSettings::Private::~Private()
+{
+ // Remove it from the static map
+ HDEBUG(qPrintable(iYubiKeyId));
+ HASSERT(gMap.value(iYubiKeyId) == this);
+ gMap.remove(iYubiKeyId);
+
+ delete iSettings;
+}
+
+YubiKeyCardSettings::Private*
+YubiKeyCardSettings::Private::get(
+ const QString aYubiKeyId)
+{
+ Private* self = gMap.value(aYubiKeyId);
+ if (self) {
+ return self->ref();
+ } else {
+ return new Private(aYubiKeyId);
+ }
+}
+
+YubiKeyCardSettings::Private*
+YubiKeyCardSettings::Private::ref()
+{
+ iRef.ref();
+ return this;
+}
+
+void
+YubiKeyCardSettings::Private::unref()
+{
+ if (!iRef.deref()) {
+ delete this;
+ }
+}
+
+QString
+YubiKeyCardSettings::Private::getFavoriteHash(
+ QSettings* aSettings)
+{
+ if (aSettings) {
+ QString favorite(aSettings->value(FAVORITE_ENTRY).toString());
+ const int len = favorite.length();
+
+ if (len > 0) {
+ // Favorite name was originally stored in plain text
+ static const int Sha1Len = 20 * 2; // 2 hex digits per byte
+ bool isSha1 = false;
+
+ if (len == Sha1Len) {
+ isSha1 = true;
+ const QChar* chars = favorite.constData();
+ for (int i = 0; i < len && isSha1; i++) {
+ isSha1 = isxdigit(chars[i].unicode());
+ }
+ }
+ if (isSha1) {
+ return favorite;
+ } else {
+ QString hash(YubiKeyUtil::nameHash(favorite));
+
+ HDEBUG("Replacing favorite name" << favorite << "with" << hash);
+ aSettings->setValue(FAVORITE_ENTRY, hash);
+ return hash;
+ }
+ }
+ }
+ return QString();
+}
+
+bool
+YubiKeyCardSettings::Private::isFavoriteName(
+ const QString aName)
+{
+ return !aName.isEmpty() && iFavoriteHash == YubiKeyUtil::nameHash(aName);
+}
+
+void
|
[-]
[+]
|
Added |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKeyCardSettings.h
^
|
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2023 Slava Monich <slava@monich.com>
+ *
+ * You may use this file under the terms of the BSD license as follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation
+ * are those of the authors and should not be interpreted as representing
+ * any official policies, either expressed or implied.
+ */
+
+#ifndef _YUBIKEY_CARD_SETTINGS_H
+#define _YUBIKEY_CARD_SETTINGS_H
+
+#include <QObject>
+#include <QStringList>
+
+class YubiKeyCardSettings :
+ public QObject
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(YubiKeyCardSettings)
+
+public:
+ YubiKeyCardSettings(const QString, QObject* aParent = Q_NULLPTR);
+ ~YubiKeyCardSettings();
+
+ QString favoriteHash() const;
+ void setFavoriteHash(const QString);
+ bool isFavoriteName(const QString) const;
+ void setFavoriteName(const QString);
+ void clearFavorite();
+
+ QStringList steamHashes() const;
+ bool isSteamHash(const QString) const;
+ void setSteamHashes(const QStringList);
+ void addSteamHash(const QString);
+ void removeSteamHash(const QString);
+
+ void tokenRenamed(const QString, const QString);
+
+Q_SIGNALS:
+ void favoriteHashChanged();
+ void steamHashesChanged();
+
+private:
+ class Private;
+ Private* iPrivate;
+};
+
+#endif // _YUBIKEY_CARD_SETTINGS_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKeyTag.h
^
|
@@ -1,6 +1,6 @@
/*
+ * Copyright (C) 2022-2023 Slava Monich <slava@monich.com>
* Copyright (C) 2022 Jolla Ltd.
- * Copyright (C) 2022 Slava Monich <slava@monich.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -8,27 +8,25 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -90,10 +88,10 @@
virtual bool startOperation() = 0; // Locked and selected
virtual void operationCancelled();
virtual void operationFailed();
+ virtual void finished(bool aSuccess = true);
bool transmit(const NfcIsoDepApdu*);
bool transmit(const NfcIsoDepApdu*, TransmitDone);
- void finished(bool aSuccess = true);
public:
class Private;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKeyUtil.cpp
^
|
@@ -8,27 +8,25 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -45,6 +43,7 @@
#include "HarbourDebug.h"
#include <QStandardPaths>
+#include <QCryptographicHash>
const QString YubiKeyUtil::ALGORITHM_SHA1("SHA1");
const QString YubiKeyUtil::ALGORITHM_SHA256("SHA256");
@@ -64,6 +63,25 @@
return QDir(configDir().absoluteFilePath(YubiKeyUtil::toHex(aYubiKeyId)));
}
+QString
+YubiKeyUtil::hashUtf8(
+ const QByteArray& aUtf8)
+{
+ return QCryptographicHash::hash(aUtf8, QCryptographicHash::Sha1).toHex();
+}
+
+QString
+YubiKeyUtil::steamHashUtf8(
+ const QByteArray& aUtf8)
+{
+ // The same name gets a different hash for Steam and Favorite purposes
+ static QByteArray STEAM_PREFIX("steam:");
+ QCryptographicHash hash(QCryptographicHash::Sha1);
+ hash.addData(STEAM_PREFIX);
+ hash.addData(aUtf8);
+ return hash.result().toHex();
+}
+
uint
YubiKeyUtil::versionToNumber(
const uchar* aData,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/src/YubiKeyUtil.h
^
|
@@ -8,27 +8,25 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
+ * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -72,6 +70,13 @@
static QDir configDir();
static QDir configDir(const QByteArray);
+ static QString hashUtf8(const QByteArray&);
+ static QString steamHashUtf8(const QByteArray&);
+ static QString steamNameHash(const QString& aName)
+ { return steamHashUtf8(aName.toUtf8()); }
+ static QString nameHash(const QString& aName)
+ { return hashUtf8(aName.toUtf8()); }
+
static uint versionToNumber(const uchar*, gsize);
static inline uint versionToNumber(const QByteArray& aData)
{ return versionToNumber((uchar*)aData.constData(), aData.size()); }
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/translations/harbour-yubikey-ru.ts
^
|
@@ -48,10 +48,10 @@
<extracomment>Pulley menu item</extracomment>
<translation>Убрать пароль</translation>
</message>
- <message id="yubikey-menu-copy_password">
- <source>Copy password</source>
- <extracomment>Context menu item (copy password to clipboard)</extracomment>
- <translation>Скопировать пароль</translation>
+ <message id="yubikey-menu-edit">
+ <source>Edit</source>
+ <extracomment>Generic menu item</extracomment>
+ <translation>Изменить</translation>
</message>
<message id="yubikey-menu-rename">
<source>Rename</source>
@@ -83,10 +83,15 @@
<extracomment>Context menu item</extracomment>
<translation>Убрать с обложки</translation>
</message>
- <message id="yubikey-menu-edit">
- <source>Edit</source>
- <extracomment>Generic menu item</extracomment>
- <translation>Изменить</translation>
+ <message id="yubikey-menu-use_as_standard_token">
+ <source>Standard token</source>
+ <extracomment>Context menu item</extracomment>
+ <translation>Стандартный пароль</translation>
+ </message>
+ <message id="yubikey-menu-use_as_steam_token">
+ <source>Steam token</source>
+ <extracomment>Context menu item</extracomment>
+ <translation>Пароль Steam</translation>
</message>
<message id="yubikey-status-waiting_to_reset">
<source>Touch the same YubiKey to reset it</source>
@@ -249,9 +254,9 @@
<translation>%1 (по умолчанию)</translation>
</message>
<message id="yubikey-token-digits-text">
- <source>Digits</source>
+ <source>Digits (leave it 6 for Steam tokens)</source>
<extracomment>Text field label (number of password digits)</extracomment>
- <translation>Длина пароля</translation>
+ <translation>Длина пароля (оставьте 6 для паролей Steam)</translation>
</message>
<message id="yubikey-token-digits-placeholder">
<source>Number of password digits</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/translations/harbour-yubikey-sv.ts
^
|
@@ -48,10 +48,10 @@
<extracomment>Pulley menu item</extracomment>
<translation>Ta bort lösenord</translation>
</message>
- <message id="yubikey-menu-copy_password">
- <source>Copy password</source>
- <extracomment>Context menu item (copy password to clipboard)</extracomment>
- <translation>Kopiera lösenord</translation>
+ <message id="yubikey-menu-edit">
+ <source>Edit</source>
+ <extracomment>Generic menu item</extracomment>
+ <translation>Redigera</translation>
</message>
<message id="yubikey-menu-rename">
<source>Rename</source>
@@ -83,10 +83,15 @@
<extracomment>Context menu item</extracomment>
<translation>Ta bort från programminiatyr</translation>
</message>
- <message id="yubikey-menu-edit">
- <source>Edit</source>
- <extracomment>Generic menu item</extracomment>
- <translation>Redigera</translation>
+ <message id="yubikey-menu-use_as_standard_token">
+ <source>Standard token</source>
+ <extracomment>Context menu item</extracomment>
+ <translation type="unfinished">Standard token</translation>
+ </message>
+ <message id="yubikey-menu-use_as_steam_token">
+ <source>Steam token</source>
+ <extracomment>Context menu item</extracomment>
+ <translation type="unfinished">Steam-token</translation>
</message>
<message id="yubikey-status-waiting_to_reset">
<source>Touch the same YubiKey to reset it</source>
@@ -249,9 +254,9 @@
<translation>%1 (standard)</translation>
</message>
<message id="yubikey-token-digits-text">
- <source>Digits</source>
+ <source>Digits (leave it 6 for Steam tokens)</source>
<extracomment>Text field label (number of password digits)</extracomment>
- <translation>Siffror</translation>
+ <translation type="unfinished">Siffror (låt det vara 6 för Steam-tokens)</translation>
</message>
<message id="yubikey-token-digits-placeholder">
<source>Number of password digits</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-yubikey-1.0.8.tar.gz/translations/harbour-yubikey.ts
^
|
@@ -48,10 +48,10 @@
<extracomment>Pulley menu item</extracomment>
<translation>Clear password</translation>
</message>
- <message id="yubikey-menu-copy_password">
- <source>Copy password</source>
- <extracomment>Context menu item (copy password to clipboard)</extracomment>
- <translation>Copy password</translation>
+ <message id="yubikey-menu-edit">
+ <source>Edit</source>
+ <extracomment>Generic menu item</extracomment>
+ <translation>Edit</translation>
</message>
<message id="yubikey-menu-rename">
<source>Rename</source>
@@ -83,10 +83,15 @@
<extracomment>Context menu item</extracomment>
<translation>Remove from cover</translation>
</message>
- <message id="yubikey-menu-edit">
- <source>Edit</source>
- <extracomment>Generic menu item</extracomment>
- <translation>Edit</translation>
+ <message id="yubikey-menu-use_as_standard_token">
+ <source>Standard token</source>
+ <extracomment>Context menu item</extracomment>
+ <translation>Standard token</translation>
+ </message>
+ <message id="yubikey-menu-use_as_steam_token">
+ <source>Steam token</source>
+ <extracomment>Context menu item</extracomment>
+ <translation>Steam token</translation>
</message>
<message id="yubikey-status-waiting_to_reset">
<source>Touch the same YubiKey to reset it</source>
@@ -249,9 +254,9 @@
<translation>%1 (default)</translation>
</message>
<message id="yubikey-token-digits-text">
- <source>Digits</source>
+ <source>Digits (leave it 6 for Steam tokens)</source>
<extracomment>Text field label (number of password digits)</extracomment>
- <translation>Digits</translation>
+ <translation>Digits (leave it 6 for Steam tokens)</translation>
</message>
<message id="yubikey-token-digits-placeholder">
<source>Number of password digits</source>
|