summaryrefslogtreecommitdiffstats
path: root/common/rfb/CSecurityPlain.cxx
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2010-09-02 12:37:00 +0000
committerAdam Tkac <atkac@redhat.com>2010-09-02 12:37:00 +0000
commit8c0483823727cb6e1e94ea9b12fc4b65a4b5204a (patch)
treeba71617ad1579448495ed1fc019e69cbbdf07c15 /common/rfb/CSecurityPlain.cxx
parent7b404a8263353c8480043b412b71794feb280ede (diff)
downloadtigervnc-8c0483823727cb6e1e94ea9b12fc4b65a4b5204a.tar.gz
tigervnc-8c0483823727cb6e1e94ea9b12fc4b65a4b5204a.zip
[Development] Implement *Plain types on the client side.
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4127 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/CSecurityPlain.cxx')
-rw-r--r--common/rfb/CSecurityPlain.cxx43
1 files changed, 43 insertions, 0 deletions
diff --git a/common/rfb/CSecurityPlain.cxx b/common/rfb/CSecurityPlain.cxx
new file mode 100644
index 00000000..8aec0def
--- /dev/null
+++ b/common/rfb/CSecurityPlain.cxx
@@ -0,0 +1,43 @@
+/* Copyright (C) 2005 Martin Koegler
+ * Copyright (C) 2010 TigerVNC Team
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ */
+
+#include <rfb/CConnection.h>
+#include <rfb/CSecurityPlain.h>
+#include <rfb/UserPasswdGetter.h>
+#include <rfb/util.h>
+
+using namespace rfb;
+
+bool CSecurityPlain::processMsg(CConnection* cc)
+{
+ rdr::OutStream* os = cc->getOutStream();
+
+ CharArray username;
+ CharArray password;
+
+ (CSecurity::upg)->getUserPasswd(&username.buf, &password.buf);
+
+ // Return the response to the server
+ os->writeU32(strlen(username.buf));
+ os->writeU32(strlen(password.buf));
+ os->writeBytes(username.buf,strlen(username.buf));
+ os->writeBytes(password.buf,strlen(password.buf));
+ os->flush();
+ return true;
+}