Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Feb 28, 2018
1 parent a6cb36c commit 6d62f79
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/tests/modules/cipher/rsa_encrypt_decrypt.unlang
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,39 @@ if (&Tmp-Octets-0 == &Tmp-Octets-1) {
else {
test_pass
}

#
# Repeat tests to ensure there are no issues with EVP_PKEY_CTX reuse
#
update request {
&Tmp-String-0 := "Goodbye world!"
}

update request {
&Tmp-Octets-0 := "%{cipher_rsa_encrypt:%{Tmp-String-0}}"
}

if (!&Tmp-Octets-0) {
test_fail
}
else {
test_pass
}

if (<octets>&Tmp-String-0[0] == &Tmp-Octets-0[0]) {
test_fail
}
else {
test_pass
}

update request {
&Tmp-String-1 := "%{cipher_rsa_decrypt:%{Tmp-Octets-0}}"
}

if (&Tmp-String-0 != &Tmp-String-1) {
test_fail
}
else {
test_pass
}

0 comments on commit 6d62f79

Please sign in to comment.