Add useful context to various error messages

This commit is contained in:
Paul Aurich
2013-09-07 15:56:55 -07:00
parent 9262f9e7de
commit 9c7c96f2a0
3 changed files with 19 additions and 13 deletions

View File

@ -306,12 +306,13 @@ static int meth_digest(lua_State* L)
}
if (!digest) {
lua_pushnil(L);
lua_pushstring(L, "digest algorithm not supported");
lua_pushfstring(L, "digest algorithm not supported (%s)", str);
return 2;
}
if (!X509_digest(cert, digest, buffer, &bytes)) {
lua_pushnil(L);
lua_pushstring(L, "error processing the certificate");
lua_pushfstring(L, "error processing the certificate (%s)",
ERR_reason_error_string(ERR_get_error()));
return 2;
}
to_hex((char*)buffer, bytes, hex_buffer);