aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2017-10-26 17:21:07 +1100
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2017-10-26 17:21:07 +1100
commit83290e403bf9c93e4480c6bf91a64b070c69f332 (patch)
treee3a4d095f14e06c7a07a298a175c0b9dafe5dc24 /examples
parent352ce60b8ba43458f44aec4e5990644109ca9ba3 (diff)
downloadluaossl-83290e403bf9c93e4480c6bf91a64b070c69f332.tar.gz
luaossl-83290e403bf9c93e4480c6bf91a64b070c69f332.tar.bz2
luaossl-83290e403bf9c93e4480c6bf91a64b070c69f332.zip
OpenSSL now supports more digest<=>key combinations. Remove incorrect examples
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/vrfy.sig9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/vrfy.sig b/examples/vrfy.sig
index 84bcfcc..123611e 100755
--- a/examples/vrfy.sig
+++ b/examples/vrfy.sig
@@ -3,7 +3,7 @@
-- Example public-key signature verification.
--
-local keytype = ...
+local keytype, hash = ...
local openssl = require"openssl"
local pkey = require"openssl.pkey"
@@ -23,10 +23,11 @@ local function genkey(type)
end
local key = genkey(keytype)
-local hash = key:getDefaultDigestName()
+if hash == nil then
+ hash = key:getDefaultDigestName()
+end
--- digest our message using an appropriate digest ("ecdsa-with-SHA1" for EC;
--- "dss1" for DSA; and "sha1", "sha256", etc for RSA).
+-- digest our message using an appropriate digest
local data = digest.new(hash)
data:update(... or "hello world")