Get all the MD5 key generation/matching functional for the server/bridge. Also add an internal 1 minute timer to the bridge connections just to check/remove any broken connections as necessary.

This commit is contained in:
Ken Moore
2016-05-23 10:31:49 -04:00
parent 376a903991
commit 2ac91c7c70
4 changed files with 34 additions and 11 deletions

View File

@@ -142,10 +142,16 @@ void AuthorizationManager::ListCertificateChecksums(QJsonObject *out){
keys.sort();
QJsonArray arr;
QCryptographicHash chash(QCryptographicHash::Md5);
//qDebug() << "MD5 Generation:";
for(int i=0; i<keys.length(); i++){
chash.addData( keys[i].section("/",2,-1).toLocal8Bit() );
//qDebug() << "User:" << keys[i].section("/",1,1);
QByteArray key = QByteArray::fromBase64( keys[i].section("/",2,-1).toLocal8Bit() ); //remember that the keys are stored internally as base64-encoded strings
//qDebug() << " - Key:" << key;
chash.addData( key );
QByteArray res = chash.result();
//qDebug() << " - md5:" << res;
chash.reset();
//qDebug() << " - base64:" << res.toBase64();
arr << QString(res.toBase64());
}
out->insert("md5_keys", arr);