Permalink
Browse files

rubies work here, need to fix an issue with openssl ciphers for it to…

… wokr on travis
  • Loading branch information...
1 parent 6ededa1 commit 525dc28dc966f257afe83268a087be608e01215c Philip (flip) Kromer committed Aug 13, 2012
@@ -20,10 +20,9 @@ module Configliere
#
module Crypter
CIPHER_TYPE = "aes-256-cbc" unless defined?(CIPHER_TYPE)
-
- def self.check_platform_can_encrypt!
- return if not PLATFORM_ENCRYPTION_ERROR
- raise "Encryption broken on this platform: #{PLATFORM_ENCRYPTION_ERROR}"
+ def check_platform_can_encrypt!
+ return true unless PLATFORM_ENCRYPTION_ERROR
+ raise PLATFORM_ENCRYPTION_ERROR.class, "Encryption broken on this platform: #{PLATFORM_ENCRYPTION_ERROR}"
end
#
No changes.
@@ -24,7 +24,7 @@ module Configliere ; module Crypter ; CIPHER_TYPE = 'aes-128-cbc' ; end ; end
let(:foo_val_iv){ Base64.decode64(encrypted_foo_val)[0..15] }
- describe "Crypter", :if => check_openssl do
+ describe "Crypter" do
it "encrypts" do
# Force the same initialization vector as used to prepare the test value
@cipher = Configliere::Crypter.send(:new_cipher, :encrypt, 'sekrit')
View
@@ -38,14 +38,13 @@ def capture_help_message
def check_openssl
load_sketchy_lib('openssl') do
- # p OpenSSL::Cipher.ciphers
cipher = OpenSSL::Cipher::Cipher.new('aes-128-cbc')
cipher.encrypt
cipher.key = Digest::SHA256.digest("HI JRUBY")
cipher.iv = iv = cipher.random_iv
ciphertext = cipher.update("O HAI TO YOU!")
ciphertext << cipher.final
- p [__LINE__, '128-bit encryption is OK', ciphertext]
+ # p [__LINE__, '128-bit encryption is OK', ciphertext]
# cipher = OpenSSL::Cipher::Cipher.new('aes-256-cbc')
# cipher.encrypt
# cipher.key = Digest::SHA256.digest("HI JRUBY")

0 comments on commit 525dc28

Please sign in to comment.