From 884f2010cd0698519616d997cecc28cb32145029 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 10 Feb 2019 00:15:30 -0500 Subject: [PATCH] remove bcrypt dependency With oragono 6f2b610736 we can now pipe to `oragono genpasswd` instead --- irctest/controllers/oragono.py | 8 +++++--- requirements.txt | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/irctest/controllers/oragono.py b/irctest/controllers/oragono.py index c9982c1..4b26f03 100644 --- a/irctest/controllers/oragono.py +++ b/irctest/controllers/oragono.py @@ -2,8 +2,6 @@ import os import time import subprocess -import bcrypt - from irctest.basecontrollers import NotImplementedByController from irctest.basecontrollers import BaseServerController, DirectoryBasedController @@ -86,7 +84,11 @@ history: def hash_password(password): if isinstance(password, str): password = password.encode('utf-8') - return bcrypt.hashpw(password, bcrypt.gensalt(4)).decode('utf-8') + # simulate entry of password and confirmation: + input_ = password + b'\n' + password + b'\n' + p = subprocess.Popen(['oragono', 'genpasswd'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) + out, _ = p.communicate(input_) + return out.decode('utf-8') class OragonoController(BaseServerController, DirectoryBasedController): software_name = 'Oragono' diff --git a/requirements.txt b/requirements.txt index 02ef1b7..d18fa09 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,3 @@ limnoria > 2012.08.04 # Needs MultipleReplacer, from 1a64f105 psutil >= 3.1.0 # Fixes #640 ecdsa pyxmpp2_scram -bcrypt