spec/parser_spec.rb in lastpass-1.2.0 vs spec/parser_spec.rb in lastpass-1.2.1

- old
+ new

@@ -314,13 +314,13 @@ check "YWJj", "abc" check "YWJjZA==", "abcd" end end - describe ".decode_aes256_auto" do + describe ".decode_aes256_plain_auto" do def check encoded, decoded - expect(LastPass::Parser.decode_aes256_auto encoded, encryption_key) + expect(LastPass::Parser.decode_aes256_plain_auto encoded, encryption_key) .to eq decoded end it "decodes a blank string" do check "", "" @@ -329,16 +329,27 @@ it "decodes ECB/plain string" do check "BNhd3Q3ZVODxk9c0C788NUPTIfYnZuxXfkghtMJ8jVM=".decode64, "All your base are belong to us" end - it "decodes ECB/base64 string" do - check "BNhd3Q3ZVODxk9c0C788NUPTIfYnZuxXfkghtMJ8jVM=", + it "decodes CBC/plain string" do + check "IcokDWmjOkKtLpZehWKL6666Uj6fNXPpX6lLWlou+1Lrwb+D3ymP6BAwd6C0TB3hSA==".decode64, "All your base are belong to us" end + end - it "decodes CBC/plain string" do - check "IcokDWmjOkKtLpZehWKL6666Uj6fNXPpX6lLWlou+1Lrwb+D3ymP6BAwd6C0TB3hSA==".decode64, + describe ".decode_aes256_base64_auto" do + def check encoded, decoded + expect(LastPass::Parser.decode_aes256_base64_auto encoded, encryption_key) + .to eq decoded + end + + it "decodes a blank string" do + check "", "" + end + + it "decodes ECB/base64 string" do + check "BNhd3Q3ZVODxk9c0C788NUPTIfYnZuxXfkghtMJ8jVM=", "All your base are belong to us" end it "decodes CBC/base64 string" do check "!YFuiAVZgOD2K+s6y8yaMOw==|TZ1+if9ofqRKTatyUaOnfudletslMJ/RZyUwJuR/+aI=",