push
travis-ci-com
51 of 51 new or added lines in 7 files covered. (100.0%)
10597 of 12035 relevant lines covered (88.05%)
953.77 hits per line
1 |
class SlackSmartBot |
3✔ |
2 |
def decrypt(data) |
3✔ |
3 |
if config.encrypt
|
27✔ |
4 |
require "openssl"
|
27✔ |
5 |
require "base64"
|
27✔ |
6 |
|
|
7 |
key, iv = encryption_get_key_iv() |
27✔ |
8 |
encrypted = Base64.decode64(data)
|
27✔ |
9 |
cipher = OpenSSL::Cipher.new("AES-256-CBC") |
27✔ |
10 |
cipher.decrypt |
27✔ |
11 |
cipher.key = key |
27✔ |
12 |
cipher.iv = iv |
27✔ |
13 |
plain = cipher.update(encrypted) + cipher.final |
27✔ |
14 |
return plain
|
27✔ |
15 |
else
|
|
16 |
return data
|
× |
17 |
end
|
|
18 |
end
|
|
19 |
end
|