[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdenetwork/krfb
From: George Goldberg <grundleborg () googlemail ! com>
Date: 2010-10-23 19:30:35
Message-ID: 20101023193035.5602BAC899 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1189034 by gberg:
checkPassword() is not needed by the AbstractConnectionController, so move it to \
KRfbConnectionController and make it static.
Fixes one of gkiagia's review comments.
M +0 -20 abstractconnectioncontroller.cpp
M +0 -2 abstractconnectioncontroller.h
M +20 -0 krfbconnectioncontroller.cpp
--- trunk/KDE/kdenetwork/krfb/abstractconnectioncontroller.cpp #1189033:1189034
@@ -37,26 +37,6 @@
cc->handleClientGone();
}
-bool checkPassword(const QString &p, unsigned char *ochallenge, const char \
*response, int len)
-{
- if ((len == 0) && (p.length() == 0)) {
- return true;
- }
-
- char passwd[MAXPWLEN];
- unsigned char challenge[CHALLENGESIZE];
-
- memcpy(challenge, ochallenge, CHALLENGESIZE);
- bzero(passwd, MAXPWLEN);
- if (!p.isNull()) {
- strncpy(passwd, p.toLatin1(),
- (MAXPWLEN <= p.length()) ? MAXPWLEN : p.length());
- }
-
- rfbEncryptBytes(challenge, passwd);
- return memcmp(challenge, response, len) == 0;
-}
-
AbstractConnectionController::AbstractConnectionController(struct _rfbClientRec \
*_cl,
AbstractRfbServer \
*parent) : QObject(parent),
--- trunk/KDE/kdenetwork/krfb/abstractconnectioncontroller.h #1189033:1189034
@@ -28,8 +28,6 @@
class AbstractRfbServer;
-bool checkPassword(const QString &p, unsigned char *ochallenge, const char \
*response, int len);
-
class AbstractConnectionController : public QObject
{
Q_OBJECT
--- trunk/KDE/kdenetwork/krfb/krfbconnectioncontroller.cpp #1189033:1189034
@@ -47,6 +47,26 @@
#include <X11/Xutil.h>
+static bool checkPassword(const QString &p, unsigned char *ochallenge, const char \
*response, int len) +{
+ if ((len == 0) && (p.length() == 0)) {
+ return true;
+ }
+
+ char passwd[MAXPWLEN];
+ unsigned char challenge[CHALLENGESIZE];
+
+ memcpy(challenge, ochallenge, CHALLENGESIZE);
+ bzero(passwd, MAXPWLEN);
+ if (!p.isNull()) {
+ strncpy(passwd, p.toLatin1(),
+ (MAXPWLEN <= p.length()) ? MAXPWLEN : p.length());
+ }
+
+ rfbEncryptBytes(challenge, passwd);
+ return memcmp(challenge, response, len) == 0;
+}
+
KrfbConnectionController::KrfbConnectionController(struct _rfbClientRec *_cl,
AbstractRfbServer * parent)
: AbstractConnectionController(_cl, parent),
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic