Ticket #25593: nse_openssl.cc.diff

File nse_openssl.cc.diff, 1010 bytes (added by jmroot (Joshua Root), 14 years ago)

remove use of md2

  • nse_openssl.cc

    old new  
    88#include <openssl/crypto.h>
    99#include <openssl/bn.h>
    1010#include <openssl/rand.h>
    11 #include <openssl/md2.h>
    1211#include <openssl/md4.h>
    1312#include <openssl/md5.h>
    1413#include <openssl/sha.h>
    static int l_rand_pseudo_bytes( lua_Stat 
    206205  return 1;
    207206}
    208207
    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 
    219208static int l_md4(lua_State *L)     /** md4(string s) */
    220209{
    221210  size_t len;
    static const struct luaL_reg openssllib[ 
    469458  { "bignum_mod_exp", l_bignum_mod_exp },
    470459  { "rand_bytes", l_rand_bytes },
    471460  { "rand_pseudo_bytes", l_rand_pseudo_bytes },
    472   { "md2", l_md2 },
    473461  { "md4", l_md4 },
    474462  { "md5", l_md5 },
    475463  { "sha1", l_sha1 },