x509.c: Fix parameter index to cert:digest()

Sun, 28 Nov 2010 18:03:49 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 28 Nov 2010 18:03:49 +0000
changeset 35
4994321eae31
parent 34
510432315106
child 36
96f23601ce7a

x509.c: Fix parameter index to cert:digest()

src/x509.c file | annotate | diff | comparison | revisions
--- a/src/x509.c	Sun Nov 21 20:14:31 2010 -0800
+++ b/src/x509.c	Sun Nov 28 18:03:49 2010 +0000
@@ -269,7 +269,7 @@
   char hex_buffer[EVP_MAX_MD_SIZE*2];
   const EVP_MD *digest;
   cert = luasec_to_x509(L, 1);
-  if (lua_gettop(L) < 2 || strcmp(luaL_checkstring(L, 1), "sha1") == 0)
+  if (lua_gettop(L) < 2 || strcmp(luaL_checkstring(L, 2), "sha1") == 0)
   {
     digest = EVP_sha1();
   }

mercurial