Removed the dependency for QCA for now. Using sha1 instead of sha512 for signatures is enough
This commit is contained in:
parent
3bdada5b88
commit
c958ef46f1
2 changed files with 0 additions and 19 deletions
|
@ -34,9 +34,6 @@ CONFIGURE_FILE(
|
|||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/parsed/)
|
||||
|
||||
FIND_PACKAGE(QCA REQUIRED)
|
||||
SET( Plugin_LIBRARIES ${QCA_LIBRARY} )
|
||||
|
||||
SET(TELLDUS_LIVE_PUBLIC_KEY "" CACHE STRING "Telldus Live! public key")
|
||||
SET(TELLDUS_LIVE_PRIVATE_KEY "" CACHE STRING "Telldus Live! private key")
|
||||
SET(TELLDUS_LIVE_URI "https://api.telldus.com/server/assign" CACHE STRING "Telldus Live! Connection URI")
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <QtNetwork>
|
||||
#include <QtCore>
|
||||
#include <QDesktopServices>
|
||||
#include <QtCrypto>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <QDebug>
|
||||
|
@ -18,7 +17,6 @@ public:
|
|||
bool registered;
|
||||
QUrl registerUrl;
|
||||
QString uuid, hashMethod;
|
||||
QCA::Initializer qcaInit;
|
||||
QNetworkAccessManager *manager;
|
||||
QList<Server> serverList;
|
||||
QDateTime serverRefreshTime;
|
||||
|
@ -36,12 +34,6 @@ LiveObject::LiveObject( QScriptEngine *engine, QObject * parent )
|
|||
{
|
||||
d = new PrivateData;
|
||||
d->hashMethod = "sha1";
|
||||
foreach(QString hash, QStringList() << "sha512" << "sha256") {
|
||||
if (QCA::isSupported(hash.toUtf8())) {
|
||||
d->hashMethod = hash;
|
||||
break;
|
||||
}
|
||||
}
|
||||
d->registered = false;
|
||||
d->socket = new QSslSocket(this);
|
||||
d->socket->setProtocol( QSsl::TlsV1 );
|
||||
|
@ -264,14 +256,6 @@ void LiveObject::serverAssignReply( QNetworkReply *r ) {
|
|||
}
|
||||
|
||||
QByteArray LiveObject::signatureForMessage( const QByteArray &message ) {
|
||||
if (QCA::isSupported(d->hashMethod.toUtf8())) {
|
||||
QCA::Hash signature(d->hashMethod);
|
||||
signature.update(message);
|
||||
signature.update(TELLDUS_LIVE_PRIVATE_KEY);
|
||||
return signature.final().toByteArray().toHex();
|
||||
}
|
||||
|
||||
//Fallback to builtin function
|
||||
QCryptographicHash signature( QCryptographicHash::Sha1 );
|
||||
signature.addData(message);
|
||||
signature.addData(TELLDUS_LIVE_PRIVATE_KEY);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue