]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Remove janky getpass implementations
authorNick Mathewson <nickm@torproject.org>
Wed, 17 Jun 2015 15:52:54 +0000 (11:52 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 25 Jun 2015 14:52:47 +0000 (10:52 -0400)
src/common/compat.c

index 4a35183f38d8503fe4b5e5eaba588fd8ca64a90c..6e46f277f82f6191ca0e104eec94ff21b9baccbb 100644 (file)
@@ -3321,22 +3321,7 @@ tor_getpass(const char *prompt, char *output, size_t buflen)
   SecureZeroMemory(buf, sizeof(wchar_t)*buflen);
   tor_free(buf);
   return r;
-#elif defined(HAVE_GETPASS)
-  /* XXX We shouldn't actually use this; it's deprecated to hell and back */
-  memset(output, 0, buflen);
-  char *pwd = getpass(prompt);
-  if (pwd == NULL)
-    return -1;
-  ssize_t len = (ssize_t)strlen(pwd);
-  strlcpy(output, pwd, buflen);
-  memset(pwd, 0, len);
-  return len;
 #else
-  /* XXX This is even worse. */
-  puts(prompt);
-  ssize_t n = read(STDIN_FILENO, output, buflen);
-  if (n < 0)
-    return -1;
-  return n;
+#error "No implementation for tor_getpass found!"
 #endif
 }