RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: lua/ Makefile.am lua/local/ lcrypto.c lcrypto.h rpm/ CHANGE...

From: Jeff Johnson <n3npq@mac.com>
Date: Fri 24 Oct 2008 - 23:57:16 CEST
Message-id: <F4912D39-1674-4637-A9A7-808E6D7EED44@mac.com>
I'll knock out the portability issues soon after I
know where I'm headed with lcrypto (and luaexpat and luaxmlrpc).

My goal is to achieve get/put/del into opendht.org using
	%_dbapi 5
and lua is the path of least resistance afaict.

73 de Jeff

On Oct 24, 2008, at 5:44 PM, Jeff Johnson wrote:

>  RPM Package Manager, CVS Repository
>  http://rpm5.org/cvs/
>   
> ____________________________________________________________________________
>
>  Server: rpm5.org                         Name:   Jeff Johnson
>  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
>  Module: rpm lua                          Date:   24-Oct-2008 23:44:34
>  Branch: HEAD                             Handle: 2008102421443300
>
>  Modified files:
>    lua                     Makefile.am
>    lua/local               lcrypto.c lcrypto.h
>    rpm                     CHANGES
>
>  Log:
>    - jbj: lua: add license, hotwire CRYPTO_OPENSSL, and compile  
> lcrypto.
>
>  Summary:
>    Revision    Changes     Path
>    1.27        +115 -107   lua/Makefile.am
>    1.2         +309 -289   lua/local/lcrypto.c
>    1.2         +45 -22     lua/local/lcrypto.h
>    1.2624      +1  -0      rpm/CHANGES
>   
> ____________________________________________________________________________
>
>  patch -p0 <<'@@ .'
>  Index: lua/Makefile.am
>   
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
>  $ cvs diff -u -r1.26 -r1.27 Makefile.am
>  --- lua/Makefile.am	24 Oct 2008 21:10:14 -0000	1.26
>  +++ lua/Makefile.am	24 Oct 2008 21:44:33 -0000	1.27
>  @@ -5,8 +5,6 @@
>   EXTRA_DIST = \
>   	COPYRIGHT \
>   	HISTORY \
>  -	local/lcrypto.c \
>  -	local/lcrypto.h \
>   	local/llocal.lua
>
>   AM_CPPFLAGS = \
>  @@ -37,9 +35,11 @@
>   bin2c_LDADD =
>
>   liblua_la_CFLAGS = @WITH_LUA_SUBDIR_DEF@ -DLUA_USE_POSIX
>  +liblua_la_SOURCES =
>  +
>   if USE_LUA_SHADOW
>   liblua_la_CFLAGS += \
>  -		-DUSE_LUA_SHADOW
>  +	-DUSE_LUA_SHADOW
>   else
>   EXTRA_DIST += \
>   	shadow/chkname.h \
>  @@ -74,124 +74,132 @@
>   endif
>   if USE_LUA_CHKCONFIG
>   liblua_la_CFLAGS += \
>  -		-DUSE_LUA_CHKCONFIG
>  +	-DUSE_LUA_CHKCONFIG
>   else
>   EXTRA_DIST += \
>   	chkconfig/chkconfig.c \
>   	chkconfig/leveldb.c \
>   	chkconfig/leveldb.h
>   endif
>  +
>  +liblua_la_CFLAGS +=
>  +	-DCRYPTO_OPENSSL
>  +liblua_la_SOURCES += \
>  +	local/lcrypto.c \
>  +	local/lcrypto.h
>  +
>   liblua_la_LIBADD = @WITH_LUA_SUBDIR_LIB@ -lm
>  -liblua_la_SOURCES = \
>  -		local/llocal.c \
>  -		local/llocal.h \
>  -		local/lposix.h \
>  -		local/lposix.c \
>  -		local/lrexlib.h \
>  -		local/lrexlib_algo.h \
>  -		local/lrexlib_common.h \
>  -		local/lrexlib_common.c \
>  -		local/lrexlib_lpcre.c \
>  -		local/lrexlib_lpcre_f.c \
>  -		local/lrexlib_lposix.c \
>  -		local/lshadow.h \
>  -		local/lshadow.c \
>  -		local/luuid.h \
>  -		local/luuid.c \
>  -		local/lwrs.h \
>  -		local/lwrs.c
>  +liblua_la_SOURCES += \
>  +	local/llocal.c \
>  +	local/llocal.h \
>  +	local/lposix.h \
>  +	local/lposix.c \
>  +	local/lrexlib.h \
>  +	local/lrexlib_algo.h \
>  +	local/lrexlib_common.h \
>  +	local/lrexlib_common.c \
>  +	local/lrexlib_lpcre.c \
>  +	local/lrexlib_lpcre_f.c \
>  +	local/lrexlib_lposix.c \
>  +	local/lshadow.h \
>  +	local/lshadow.c \
>  +	local/luuid.h \
>  +	local/luuid.c \
>  +	local/lwrs.h \
>  +	local/lwrs.c
>   if USE_LUA_SHADOW
>   liblua_la_SOURCES += \
>  -		shadow/chkname.h \
>  -		shadow/commonio.h \
>  -		shadow/commonio.c \
>  -		shadow/shadow_config.h \
>  -		shadow/copydir.c \
>  -		shadow/defines.h \
>  -		shadow/faillog.h \
>  -		shadow/fputsx.c \
>  -		shadow/getdef.h \
>  -		shadow/getdef.c \
>  -		shadow/groupadd.c \
>  -		shadow/groupio.h \
>  -		shadow/groupio.c \
>  -		shadow/gshadow_.h \
>  -		shadow/gshadow.c \
>  -		shadow/list.c \
>  -		shadow/nscd.h \
>  -		shadow/prototypes.h \
>  -		shadow/pwauth.h \
>  -		shadow/pwio.h \
>  -		shadow/pwio.c \
>  -		shadow/sgroupio.h \
>  -		shadow/sgroupio.c \
>  -		shadow/sgetgrent.c \
>  -		shadow/sgetpwent.c \
>  -		shadow/shadowio.h \
>  -		shadow/shadowio.c \
>  -		shadow/strtoday.c \
>  -		shadow/useradd.c
>  +	shadow/chkname.h \
>  +	shadow/commonio.h \
>  +	shadow/commonio.c \
>  +	shadow/shadow_config.h \
>  +	shadow/copydir.c \
>  +	shadow/defines.h \
>  +	shadow/faillog.h \
>  +	shadow/fputsx.c \
>  +	shadow/getdef.h \
>  +	shadow/getdef.c \
>  +	shadow/groupadd.c \
>  +	shadow/groupio.h \
>  +	shadow/groupio.c \
>  +	shadow/gshadow_.h \
>  +	shadow/gshadow.c \
>  +	shadow/list.c \
>  +	shadow/nscd.h \
>  +	shadow/prototypes.h \
>  +	shadow/pwauth.h \
>  +	shadow/pwio.h \
>  +	shadow/pwio.c \
>  +	shadow/sgroupio.h \
>  +	shadow/sgroupio.c \
>  +	shadow/sgetgrent.c \
>  +	shadow/sgetpwent.c \
>  +	shadow/shadowio.h \
>  +	shadow/shadowio.c \
>  +	shadow/strtoday.c \
>  +	shadow/useradd.c
>   endif
>   if USE_LUA_CHKCONFIG
>   liblua_la_SOURCES += \
>  -		chkconfig/chkconfig.c \
>  -		chkconfig/leveldb.h \
>  -		chkconfig/leveldb.c
>  +	chkconfig/chkconfig.c \
>  +	chkconfig/leveldb.h \
>  +	chkconfig/leveldb.c
>   endif
>  +
>   liblua_la_SOURCES += \
>  -		linit.c \
>  -		lauxlib.h \
>  -		lauxlib.c \
>  -		lua.h \
>  -		luaconf.h \
>  -		lualib.h \
>  -		lbaselib.c \
>  -		ldblib.c \
>  -		liolib.c \
>  -		loslib.c \
>  -		lmathlib.c \
>  -		loadlib.c \
>  -		lstrlib.c \
>  -		ltablib.c \
>  -		lapi.c \
>  -		lapi.h \
>  -		lcode.c \
>  -		lcode.h \
>  -		ldebug.c \
>  -		ldebug.h \
>  -		ldo.c \
>  -		ldo.h \
>  -		ldump.c \
>  -		lfunc.c \
>  -		lfunc.h \
>  -		lgc.c \
>  -		lgc.h \
>  -		llex.c \
>  -		llex.h \
>  -		llimits.h \
>  -		lmem.c \
>  -		lmem.h \
>  -		lobject.c \
>  -		lobject.h \
>  -		lopcodes.c \
>  -		lopcodes.h \
>  -		lparser.c \
>  -		lparser.h \
>  -		lstate.c \
>  -		lstate.h \
>  -		lstring.c \
>  -		lstring.h \
>  -		ltable.c \
>  -		ltable.h \
>  -		ltests.c \
>  -		ltm.c \
>  -		ltm.h \
>  -		lundump.c \
>  -		lundump.h \
>  -		lvm.c \
>  -		lvm.h \
>  -		lzio.c \
>  -		lzio.h
>  +	linit.c \
>  +	lauxlib.h \
>  +	lauxlib.c \
>  +	lua.h \
>  +	luaconf.h \
>  +	lualib.h \
>  +	lbaselib.c \
>  +	ldblib.c \
>  +	liolib.c \
>  +	loslib.c \
>  +	lmathlib.c \
>  +	loadlib.c \
>  +	lstrlib.c \
>  +	ltablib.c \
>  +	lapi.c \
>  +	lapi.h \
>  +	lcode.c \
>  +	lcode.h \
>  +	ldebug.c \
>  +	ldebug.h \
>  +	ldo.c \
>  +	ldo.h \
>  +	ldump.c \
>  +	lfunc.c \
>  +	lfunc.h \
>  +	lgc.c \
>  +	lgc.h \
>  +	llex.c \
>  +	llex.h \
>  +	llimits.h \
>  +	lmem.c \
>  +	lmem.h \
>  +	lobject.c \
>  +	lobject.h \
>  +	lopcodes.c \
>  +	lopcodes.h \
>  +	lparser.c \
>  +	lparser.h \
>  +	lstate.c \
>  +	lstate.h \
>  +	lstring.c \
>  +	lstring.h \
>  +	ltable.c \
>  +	ltable.h \
>  +	ltests.c \
>  +	ltm.c \
>  +	ltm.h \
>  +	lundump.c \
>  +	lundump.h \
>  +	lvm.c \
>  +	lvm.h \
>  +	lzio.c \
>  +	lzio.h
>   liblua.la: $(liblua_la_OBJECTS) $(liblua_la_DEPENDENCIES)
>   	$(liblua_la_LINK) $(liblua_la_OBJECTS) $(liblua_la_LIBADD)
>
>  @@ .
>  patch -p0 <<'@@ .'
>  Index: lua/local/lcrypto.c
>   
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
>  $ cvs diff -u -r1.1 -r1.2 lcrypto.c
>  --- lua/local/lcrypto.c	24 Oct 2008 21:10:15 -0000	1.1
>  +++ lua/local/lcrypto.c	24 Oct 2008 21:44:33 -0000	1.2
>  @@ -1,7 +1,27 @@
>   /*
>  -** $Id: lcrypto.c,v 1.1 2008/10/24 21:10:15 jbj Exp $
>  -** See Copyright Notice in license.html
>  -*/
>  + * $Id: lcrypto.c,v 1.2 2008/10/24 21:44:33 jbj Exp $
>  + *
>  + * Copyright © 2006 Keith Howe.
>  + *
>  + * Permission is hereby granted, free of charge, to any person  
> obtaining a
>  + * copy of this software and associated documentation files (the  
> "Software"),
>  + * to deal in the Software without restriction, including without  
> limitation
>  + * the rights to use, copy, modify, merge, publish, distribute,  
> sublicense,
>  + * and/or sell copies of the Software, and to permit persons to  
> whom the
>  + * Software is furnished to do so, subject to the following  
> conditions:
>  + *
>  + * The above copyright notice and this permission notice shall be  
> included
>  + * in all copies or substantial portions of the Software.
>  + *
>  + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,  
> EXPRESS
>  + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF  
> MERCHANTABILITY,
>  + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO  
> EVENT SHALL
>  + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,  
> DAMAGES OR OTHER
>  + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,  
> ARISING
>  + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR  
> OTHER
>  + * DEALINGS IN THE SOFTWARE.
>  + *
>  + */
>
>   #include <string.h>
>   #include <openssl/err.h>
>  @@ -10,55 +30,55 @@
>   #include <openssl/rand.h>
>
>   #include "lua.h"
>  -#include "lauxlib.h"
>  -#if ! defined (LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
>  -#include "compat-5.1.h"
>  -#endif
>  +#include "lauxlib.h"
>  +#if ! defined (LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
>  +#include "compat-5.1.h"
>  +#endif
>
>   #include "lcrypto.h"
>  -
>  -#if CRYPTO_OPENSSL
>  -  #define LUACRYPTO_ENGINE "OpenSSL"
>  -  #include <openssl/err.h>
>  -  #include <openssl/evp.h>
>  -  #include <openssl/hmac.h>
>  -  #include <openssl/rand.h>
>  -  #define HANDLER_EVP EVP_MD_CTX
>  -  #define HANDLER_HMAC HMAC_CTX
>  -  #define DIGEST_TYPE const EVP_MD*
>  -  #define DIGEST_BY_NAME(s) EVP_get_digestbyname(s)
>  -  #define IS_DIGEST_INVALID(x) (x==NULL)
>  -  #define EVP_UPDATE(c,s,len) EVP_DigestUpdate(c, s, len)
>  -  #define HMAC_UPDATE(c,s,len) HMAC_Update(c, (unsigned char *)s,  
> len);
>  -  #define EVP_CLEANUP(c) EVP_MD_CTX_cleanup(c);
>  -  #define HMAC_CLEANUP(c) HMAC_CTX_cleanup(c);
>  -#elif CRYPTO_GCRYPT
>  -  #define LUACRYPTO_ENGINE "gcrypt"
>  -  #include <gcrypt.h>
>  -  #define HANDLER_EVP gcry_md_hd_t
>  -  #define HANDLER_HMAC gcry_md_hd_t
>  -  #define DIGEST_TYPE int
>  -  #define DIGEST_BY_NAME(s) gcry_md_map_name(s)
>  -  #define IS_DIGEST_INVALID(x) (x==0)
>  -  #define EVP_UPDATE(c,s,len) gcry_md_write(*c, s, len)
>  -  #define HMAC_UPDATE(c,s,len) gcry_md_write(*c, s, len)
>  -  #define EVP_CLEANUP(c) gcry_md_close(*c)
>  -  #define HMAC_CLEANUP(c) gcry_md_close(*c)
>  -#else
>  -  #error "LUACRYPTO_DRIVER not supported"
>  -#endif
>  +
>  +#if CRYPTO_OPENSSL
>  +  #define LUACRYPTO_ENGINE "OpenSSL"
>  +  #include <openssl/err.h>
>  +  #include <openssl/evp.h>
>  +  #include <openssl/hmac.h>
>  +  #include <openssl/rand.h>
>  +  #define HANDLER_EVP EVP_MD_CTX
>  +  #define HANDLER_HMAC HMAC_CTX
>  +  #define DIGEST_TYPE const EVP_MD*
>  +  #define DIGEST_BY_NAME(s) EVP_get_digestbyname(s)
>  +  #define IS_DIGEST_INVALID(x) (x==NULL)
>  +  #define EVP_UPDATE(c,s,len) EVP_DigestUpdate(c, s, len)
>  +  #define HMAC_UPDATE(c,s,len) HMAC_Update(c, (unsigned char *)s,  
> len);
>  +  #define EVP_CLEANUP(c) EVP_MD_CTX_cleanup(c);
>  +  #define HMAC_CLEANUP(c) HMAC_CTX_cleanup(c);
>  +#elif CRYPTO_GCRYPT
>  +  #define LUACRYPTO_ENGINE "gcrypt"
>  +  #include <gcrypt.h>
>  +  #define HANDLER_EVP gcry_md_hd_t
>  +  #define HANDLER_HMAC gcry_md_hd_t
>  +  #define DIGEST_TYPE int
>  +  #define DIGEST_BY_NAME(s) gcry_md_map_name(s)
>  +  #define IS_DIGEST_INVALID(x) (x==0)
>  +  #define EVP_UPDATE(c,s,len) gcry_md_write(*c, s, len)
>  +  #define HMAC_UPDATE(c,s,len) gcry_md_write(*c, s, len)
>  +  #define EVP_CLEANUP(c) gcry_md_close(*c)
>  +  #define HMAC_CLEANUP(c) gcry_md_close(*c)
>  +#else
>  +  #error "LUACRYPTO_DRIVER not supported"
>  +#endif
>
>   LUACRYPTO_API int luaopen_crypto(lua_State *L);
>  -
>  -static char* bin2hex(const unsigned char *digest, size_t written)
>  -{
>  -  char * hex = calloc(sizeof(char), written*2 + 1);
>  -  unsigned int i;
>  -  for (i = 0; i < written; i++)
>  -    sprintf(hex + 2*i, "%02x", digest[i]);
>  -  return hex;
>  -}
>  -
>  +
>  +static char* bin2hex(const unsigned char *digest, size_t written)
>  +{
>  +  char * hex = calloc(sizeof(char), written*2 + 1);
>  +  unsigned int i;
>  +  for (i = 0; i < written; i++)
>  +    sprintf(hex + 2*i, "%02x", digest[i]);
>  +  return hex;
>  +}
>  +
>   #if CRYPTO_OPENSSL
>   static int crypto_error(lua_State *L)
>   {
>  @@ -68,12 +88,12 @@
>     lua_pushnil(L);
>     lua_pushstring(L, ERR_error_string(e, buf));
>     return 2;
>  -}
>  +}
>   #endif
>
>   static HANDLER_EVP *evp_pget(lua_State *L, int i)
>   {
>  -  if (luaL_checkudata(L, i, LUACRYPTO_EVPNAME) == NULL)
>  +  if (luaL_checkudata(L, i, LUACRYPTO_EVPNAME) == NULL)
>       luaL_typerror(L, i, LUACRYPTO_EVPNAME);
>     return lua_touserdata(L, i);
>   }
>  @@ -90,21 +110,21 @@
>   {
>     HANDLER_EVP *c = NULL;
>     const char *s = luaL_checkstring(L, 1);
>  -  DIGEST_TYPE type = DIGEST_BY_NAME(s);
>  -
>  -  if (IS_DIGEST_INVALID(type)) {
>  +  DIGEST_TYPE type = DIGEST_BY_NAME(s);
>  +
>  +  if (IS_DIGEST_INVALID(type)) {
>       luaL_argerror(L, 1, "invalid digest type");
>       return 0;
>     }
>
>     c = evp_pnew(L);
>  -
>  -#if CRYPTO_OPENSSL
>  -  EVP_MD_CTX_init(c);
>  -  EVP_DigestInit_ex(c, type, NULL); //must return 1 (not checked!)
>  -#elif CRYPTO_GCRYPT
>  -  gcry_md_open(c, type, 0); //returns a gcry_error_t (not checked!)
>  -#endif
>  +
>  +#if CRYPTO_OPENSSL
>  +  EVP_MD_CTX_init(c);
>  +  EVP_DigestInit_ex(c, type, NULL); //must return 1 (not checked!)
>  +#elif CRYPTO_GCRYPT
>  +  gcry_md_open(c, type, 0); //returns a gcry_error_t (not checked!)
>  +#endif
>
>     return 1;
>   }
>  @@ -113,40 +133,40 @@
>   {
>     HANDLER_EVP *c = evp_pget(L, 1);
>     HANDLER_EVP *d = evp_pnew(L);
>  -
>  -#if CRYPTO_OPENSSL
>  -  EVP_MD_CTX_init(d);
>  -  EVP_MD_CTX_copy_ex(d, c);
>  -#elif CRYPTO_GCRYPT
>  -  gcry_md_copy(d, *c);
>  -#endif
>  -
>  +
>  +#if CRYPTO_OPENSSL
>  +  EVP_MD_CTX_init(d);
>  +  EVP_MD_CTX_copy_ex(d, c);
>  +#elif CRYPTO_GCRYPT
>  +  gcry_md_copy(d, *c);
>  +#endif
>  +
>     return 1;
>   }
>
>   static int evp_reset(lua_State *L)
>   {
>  -  HANDLER_EVP *c = evp_pget(L, 1);
>  -
>  -#if CRYPTO_OPENSSL
>  +  HANDLER_EVP *c = evp_pget(L, 1);
>  +
>  +#if CRYPTO_OPENSSL
>     const EVP_MD *t = EVP_MD_CTX_md(c);
>     EVP_MD_CTX_cleanup(c);
>     EVP_MD_CTX_init(c);
>     EVP_DigestInit_ex(c, t, NULL);
>  -#elif CRYPTO_GCRYPT
>  -  gcry_md_reset(*c);
>  -#endif
>  -
>  +#elif CRYPTO_GCRYPT
>  +  gcry_md_reset(*c);
>  +#endif
>  +
>     return 0;
>   }
>
>   static int evp_update(lua_State *L)
>   {
>  -  HANDLER_EVP *c = evp_pget(L, 1);
>  -  size_t s_len;
>  -  const char *s = luaL_checklstring(L, 2, &s_len);
>  -
>  -  EVP_UPDATE(c, s, s_len);
>  +  HANDLER_EVP *c = evp_pget(L, 1);
>  +  size_t s_len;
>  +  const char *s = luaL_checklstring(L, 2, &s_len);
>  +
>  +  EVP_UPDATE(c, s, s_len);
>
>     lua_settop(L, 1);
>     return 1;
>  @@ -154,49 +174,49 @@
>
>   static int evp_digest(lua_State *L)
>   {
>  -  HANDLER_EVP *c = evp_pget(L, 1);
>  -#if CRYPTO_OPENSSL
>  -  HANDLER_EVP *d = NULL;
>  -  unsigned char digest[EVP_MAX_MD_SIZE];
>  -#elif CRYPTO_GCRYPT
>  -  HANDLER_EVP d = NULL;
>  -  unsigned char *digest;
>  -  int algo;
>  -#endif
>  +  HANDLER_EVP *c = evp_pget(L, 1);
>  +#if CRYPTO_OPENSSL
>  +  HANDLER_EVP *d = NULL;
>  +  unsigned char digest[EVP_MAX_MD_SIZE];
>  +#elif CRYPTO_GCRYPT
>  +  HANDLER_EVP d = NULL;
>  +  unsigned char *digest;
>  +  int algo;
>  +#endif
>     size_t written = 0;
>
>     if (lua_isstring(L, 2))
>     {
>  -    size_t s_len;
>  -    const char *s = luaL_checklstring(L, 2, &s_len);
>  -    EVP_UPDATE(c, s, s_len);
>  +    size_t s_len;
>  +    const char *s = luaL_checklstring(L, 2, &s_len);
>  +    EVP_UPDATE(c, s, s_len);
>     }
>  -
>  -#if CRYPTO_OPENSSL
>  +
>  +#if CRYPTO_OPENSSL
>     d = EVP_MD_CTX_create();
>     EVP_MD_CTX_copy_ex(d, c);
>     EVP_DigestFinal_ex(d, digest, &written);
>     EVP_MD_CTX_destroy(d);
>  -#elif CRYPTO_GCRYPT
>  -  algo = gcry_md_get_algo(*c);
>  -  gcry_md_copy(&d, *c);
>  -  gcry_md_final(d);
>  -  digest = gcry_md_read(d, algo);
>  -  written = gcry_md_get_algo_dlen(algo);
>  -#endif
>  +#elif CRYPTO_GCRYPT
>  +  algo = gcry_md_get_algo(*c);
>  +  gcry_md_copy(&d, *c);
>  +  gcry_md_final(d);
>  +  digest = gcry_md_read(d, algo);
>  +  written = gcry_md_get_algo_dlen(algo);
>  +#endif
>
>     if (lua_toboolean(L, 3))
>       lua_pushlstring(L, (char *)digest, written);
>     else
>     {
>  -    char *hex = bin2hex(digest, written);
>  +    char *hex = bin2hex(digest, written);
>       lua_pushlstring(L, hex, written*2);
>       free(hex);
>     }
>  -
>  -#if CRYPTO_GCRYPT
>  -  gcry_md_close(d);
>  -#endif
>  +
>  +#if CRYPTO_GCRYPT
>  +  gcry_md_close(d);
>  +#endif
>
>     return 1;
>   }
>  @@ -212,8 +232,8 @@
>
>   static int evp_gc(lua_State *L)
>   {
>  -  HANDLER_EVP *c = evp_pget(L, 1);
>  -  EVP_CLEANUP(c);
>  +  HANDLER_EVP *c = evp_pget(L, 1);
>  +  EVP_CLEANUP(c);
>     return 1;
>   }
>
>  @@ -221,35 +241,35 @@
>   {
>     const char *type_name = luaL_checkstring(L, 1);
>     const char *s = luaL_checkstring(L, 2);
>  -  DIGEST_TYPE type = DIGEST_BY_NAME(type_name);
>  -  size_t written = 0;
>  -#if CRYPTO_OPENSSL
>  -  HANDLER_EVP *c = NULL;
>  +  DIGEST_TYPE type = DIGEST_BY_NAME(type_name);
>  +  size_t written = 0;
>  +#if CRYPTO_OPENSSL
>  +  HANDLER_EVP *c = NULL;
>     unsigned char digest[EVP_MAX_MD_SIZE];
>  -#elif CRYPTO_GCRYPT
>  -  unsigned char digest[gcry_md_get_algo_dlen(type)];
>  -#endif
>  +#elif CRYPTO_GCRYPT
>  +  unsigned char digest[gcry_md_get_algo_dlen(type)];
>  +#endif
>
>  -  if (IS_DIGEST_INVALID(type)) {
>  +  if (IS_DIGEST_INVALID(type)) {
>       luaL_argerror(L, 1, "invalid digest type");
>       return 0;
>     }
>
>  -#if CRYPTO_OPENSSL
>  +#if CRYPTO_OPENSSL
>     c = EVP_MD_CTX_create();
>     EVP_DigestInit_ex(c, type, NULL);
>     EVP_DigestUpdate(c, s, lua_strlen(L, 2));
>     EVP_DigestFinal_ex(c, digest, &written);
>  -#elif CRYPTO_GCRYPT
>  -  gcry_md_hash_buffer(type,digest,s,lua_strlen(L, 2));
>  -  written = gcry_md_get_algo_dlen(type);
>  -#endif
>  +#elif CRYPTO_GCRYPT
>  +  gcry_md_hash_buffer(type,digest,s,lua_strlen(L, 2));
>  +  written = gcry_md_get_algo_dlen(type);
>  +#endif
>
>     if (lua_toboolean(L, 3))
>       lua_pushlstring(L, (char *)digest, written);
>     else
>     {
>  -    char *hex = bin2hex(digest, written);
>  +    char *hex = bin2hex(digest, written);
>       lua_pushlstring(L, hex, written*2);
>       free(hex);
>     }
>  @@ -259,7 +279,7 @@
>
>   static HANDLER_HMAC *hmac_pget(lua_State *L, int i)
>   {
>  -  if (luaL_checkudata(L, i, LUACRYPTO_HMACNAME) == NULL)
>  +  if (luaL_checkudata(L, i, LUACRYPTO_HMACNAME) == NULL)
>       luaL_typerror(L, i, LUACRYPTO_HMACNAME);
>     return lua_touserdata(L, i);
>   }
>  @@ -276,22 +296,22 @@
>   {
>     HANDLER_HMAC *c = hmac_pnew(L);
>     const char *s = luaL_checkstring(L, 1);
>  -  size_t k_len;
>  -  const char *k = luaL_checklstring(L, 2, &k_len);
>  -  DIGEST_TYPE type = DIGEST_BY_NAME(s);
>  -
>  -  if (IS_DIGEST_INVALID(type)) {
>  +  size_t k_len;
>  +  const char *k = luaL_checklstring(L, 2, &k_len);
>  +  DIGEST_TYPE type = DIGEST_BY_NAME(s);
>  +
>  +  if (IS_DIGEST_INVALID(type)) {
>       luaL_argerror(L, 1, "invalid digest type");
>       return 0;
>     }
>
>  -#if CRYPTO_OPENSSL
>  -  HMAC_CTX_init(c);
>  -  HMAC_Init_ex(c, k, k_len, type, NULL);
>  -#elif CRYPTO_GCRYPT
>  -  gcry_md_open(c, type, GCRY_MD_FLAG_HMAC);
>  -  gcry_md_setkey(*c, k, k_len);
>  -#endif
>  +#if CRYPTO_OPENSSL
>  +  HMAC_CTX_init(c);
>  +  HMAC_Init_ex(c, k, k_len, type, NULL);
>  +#elif CRYPTO_GCRYPT
>  +  gcry_md_open(c, type, GCRY_MD_FLAG_HMAC);
>  +  gcry_md_setkey(*c, k, k_len);
>  +#endif
>
>     return 1;
>   }
>  @@ -299,13 +319,13 @@
>   static int hmac_clone(lua_State *L)
>   {
>     HANDLER_HMAC *c = hmac_pget(L, 1);
>  -  HANDLER_HMAC *d = hmac_pnew(L);
>  +  HANDLER_HMAC *d = hmac_pnew(L);
>
>  -#if CRYPTO_OPENSSL
>  -  *d = *c;
>  -#elif CRYPTO_GCRYPT
>  -  gcry_md_copy(d, *c);
>  -#endif
>  +#if CRYPTO_OPENSSL
>  +  *d = *c;
>  +#elif CRYPTO_GCRYPT
>  +  gcry_md_copy(d, *c);
>  +#endif
>
>     return 1;
>   }
>  @@ -313,23 +333,23 @@
>   static int hmac_reset(lua_State *L)
>   {
>     HANDLER_HMAC *c = hmac_pget(L, 1);
>  -
>  -#if CRYPTO_OPENSSL
>  -  HMAC_Init_ex(c, NULL, 0, NULL, NULL);
>  -#elif CRYPTO_GCRYPT
>  -  gcry_md_reset(*c);
>  -#endif
>  -
>  +
>  +#if CRYPTO_OPENSSL
>  +  HMAC_Init_ex(c, NULL, 0, NULL, NULL);
>  +#elif CRYPTO_GCRYPT
>  +  gcry_md_reset(*c);
>  +#endif
>  +
>     return 0;
>   }
>
>   static int hmac_update(lua_State *L)
>   {
>  -  HANDLER_HMAC *c = hmac_pget(L, 1);
>  -  size_t s_len;
>  -  const char *s = luaL_checklstring(L, 2, &s_len);
>  +  HANDLER_HMAC *c = hmac_pget(L, 1);
>  +  size_t s_len;
>  +  const char *s = luaL_checklstring(L, 2, &s_len);
>
>  -  HMAC_UPDATE(c, s, s_len);
>  +  HMAC_UPDATE(c, s, s_len);
>
>     lua_settop(L, 1);
>     return 1;
>  @@ -337,45 +357,45 @@
>
>   static int hmac_digest(lua_State *L)
>   {
>  -  HANDLER_HMAC *c = hmac_pget(L, 1);
>  -  size_t written = 0;
>  -#if CRYPTO_OPENSSL
>  +  HANDLER_HMAC *c = hmac_pget(L, 1);
>  +  size_t written = 0;
>  +#if CRYPTO_OPENSSL
>     unsigned char digest[EVP_MAX_MD_SIZE];
>  -#elif CRYPTO_GCRYPT
>  -  HANDLER_HMAC d;
>  -  unsigned char *digest;
>  -  int algo;
>  -#endif
>  +#elif CRYPTO_GCRYPT
>  +  HANDLER_HMAC d;
>  +  unsigned char *digest;
>  +  int algo;
>  +#endif
>
>     if (lua_isstring(L, 2))
>     {
>  -    size_t s_len;
>  -    const char *s = luaL_checklstring(L, 2, &s_len);
>  -    HMAC_UPDATE(c, s, s_len);
>  +    size_t s_len;
>  +    const char *s = luaL_checklstring(L, 2, &s_len);
>  +    HMAC_UPDATE(c, s, s_len);
>     }
>
>  -#if CRYPTO_OPENSSL
>  +#if CRYPTO_OPENSSL
>     HMAC_Final(c, digest, &written);
>  -#elif CRYPTO_GCRYPT
>  -  algo = gcry_md_get_algo(*c);
>  -  gcry_md_copy(&d, *c);
>  -  gcry_md_final(d);
>  -  digest = gcry_md_read(d, algo);
>  -  written = gcry_md_get_algo_dlen(algo);
>  -#endif
>  +#elif CRYPTO_GCRYPT
>  +  algo = gcry_md_get_algo(*c);
>  +  gcry_md_copy(&d, *c);
>  +  gcry_md_final(d);
>  +  digest = gcry_md_read(d, algo);
>  +  written = gcry_md_get_algo_dlen(algo);
>  +#endif
>
>     if (lua_toboolean(L, 3))
>       lua_pushlstring(L, (char *)digest, written);
>     else
>     {
>  -    char *hex = bin2hex(digest, written);
>  +    char *hex = bin2hex(digest, written);
>       lua_pushlstring(L, hex, written*2);
>       free(hex);
>     }
>  -
>  -#if CRYPTO_GCRYPT
>  -  gcry_md_close(d);
>  -#endif
>  +
>  +#if CRYPTO_GCRYPT
>  +  gcry_md_close(d);
>  +#endif
>
>     return 1;
>   }
>  @@ -391,8 +411,8 @@
>
>   static int hmac_gc(lua_State *L)
>   {
>  -  HANDLER_HMAC *c = hmac_pget(L, 1);
>  -  HMAC_CLEANUP(c);
>  +  HANDLER_HMAC *c = hmac_pget(L, 1);
>  +  HMAC_CLEANUP(c);
>     return 1;
>   }
>
>  @@ -401,53 +421,53 @@
>     HANDLER_HMAC c;
>     size_t written = 0;
>     const char *t = luaL_checkstring(L, 1);
>  -  size_t s_len;
>  -  const char *s = luaL_checklstring(L, 2, &s_len);
>  -  size_t k_len;
>  -  const char *k = luaL_checklstring(L, 3, &k_len);
>  -  DIGEST_TYPE type = DIGEST_BY_NAME(t);
>  -#if CRYPTO_OPENSSL
>  -  unsigned char digest[EVP_MAX_MD_SIZE];
>  -#elif CRYPTO_GCRYPT
>  -  unsigned char *digest;
>  -#endif
>  +  size_t s_len;
>  +  const char *s = luaL_checklstring(L, 2, &s_len);
>  +  size_t k_len;
>  +  const char *k = luaL_checklstring(L, 3, &k_len);
>  +  DIGEST_TYPE type = DIGEST_BY_NAME(t);
>  +#if CRYPTO_OPENSSL
>  +  unsigned char digest[EVP_MAX_MD_SIZE];
>  +#elif CRYPTO_GCRYPT
>  +  unsigned char *digest;
>  +#endif
>
>  -  if (IS_DIGEST_INVALID(type)) {
>  +  if (IS_DIGEST_INVALID(type)) {
>       luaL_argerror(L, 1, "invalid digest type");
>       return 0;
>     }
>
>  -#if CRYPTO_OPENSSL
>  -  HMAC_CTX_init(&c);
>  -  HMAC_Init_ex(&c, k, k_len, type, NULL);
>  -  HMAC_Update(&c, (unsigned char *)s, s_len);
>  -  HMAC_Final(&c, digest, &written);
>  -#elif CRYPTO_GCRYPT
>  -  gcry_md_open(&c, type, GCRY_MD_FLAG_HMAC);
>  -  gcry_md_setkey(c, k, k_len);
>  -  gcry_md_write(c, s, s_len);
>  -  gcry_md_final(c);
>  -  digest = gcry_md_read(c,type);
>  -  written = gcry_md_get_algo_dlen(type);
>  -#endif
>  +#if CRYPTO_OPENSSL
>  +  HMAC_CTX_init(&c);
>  +  HMAC_Init_ex(&c, k, k_len, type, NULL);
>  +  HMAC_Update(&c, (unsigned char *)s, s_len);
>  +  HMAC_Final(&c, digest, &written);
>  +#elif CRYPTO_GCRYPT
>  +  gcry_md_open(&c, type, GCRY_MD_FLAG_HMAC);
>  +  gcry_md_setkey(c, k, k_len);
>  +  gcry_md_write(c, s, s_len);
>  +  gcry_md_final(c);
>  +  digest = gcry_md_read(c,type);
>  +  written = gcry_md_get_algo_dlen(type);
>  +#endif
>
>     if (lua_toboolean(L, 4))
>       lua_pushlstring(L, (char *)digest, written);
>     else
>     {
>  -    char *hex = bin2hex(digest,written);
>  +    char *hex = bin2hex(digest,written);
>       lua_pushlstring(L, hex, written*2);
>       free(hex);
>     }
>  -
>  -#if CRYPTO_GCRYPT
>  -  gcry_md_close(c);
>  -#endif
>  +
>  +#if CRYPTO_GCRYPT
>  +  gcry_md_close(c);
>  +#endif
>
>     return 1;
>   }
>
>  -#if CRYPTO_OPENSSL
>  +#if CRYPTO_OPENSSL
>   static int rand_do_bytes(lua_State *L, int (*bytes)(unsigned char  
> *, int))
>   {
>     size_t count = luaL_checkint(L, 1);
>  @@ -462,69 +482,69 @@
>       if (buf != tmp)
>         free(buf);
>       return 1;
>  -}
>  -
>  -static int rand_bytes(lua_State *L)
>  -{
>  -  return rand_do_bytes(L, RAND_bytes);
>  -}
>  -
>  -static int rand_pseudo_bytes(lua_State *L)
>  -{
>  -  return rand_do_bytes(L, RAND_pseudo_bytes);
>  -}
>  -#elif CRYPTO_GCRYPT
>  -static int rand_do_bytes(lua_State *L, enum gcry_random_level level)
>  -{
>  -  size_t count = luaL_checkint(L, 1);
>  -  void* buf = gcry_random_bytes/*_secure*/(count, level);
>  -
>  -  gcry_fast_random_poll();
>  -
>  -  lua_pushlstring(L, (char *)buf, count);
>  -
>  -  return 1;
>  -}
>  -
>  -static int rand_bytes(lua_State *L)
>  -{
>  -  return rand_do_bytes(L, GCRY_VERY_STRONG_RANDOM);
>  -}
>  -
>  -static int rand_pseudo_bytes(lua_State *L)
>  -{
>  -  return rand_do_bytes(L, GCRY_STRONG_RANDOM);
>  -}
>  -#endif
>  +}
>  +
>  +static int rand_bytes(lua_State *L)
>  +{
>  +  return rand_do_bytes(L, RAND_bytes);
>  +}
>  +
>  +static int rand_pseudo_bytes(lua_State *L)
>  +{
>  +  return rand_do_bytes(L, RAND_pseudo_bytes);
>  +}
>  +#elif CRYPTO_GCRYPT
>  +static int rand_do_bytes(lua_State *L, enum gcry_random_level level)
>  +{
>  +  size_t count = luaL_checkint(L, 1);
>  +  void* buf = gcry_random_bytes/*_secure*/(count, level);
>  +
>  +  gcry_fast_random_poll();
>  +
>  +  lua_pushlstring(L, (char *)buf, count);
>  +
>  +  return 1;
>  +}
>  +
>  +static int rand_bytes(lua_State *L)
>  +{
>  +  return rand_do_bytes(L, GCRY_VERY_STRONG_RANDOM);
>  +}
>  +
>  +static int rand_pseudo_bytes(lua_State *L)
>  +{
>  +  return rand_do_bytes(L, GCRY_STRONG_RANDOM);
>  +}
>  +#endif
>
>   static int rand_add(lua_State *L)
>   {
>     size_t num;
>     const void *buf = luaL_checklstring(L, 1, &num);
>  -#if CRYPTO_OPENSSL
>  -  double entropy = (double)luaL_optnumber(L, 2, num);
>  -  RAND_add(buf, num, entropy);
>  -#elif CRYPTO_GCRYPT
>  -  gcry_random_add_bytes(buf, num, -1); // unknown quality
>  -#endif
>  +#if CRYPTO_OPENSSL
>  +  double entropy = (double)luaL_optnumber(L, 2, num);
>  +  RAND_add(buf, num, entropy);
>  +#elif CRYPTO_GCRYPT
>  +  gcry_random_add_bytes(buf, num, -1); // unknown quality
>  +#endif
>     return 0;
>   }
>
>   static int rand_status(lua_State *L)
>   {
>  -#if CRYPTO_OPENSSL
>  -  lua_pushboolean(L, RAND_status());
>  -#elif CRYPTO_GCRYPT
>  -  lua_pushboolean(L, 1); //feature not available AFAIK
>  -#endif
>  +#if CRYPTO_OPENSSL
>  +  lua_pushboolean(L, RAND_status());
>  +#elif CRYPTO_GCRYPT
>  +  lua_pushboolean(L, 1); //feature not available AFAIK
>  +#endif
>     return 1;
>   }
>
>   enum { WRITE_FILE_COUNT = 1024 };
>   static int rand_load(lua_State *L)
>   {
>  -  const char *name = luaL_optstring(L, 1, NULL);
>  -#if CRYPTO_OPENSSL
>  +  const char *name = luaL_optstring(L, 1, NULL);
>  +#if CRYPTO_OPENSSL
>     char tmp[256];
>     int n;
>     if (!name && !(name = RAND_file_name(tmp, sizeof tmp)))
>  @@ -533,17 +553,17 @@
>     if (n == 0)
>       return crypto_error(L);
>     lua_pushnumber(L, n);
>  -#elif CRYPTO_GCRYPT
>  -  if (name != NULL)
>  -    gcry_control(GCRYCTL_SET_RANDOM_SEED_FILE, name);
>  -  lua_pushnumber(L, 0.0);
>  -#endif
>  +#elif CRYPTO_GCRYPT
>  +  if (name != NULL)
>  +    gcry_control(GCRYCTL_SET_RANDOM_SEED_FILE, name);
>  +  lua_pushnumber(L, 0.0);
>  +#endif
>     return 1;
>   }
>
>   static int rand_write(lua_State *L)
>   {
>  -  const char *name = luaL_optstring(L, 1, NULL);
>  +  const char *name = luaL_optstring(L, 1, NULL);
>   #if CRYPTO_OPENSSL
>     char tmp[256];
>     int n;
>  @@ -552,27 +572,27 @@
>     n = RAND_write_file(name);
>     if (n == 0)
>       return crypto_error(L);
>  -  lua_pushnumber(L, n);
>  -#elif CRYPTO_GCRYPT
>  -  /* this is a BUG() in gcrypt. not sure if it refers to the lib  
> or to
>  -    the caller, but it does not work (to set twice this file) */
>  -  /*
>  -  if (name != NULL)
>  -    gcry_control(GCRYCTL_SET_RANDOM_SEED_FILE,name);
>  -  */
>  -  gcry_control(GCRYCTL_UPDATE_RANDOM_SEED_FILE);
>  -  lua_pushnumber(L, 0.0);
>  +  lua_pushnumber(L, n);
>  +#elif CRYPTO_GCRYPT
>  +  /* this is a BUG() in gcrypt. not sure if it refers to the lib  
> or to
>  +    the caller, but it does not work (to set twice this file) */
>  +  /*
>  +  if (name != NULL)
>  +    gcry_control(GCRYCTL_SET_RANDOM_SEED_FILE,name);
>  +  */
>  +  gcry_control(GCRYCTL_UPDATE_RANDOM_SEED_FILE);
>  +  lua_pushnumber(L, 0.0);
>   #endif
>     return 1;
>   }
>
>   static int rand_cleanup(lua_State *L)
>  -{
>  -#if CRYPTO_OPENSSL
>  +{
>  +#if CRYPTO_OPENSSL
>     RAND_cleanup();
>  -#elif CRYPTO_GCRYPT
>  -  /* not completely sure there is nothing to do here... */
>  -#endif
>  +#elif CRYPTO_GCRYPT
>  +  /* not completely sure there is nothing to do here... */
>  +#endif
>     return 0;
>   }
>
>  @@ -640,7 +660,7 @@
>       { "seed", rand_add },
>       { "load", rand_load },
>       { "write", rand_write },
>  -    { "status", rand_status },
>  +    { "status", rand_status },
>       { "cleanup", rand_cleanup },
>       { NULL, NULL }
>     };
>  @@ -674,9 +694,9 @@
>     lua_pushliteral (L, "_VERSION");
>     lua_pushliteral (L, "LuaCrypto 0.3.0");
>     lua_settable (L, -3);
>  -  lua_pushliteral (L, "_ENGINE");
>  -  lua_pushliteral (L, LUACRYPTO_ENGINE);
>  -  lua_settable (L, -3);
>  +  lua_pushliteral (L, "_ENGINE");
>  +  lua_pushliteral (L, LUACRYPTO_ENGINE);
>  +  lua_settable (L, -3);
>   }
>
>   /*
>  @@ -685,15 +705,15 @@
>   */
>   LUACRYPTO_API int luaopen_crypto(lua_State *L)
>   {
>  -#if CRYPTO_OPENSSL
>  -  if (OPENSSL_VERSION_NUMBER < 0x000907000L)
>  -    return luaL_error(L, "OpenSSL version is too old; requires  
> 0.9.7 or higher");
>  -  OpenSSL_add_all_digests();
>  -#elif CRYPTO_GCRYPT
>  -  gcry_check_version("1.2.2");
>  -  gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
>  -  gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
>  -#endif
>  +#if CRYPTO_OPENSSL
>  +  if (OPENSSL_VERSION_NUMBER < 0x000907000L)
>  +    return luaL_error(L, "OpenSSL version is too old; requires  
> 0.9.7 or higher");
>  +  OpenSSL_add_all_digests();
>  +#elif CRYPTO_GCRYPT
>  +  gcry_check_version("1.2.2");
>  +  gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
>  +  gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
>  +#endif
>
>     struct luaL_reg core[] = {
>       {NULL, NULL},
>  @@ .
>  patch -p0 <<'@@ .'
>  Index: lua/local/lcrypto.h
>   
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
>  $ cvs diff -u -r1.1 -r1.2 lcrypto.h
>  --- lua/local/lcrypto.h	24 Oct 2008 21:10:15 -0000	1.1
>  +++ lua/local/lcrypto.h	24 Oct 2008 21:44:33 -0000	1.2
>  @@ -1,24 +1,47 @@
>  -/*
>  -** $Id: lcrypto.h,v 1.1 2008/10/24 21:10:15 jbj Exp $
>  -** See Copyright Notice in license.html
>  -*/
>  -
>  -#ifndef _LUACRYPTO_
>  -#define _LUACRYPTO_
>  -
>  -#ifndef LUACRYPTO_API
>  -#define LUACRYPTO_API   LUA_API
>  -#endif
>  -
>  -#define LUACRYPTO_PREFIX "LuaCrypto: "
>  -#define LUACRYPTO_CORENAME "crypto"
>  -#define LUACRYPTO_EVPNAME "crypto.evp"
>  +/*
>  + * cal/lcrypto.h \
>  + *
>  + * $Id: lcrypto.h,v 1.2 2008/10/24 21:44:33 jbj Exp $
>  + *
>  + * Copyright © 2006 Keith Howe.
>  + *
>  + * Permission is hereby granted, free of charge, to any person  
> obtaining a
>  + * copy of this software and associated documentation files (the  
> "Software"),
>  + * to deal in the Software without restriction, including without  
> limitation
>  + * the rights to use, copy, modify, merge, publish, distribute,  
> sublicense,
>  + * and/or sell copies of the Software, and to permit persons to  
> whom the
>  + * Software is furnished to do so, subject to the following  
> conditions:
>  + *
>  + * The above copyright notice and this permission notice shall be  
> included
>  + * in all copies or substantial portions of the Software.
>  + *
>  + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,  
> EXPRESS
>  + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF  
> MERCHANTABILITY,
>  + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO  
> EVENT SHALL
>  + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,  
> DAMAGES OR OTHER
>  + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,  
> ARISING
>  + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR  
> OTHER
>  + * DEALINGS IN THE SOFTWARE.
>  + *
>  + */
>  +
>  +#ifndef _LUACRYPTO_
>  +#define _LUACRYPTO_
>  +
>  +#ifndef LUACRYPTO_API
>  +#define LUACRYPTO_API   LUA_API
>  +#endif
>  +
>  +#define LUACRYPTO_PREFIX "LuaCrypto: "
>  +#define LUACRYPTO_CORENAME "crypto"
>  +#define LUACRYPTO_EVPNAME "crypto.evp"
>   #define LUACRYPTO_HMACNAME "crypto.hmac"
>   #define LUACRYPTO_RANDNAME "crypto.rand"
>  -
>  -LUACRYPTO_API int luacrypto_createmeta (lua_State *L, const char  
> *name, const luaL_reg *methods);
>  -LUACRYPTO_API void luacrypto_setmeta (lua_State *L, const char  
> *name);
>  -LUACRYPTO_API void luacrypto_set_info (lua_State *L);
>  -
>  -
>  -#endif
>  +
>  +LUACRYPTO_API int luacrypto_createmeta (lua_State *L, const char  
> *name, const luaL_reg *methods);
>  +LUACRYPTO_API void luacrypto_setmeta (lua_State *L, const char  
> *name);
>  +LUACRYPTO_API void luacrypto_set_info (lua_State *L);
>  +
>  +#define	CRYPTO_OPENSSL	1
>  +
>  +#endif
>  @@ .
>  patch -p0 <<'@@ .'
>  Index: rpm/CHANGES
>   
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
>  $ cvs diff -u -r1.2623 -r1.2624 CHANGES
>  --- rpm/CHANGES	24 Oct 2008 21:10:14 -0000	1.2623
>  +++ rpm/CHANGES	24 Oct 2008 21:44:33 -0000	1.2624
>  @@ -1,5 +1,6 @@
>
>   5.2a2 -> 5.2a3:
>  +    - jbj: lua: add license, hotwire CRYPTO_OPENSSL, and compile  
> lcrypto.
>       - jbj: lua: add virgin lcrypto lua bindings (unused atm).
>       - jbj: lua: ensure that internal lua has all the right files.
>       - jbj: add a relation to to force install-before-erase.
>  @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-cvs@rpm5.org
Received on Fri Oct 24 23:57:34 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.