aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-09-30 00:27:10 +0200
committerKim Alvefur <zash@zash.se>2022-09-30 00:27:10 +0200
commit70e54affa0d780922bd68bc12d411d59c4dbcf81 (patch)
tree95ea4bf07f25fc70aa7768af29d4ae62e450a4d5 /spec
parent5ca81b0e3bcef02ebf6e518e10a855c6ed3efd7f (diff)
downloadprosody-70e54affa0d780922bd68bc12d411d59c4dbcf81.tar.gz
prosody-70e54affa0d780922bd68bc12d411d59c4dbcf81.zip
util.crypto: Fix tests
Found this number in a hat. Sleepy time. Good night.
Diffstat (limited to 'spec')
-rw-r--r--spec/util_crypto_spec.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/util_crypto_spec.lua b/spec/util_crypto_spec.lua
index 0d7a7ffb..152efed5 100644
--- a/spec/util_crypto_spec.lua
+++ b/spec/util_crypto_spec.lua
@@ -117,7 +117,7 @@ describe("util.crypto", function ()
6b0cd1043718ffc31c153b971d213a8e
]]):gsub("%s+", "")));
it("can be parsed", function ()
- local r, s = crypto.parse_ecdsa_signature(sig);
+ local r, s = crypto.parse_ecdsa_signature(sig, 32);
assert.is_string(r);
assert.is_string(s);
assert.equal(32, #r);
@@ -134,13 +134,13 @@ describe("util.crypto", function ()
string.rep("\255", 3);
};
for _, invalid_sig in ipairs(invalid_sigs) do
- local r, s = crypto.parse_ecdsa_signature(invalid_sig);
+ local r, s = crypto.parse_ecdsa_signature(invalid_sig, 32);
assert.is_nil(r);
assert.is_nil(s);
end
end);
it("can be built", function ()
- local r, s = crypto.parse_ecdsa_signature(sig);
+ local r, s = crypto.parse_ecdsa_signature(sig, 32);
local rebuilt_sig = crypto.build_ecdsa_signature(r, s);
assert.equal(sig, rebuilt_sig);
end);