267 unsigned int bytes; |
267 unsigned int bytes; |
268 unsigned char buffer[EVP_MAX_MD_SIZE]; |
268 unsigned char buffer[EVP_MAX_MD_SIZE]; |
269 char hex_buffer[EVP_MAX_MD_SIZE*2]; |
269 char hex_buffer[EVP_MAX_MD_SIZE*2]; |
270 const EVP_MD *digest; |
270 const EVP_MD *digest; |
271 cert = luasec_to_x509(L, 1); |
271 cert = luasec_to_x509(L, 1); |
272 if (lua_gettop(L) < 2 || strcmp(luaL_checkstring(L, 1), "sha1") == 0) |
272 if (lua_gettop(L) < 2 || strcmp(luaL_checkstring(L, 2), "sha1") == 0) |
273 { |
273 { |
274 digest = EVP_sha1(); |
274 digest = EVP_sha1(); |
275 } |
275 } |
276 else |
276 else |
277 { |
277 { |