Ticket #25593: nse_openssl.cc.diff
File nse_openssl.cc.diff, 1010 bytes (added by jmroot (Joshua Root), 14 years ago) |
---|
-
nse_openssl.cc
old new 8 8 #include <openssl/crypto.h> 9 9 #include <openssl/bn.h> 10 10 #include <openssl/rand.h> 11 #include <openssl/md2.h>12 11 #include <openssl/md4.h> 13 12 #include <openssl/md5.h> 14 13 #include <openssl/sha.h> … … static int l_rand_pseudo_bytes( lua_Stat 206 205 return 1; 207 206 } 208 207 209 static int l_md2(lua_State *L) /** md2(string s) */210 {211 size_t len;212 const unsigned char *s = (unsigned char *) luaL_checklstring( L, 1, &len );213 unsigned char digest[16];214 215 lua_pushlstring( L, (char *) MD2( s, len, digest ), 16 );216 return 1;217 }218 219 208 static int l_md4(lua_State *L) /** md4(string s) */ 220 209 { 221 210 size_t len; … … static const struct luaL_reg openssllib[ 469 458 { "bignum_mod_exp", l_bignum_mod_exp }, 470 459 { "rand_bytes", l_rand_bytes }, 471 460 { "rand_pseudo_bytes", l_rand_pseudo_bytes }, 472 { "md2", l_md2 },473 461 { "md4", l_md4 }, 474 462 { "md5", l_md5 }, 475 463 { "sha1", l_sha1 },