Commit 21664f27 authored by Jan Möbius's avatar Jan Möbius

Ignore inactive interfaces in Licensemanager

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10807 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ba089ac6
......@@ -160,6 +160,12 @@ bool LicenseManager::authenticate() {
if ( ( netInterface.flags() & QNetworkInterface::IsLoopBack ) ) {
continue;
}
// Ignore offline interfaces
if ( ! ( netInterface.flags() & QNetworkInterface::IsUp ) ) {
std::cerr << "Not up" << std::endl;
continue;
}
// Ignore non ethernet macs
if ( netInterface.hardwareAddress().count(":") != 5 ) {
......@@ -173,8 +179,12 @@ bool LicenseManager::authenticate() {
macHashes.push_back(currentMac);
}
std::cerr << "Got " << macHashes.size() << " Interfaces" << std::endl;
// cleanup the list from duplicates (virtual interfaces on windows connected to an existing device ... )
macHashes.removeDuplicates();
std::cerr << "Got " << macHashes.size() << " Interfaces after cleanup" << std::endl;
// generate hashes
for (int i = 0 ; i < macHashes.size(); ++i )
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>812</width>
<width>989</width>
<height>727</height>
</rect>
</property>
......
......@@ -166,14 +166,10 @@ void KeyGenWidget::slotAnalyze() {
QString licenseTmp = saltPre + expiryDate + name + coreHash + pluginHash + cpuHash + productHash + macHashes.join("") + saltPost;
QString licenseHash = QCryptographicHash::hash ( licenseTmp.toAscii() , QCryptographicHash::Sha1 ).toHex();
std::cerr << "license : " << licenseTmp.toStdString() << std::endl;
std::cerr << "hash : " << licenseHash.toStdString() << std::endl;
// Prepend signature
license_ = licenseHash + "\n" + license_;
std::cerr << "Full license : " << license_.toStdString() << std::endl;
std::cerr << "Full license : \n" << license_.toStdString() << std::endl;
valid_ = true;
......
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