QTfrontend/newnetclient.cpp
changeset 1844 81abed9d4c11
parent 1842 96a4757dfeb8
child 1856 e71dbf958c87
--- a/QTfrontend/newnetclient.cpp	Wed Feb 25 17:36:02 2009 +0000
+++ b/QTfrontend/newnetclient.cpp	Thu Feb 26 06:39:20 2009 +0000
@@ -18,6 +18,9 @@
  */
 
 #include <QDebug>
+#include <QInputDialog>
+
+#include <QtCrypto>
 
 #include "hwconsts.h"
 #include "newnetclient.h"
@@ -429,7 +432,14 @@
 	}
 
 	if (lst[0] == "ASKPASSWORD") {
-		RawSendNet(QString("PASSWORD"));
+		QString password = QInputDialog::getText(0, tr("Password"), tr("Enter your password:"), QLineEdit::Password);
+
+		QCA::Initializer qcaInit;
+		QCA::Hash shaHash("md5");
+		shaHash.update(password.toLatin1());
+		QByteArray hashResult = shaHash.final().toByteArray();
+		
+		RawSendNet(QString("PASSWORD%1%2").arg(delimeter).arg(QCA::arrayToHex(hashResult)));
 		return;
 	}