i have compiles & make install openssl. check check package installed correctly run following program. compiled & run correctly me. means openssl installed correctly
& not broken.
#include <openssl/engine.h> #include <openssl/evp.h> #include <openssl/err.h> int main(int c, char **v) { err_load_crypto_strings(); openssl_add_all_algorithms(); engine_load_builtin_engines(); engine_register_all_complete(); puts("stuff seems okay."); return 0; } (it build okay "gcc -wall -lcrypto test.c -o test" run fines )
now have program, uses openssl library. here getting error. if package installed correctly why error coming @ run time. openssl function have used have dependencies missed :---
does openssl requires tor ? links says similar error caused :--
https://lists.torproject.org/pipermail/tor-talk/2013-february/027252.html
https://trac.torproject.org/projects/tor/ticket/7215
md5.cpp :---
#include <stdio.h> #include <openssl/evp.h> #include "md5.h" ////////////////////////////////////////////////////////////////////// // construction/destruction ////////////////////////////////////////////////////////////////////// cmd5::cmd5( void ) { *m_szdigest = 0; } cmd5::cmd5( unsigned char *pstr ) { digest( pstr ); } cmd5::~cmd5() { } /////////////////////////////////////////////////////////////////////////////// // digest // char *cmd5::digest( unsigned char *pstr ) { evp_md_ctx mdctx; const evp_md *md; unsigned char md_value[evp_max_md_size]; unsigned int md_len; openssl_add_all_digests(); md = evp_get_digestbyname("md5"); evp_md_ctx_init( &mdctx ); evp_digestinit_ex( &mdctx, md, null ); evp_digestupdate( &mdctx, pstr, strlen( (const char *)pstr ) ); evp_digestfinal_ex( &mdctx, md_value, &md_len ); evp_md_ctx_cleanup( &mdctx ); sprintf( m_szdigest, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\0", md_value[0],md_value[1],md_value[2],md_value[3],md_value[4],md_value[5],md_value[6],md_value[7], md_value[8],md_value[9],md_value[10],md_value[11],md_value[12],md_value[13],md_value[14],md_value[15] ); return m_szdigest; }
md5.h :---
#include <openssl/md5.h> class cmd5 { public: /*! default constructor */ cmd5( void ); /*! constructor @param pstr string encrypt. */ cmd5( unsigned char *pstr ); /*! destructor */ virtual ~cmd5(); /*! perform md5 @param pstr string encrypt. @return encrypted data. */ char *digest( unsigned char *pstr ); /*! perform md5 @return encrypted data. */ char *getdigest( void ) { return m_szdigest; }; private: /*! md5 data */ char m_szdigest[128]; };
error :----
pi@raspberrypi ~ $ gdb vscpd gdb: /usr/local/lib/libcrypto.so.1.0.0: no version information available (required /usr/lib/libpython2.7.so.1.0) gdb: /usr/local/lib/libssl.so.1.0.0: no version information available (required /usr/lib/libpython2.7.so.1.0) gnu gdb (gdb) 7.4.1-debian copyright (c) 2012 free software foundation, inc. license gplv3+: gnu gpl version 3 or later <http://gnu.org/licenses/gpl.html> free software: free change , redistribute it. there no warranty, extent permitted law. type "show copying" , "show warranty" details. gdb configured "arm-linux-gnueabihf". bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... reading symbols /home/pi/vscpd...done. (gdb) break main breakpoint 1 @ 0xdd30: file vscpd.cpp, line 99. (gdb) run starting program: /home/pi/vscpd [thread debugging using libthread_db enabled] using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". program received signal sigill, illegal instruction. 0x4025f7a0 in _armv7_neon_probe () /usr/local/lib/libcrypto.so.1.0.0 (gdb) bt #0 0x4025f7a0 in _armv7_neon_probe () /usr/local/lib/libcrypto.so.1.0.0 #1 0x4025bdc4 in openssl_cpuid_setup () /usr/local/lib/libcrypto.so.1.0.0 #2 0x4000f250 in ?? () /lib/ld-linux-armhf.so.3 #3 0xbefff858 in ?? () #4 0xbefff858 in ?? () backtrace stopped: previous frame identical frame (corrupt stack?) (gdb) debug2: client_check_window_change: changed debug2: channel 0: request window-change confirm 0 (gdb)
please suggest causing error ?
try setting environment variable openssl_armcap=0 disable code.
the code in openssl_cpuid_setup assumes can trap sigill , continue if instruction unable performed. can continue in gdb , handler in openssl_cpuid_setup should let through - , should function correctly.
you (for this) use following in gdb let happen:
handle sigill pass
tim.
Comments
Post a Comment