aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIvan Stakhov <50211739+LeftTry@users.noreply.github.com>2024-08-17 23:47:01 +0600
committerGitHub <noreply@github.com>2024-08-17 18:47:01 +0100
commit1e661a2fc6e31aa0c5be710dde274ec199ff3853 (patch)
tree16ce70912222eec16281cce05d7670401fe931f6 /test
parent65f250ee4ea3bced33af0f7b4f56f404906e631b (diff)
downloadrspamd-1e661a2fc6e31aa0c5be710dde274ec199ff3853.tar.gz
rspamd-1e661a2fc6e31aa0c5be710dde274ec199ff3853.zip
Provide OpenSSL 3.0 support for lua_rsa (#5101)
* [Fix] Provide OSSL 3.0 support for lua_rsa (not working) * [Fix] Provide full OpenSSL 3.0 for lua_rsa * [Minor] Little clean up * [Minor] Clean up code from debug * [Test] Replace for fixed size fstring allocation * [Test] Add rsa padding and signature md for pctx * [Test] Little changes * [Fix] Little fix for rsa_sign_memory work correctly * [Minor] Little clean up * [Minor] Small fix * [Minor] Little clean up * [Test] Add signature verification test for rsa2048
Diffstat (limited to 'test')
-rw-r--r--test/lua/unit/rsa.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lua/unit/rsa.lua b/test/lua/unit/rsa.lua
index c67a36abb..019212df4 100644
--- a/test/lua/unit/rsa.lua
+++ b/test/lua/unit/rsa.lua
@@ -47,4 +47,14 @@ context("RSA signature verification test", function()
sk, pk = rsa.keypair()
assert_false(rsa.verify_memory(pk, sig, "test"))
end)
+
+ test("RSA-2048 keypair + sign + verify", function()
+ local sk, pk = rsa.keypair(2048)
+ local sig = rsa.sign_memory(sk, "test")
+ assert_true(rsa.verify_memory(pk, sig, "test"))
+ assert_false(rsa.verify_memory(pk, sig, "test1"))
+ -- Overwrite
+ sk, pk = rsa.keypair(2048)
+ assert_false(rsa.verify_memory(pk, sig, "test"))
+ end)
end)