From e9be04de37c192ed1ab274e278be3ce89c9c4cde Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Fri, 6 Jul 2012 16:05:26 -0400 Subject: [PATCH] Fix to finish feature/commands merge (#28). --- earwigbot/config.py | 3 +++ setup.py | 1 + 2 files changed, 4 insertions(+) diff --git a/earwigbot/config.py b/earwigbot/config.py index 6e7387f..16978f5 100644 --- a/earwigbot/config.py +++ b/earwigbot/config.py @@ -27,6 +27,7 @@ import logging.handlers from os import mkdir, path from Crypto.Cipher import Blowfish +import bcrypt import yaml from earwigbot.exceptions import NoConfigError @@ -263,6 +264,8 @@ class BotConfig(object): if not self._decryption_cipher: key = getpass("Enter key to decrypt bot passwords: ") self._decryption_cipher = Blowfish.new(sha256(key).digest()) + signature = self.metadata["signature"] + assert bcrypt.hashpw(key, signature) == signature for node, nodes in self._decryptable_nodes: self._decrypt(node, nodes) diff --git a/setup.py b/setup.py index d687e96..9db6676 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,7 @@ setup( "mwparserfromhell >= 0.1", # Wikicode parsing "oursql >= 0.9.3", # Talking with MediaWiki databases "oauth2 >= 1.5.211", # Talking with Yahoo BOSS Search + "py-bcrypt >= 0.2", # Password hashing in config "pycrypto >= 2.5", # Storing bot passwords and keys "pytz >= 2012c", # Timezone handling ],