##// END OF EJS Templates
Merged r7985 from trunk....
Jean-Philippe Lang -
r7877:5d1388db02a2
parent child
Show More
@@ -23,7 +23,7 module Redmine
23
23
24 class << self
24 class << self
25 def encrypt_text(text)
25 def encrypt_text(text)
26 if cipher_key.blank?
26 if cipher_key.blank? || text.blank?
27 text
27 text
28 else
28 else
29 c = OpenSSL::Cipher::Cipher.new("aes-256-cbc")
29 c = OpenSSL::Cipher::Cipher.new("aes-256-cbc")
@@ -43,6 +43,14 class Redmine::CipheringTest < ActiveSupport::TestCase
43 end
43 end
44 end
44 end
45
45
46 def test_blank_password_should_be_clear
47 Redmine::Configuration.with 'database_cipher_key' => 'secret' do
48 r = Repository::Subversion.generate!(:password => '')
49 assert_equal '', r.password
50 assert_equal '', r.read_attribute(:password)
51 end
52 end
53
46 def test_unciphered_password_should_be_readable
54 def test_unciphered_password_should_be_readable
47 Redmine::Configuration.with 'database_cipher_key' => nil do
55 Redmine::Configuration.with 'database_cipher_key' => nil do
48 r = Repository::Subversion.generate!(:password => 'clear')
56 r = Repository::Subversion.generate!(:password => 'clear')
General Comments 0
You need to be logged in to leave comments. Login now