Compare commits

...

5 Commits

Author SHA1 Message Date
Alexey Sokolov 1c182775e6 Bring version number back to 1.6.x 5 years ago
Alexey Sokolov 31e43ffc03 Increase the version number to 1.6.6 5 years ago
Alexey Sokolov ab8a759065 ZNC 1.6.6-rc1 5 years ago
Alexey Sokolov 237fbc9665 Fix use-after-free in znc --makepem 5 years ago
Alexey Sokolov ce4dff3b20 Use termios instead of deprecated getpass(). 5 years ago
  1. 12
      ChangeLog.md
  2. 2
      configure.ac
  3. 22
      src/Utils.cpp

12
ChangeLog.md

@ -1,6 +1,14 @@
# ZNC 1.6.5 (2017-03-12)
# ZNC 1.6.6 (2018-03-05)
## Fixes
* Fix use-after-free in `znc --makepem`. It was broken for a long time, but
started segfaulting only now. This is a useability fix, not a security fix,
because self-signed (or signed by a CA) certificates can be created
without using `--makepem`, and then combined into znc.pem.
* Fix build on Cygwin.
# ZNC 1.6.5 (2017-03-12)
* Fixed a regression of 1.6.4 which caused a crash in modperl/modpython.
* Fixed the behavior of `verbose` command in the sasl module.

2
configure.ac

@ -240,7 +240,7 @@ if test "$POLL" = "yes"; then
fi
AC_CHECK_LIB( gnugetopt, getopt_long,)
AC_CHECK_FUNCS([lstat getopt_long getpassphrase])
AC_CHECK_FUNCS([lstat getopt_long getpassphrase tcsetattr])
# ----- Check for dlopen

22
src/Utils.cpp

@ -31,6 +31,10 @@
#include <unistd.h>
#include <time.h>
#ifdef HAVE_TCSETATTR
#include <termios.h>
#endif
#ifdef HAVE_ICU
#include <unicode/ucnv.h>
#include <unicode/errorcode.h>
@ -112,7 +116,6 @@ void CUtils::GenerateCert(FILE *pOut, const CString& sHost) {
X509_NAME_add_entry_by_txt(pName, "CN", MBSTRING_ASC, (unsigned char *)pHostName, -1, -1, 0);
X509_NAME_add_entry_by_txt(pName, "emailAddress", MBSTRING_ASC, (unsigned char *)sEmailAddr.c_str(), -1, -1, 0);
X509_set_subject_name(pCert.get(), pName);
X509_set_issuer_name(pCert.get(), pName);
if (!X509_sign(pCert.get(), pKey.get(), EVP_sha256()))
@ -197,12 +200,29 @@ CString CUtils::SaltedSHA256Hash(const CString& sPass, const CString& sSalt) {
}
CString CUtils::GetPass(const CString& sPrompt) {
#ifdef HAVE_TCSETATTR
// Disable echo
struct termios t;
tcgetattr(1, &t);
struct termios t2 = t;
t2.c_lflag &= ~ECHO;
tcsetattr(1, TCSANOW, &t2);
// Read pass
CString r;
GetInput(sPrompt, r);
// Restore echo and go to new line
tcsetattr(1, TCSANOW, &t);
fprintf(stdout, "\n");
fflush(stdout);
return r;
#else
PrintPrompt(sPrompt);
#ifdef HAVE_GETPASSPHRASE
return getpassphrase("");
#else
return getpass("");
#endif
#endif
}
bool CUtils::GetBoolInput(const CString& sPrompt, bool bDefault) {

Loading…
Cancel
Save