diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-06-19 13:43:59 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-06-19 13:43:59 -0400 |
commit | 482051f595c23819d35f5e7cc38b1675e90a2c89 (patch) | |
tree | 1a64be1edb083ad66b6c2e9cd2b03cbb86b43392 /src | |
parent | bc7fe61e6bbbc3c94275c85b674c7ee6c73fd5f7 (diff) | |
download | bcfg2-482051f595c23819d35f5e7cc38b1675e90a2c89.tar.gz bcfg2-482051f595c23819d35f5e7cc38b1675e90a2c89.tar.bz2 bcfg2-482051f595c23819d35f5e7cc38b1675e90a2c89.zip |
fixed decryption of Properties files
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Properties.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Properties.py b/src/lib/Bcfg2/Server/Plugins/Properties.py index 0271e89ba..33c9e1909 100644 --- a/src/lib/Bcfg2/Server/Plugins/Properties.py +++ b/src/lib/Bcfg2/Server/Plugins/Properties.py @@ -83,19 +83,20 @@ class PropertyFile(Bcfg2.Server.Plugin.StructFile): raise Bcfg2.Server.PluginExecutionError(msg) def _decrypt(self, element): - passphrases = passphrases() + if not element.text.strip(): + return + passes = passphrases() try: - passphrase = passphrases[element.get("encrypted")] + passphrase = passes[element.get("encrypted")] try: - return ssl_decrypt(crypted, self.passphrase) + return ssl_decrypt(element.text, passphrase) except EVPError: # error is raised below pass except KeyError: - for passwd in passphrases.values(): + for passwd in passes.values(): try: - rv = ssl_decrypt(crypted, passwd) - return rv + return ssl_decrypt(element.text, passwd) except EVPError: pass raise EVPError("Failed to decrypt") |