aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-13 12:47:48 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commitb99daadb05e14e85da6c5e905057e10fc27c0fcf (patch)
tree752e6fea3900b604d44ef6a498539e9a785bf22f /vncviewer
parente6c5b29f12780303299506fe04f089bc98b80c91 (diff)
downloadtigervnc-b99daadb05e14e85da6c5e905057e10fc27c0fcf.tar.gz
tigervnc-b99daadb05e14e85da6c5e905057e10fc27c0fcf.zip
Use std::string instead of CharArray
Let's use a more common type instead of something homegrown. Should be more familiar to new developers.
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/ServerDialog.cxx1
-rw-r--r--vncviewer/UserDialog.cxx9
2 files changed, 5 insertions, 5 deletions
diff --git a/vncviewer/ServerDialog.cxx b/vncviewer/ServerDialog.cxx
index db39cd59..ec1e40e4 100644
--- a/vncviewer/ServerDialog.cxx
+++ b/vncviewer/ServerDialog.cxx
@@ -38,6 +38,7 @@
#include <os/os.h>
#include <rfb/Exception.h>
#include <rfb/LogWriter.h>
+#include <rfb/util.h>
#include "fltk/layout.h"
#include "ServerDialog.h"
diff --git a/vncviewer/UserDialog.cxx b/vncviewer/UserDialog.cxx
index ff5b6123..7f8b3c8e 100644
--- a/vncviewer/UserDialog.cxx
+++ b/vncviewer/UserDialog.cxx
@@ -34,8 +34,8 @@
#include <FL/Fl_Return_Button.H>
#include <FL/Fl_Pixmap.H>
-#include <rfb/Password.h>
#include <rfb/Exception.h>
+#include <rfb/obfuscate.h>
#include "fltk/layout.h"
#include "fltk/util.h"
@@ -91,18 +91,17 @@ void UserDialog::getUserPasswd(bool secure, std::string* user,
}
if (!user && passwordFileName[0]) {
- ObfuscatedPasswd obfPwd(256);
+ std::vector<uint8_t> obfPwd(256);
FILE* fp;
fp = fopen(passwordFileName, "rb");
if (!fp)
throw rfb::Exception(_("Opening password file failed"));
- obfPwd.length = fread(obfPwd.buf, 1, obfPwd.length, fp);
+ obfPwd.resize(fread(obfPwd.data(), 1, obfPwd.size(), fp));
fclose(fp);
- PlainPasswd passwd(obfPwd);
- *password = passwd.buf;
+ *password = deobfuscate(obfPwd.data(), obfPwd.size());
return;
}