problem of OpenSSL on MIPS R3000
Hello, everyone, I just cross compile the OpenSSL 0.9.7 under linux by mipsel-linux-gcc for MIPS R3000, no error occur during the compiling process. But, when I put the result lib to the hard platform, the openssl routines can not be carried out and “segment fault” occurs. Why? Does the OpenSSL not support the MIPS? How should I do to cross compile for MIPS R3000? The debug info is : == GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=mipsel-linux --target=mipsel-linux-uclibc". (gdb) core core.186 Core was generated by `./drmCli'. Program terminated with signal 11, Segmentation fault. #0 0x0044cdac in EVP_des_cbc () (gdb) where #0 0x0044cdac in EVP_des_cbc () #1 0x00427b4c in SSL_library_init () #2 0x00427b4c in SSL_library_init () #3 0x00400cd0 in transend (properlistInfo=0x100383f0 "", acIP=0x574f50 "192.168.18.155", acPORT=) at main.c:93 #4 0x00402a70 in cliskthread () at main.c:770 #5 0x004eac48 in pthread_start_thread () #6 0x00527c20 in __thread_start () Previous frame inner to this frame (corrupt stack?) (gdb) ulimit -c unlimited mipsel-linux-gdb drmCli core core.123 where == The transend function is: void transend(char *properlistInfo,const char* acIP,int acPORT) { /*-- */ //char P[2000]; struct ProperTable p; struct ProperTable *pp; pp = &p; int err; int sd; struct sockaddr_in sa; SSL_CTX* ctx; SSL* ssl; X509*server_cert; char*str; char buf2 [4096]; char*bufp; bufp = buf2; SSL_METHOD *meth; /*-*/ //memset(P,0,sizeof(P)); //i = propertable_gen(type,userid,pid,data,pp); pp = (struct ProperTable *)properlistInfo; printf("transend p.Type=%x\n",(*pp).Type); printf("transend p.UserID=%x\n",(*pp).UserID); printf("transend p.PID=%x\n",(*pp).PID); printf("transend p.Lenth=%d\n",(*pp).Lenth); printf("transend p.Data=%s\n",(*pp).Data); /**/ SSLeay_add_ssl_algorithms(); meth = SSLv2_client_method(); SSL_load_error_strings(); ctx = SSL_CTX_new (meth);CHK_NULL(ctx); CHK_SSL(err); /* --- */ /* Create a socket and connect to server using normal socket calls. */ sd = socket (AF_INET, SOCK_STREAM, 0); CHK_ERR(sd, "socket"); memset (&sa, '\0', sizeof(sa)); sa.sin_family = AF_INET; // sa.sin_addr.s_addr = inet_addr ("127.0.0.1"); /* Server IP */ //sa.sin_addr.s_addr = inet_addr ("10.64.104.168"); /*Server IP */ sa.sin_addr.s_addr = inet_addr (acIP); // sa.sin_port= htons (); /* Server Port number */ sa.sin_port = htons(acPORT); /* Server Port number */ err = connect(sd, (struct sockaddr*) &sa,sizeof(sa)); CHK_ERR(err, "connect"); /* --- */ /* Now we have TCP conncetion. Start SSL negotiation. */ ssl = SSL_new (ctx); CHK_NULL(ssl); SSL_set_fd (ssl, sd); err = SSL_connect (ssl); CHK_SSL(err); /* Following two steps are optional and not required for data exchange to be successful. */ /* Get the cipher - opt */ printf ("SSL connection using %s\n", SSL_get_cipher (ssl)); /* Get server's certificate (note: beware of dynamic allocation) - opt */ server_cert = SSL_get_peer_certificate (ssl); CHK_NULL(server_cert); printf ("Server certificate:\n"); str = X509_NAME_oneline (X509_get_subject_name (server_cert),0,0); CHK_NULL(str); printf ("\t subject: %s\n", str); OPENSSL_free (str); str = X509_NAME_oneline (X509_get_issuer_name (server_cert),0,0); CHK_NULL(str); printf ("\t issuer: %s\n", str); OPENSSL_free (str); /* We could do all sorts of certificate verification stuff here before deallocating the certificate. */ X509_free (server_cert); /* --- */ /* DATA EXCHANGE - Send a message and receive a reply. */ //err = SSL_write (ssl, pp, sizeof(*pp)); CHK_SSL(err); //err = SSL_write (ssl, properlistInfo, strlen(properlistInfo)); CHK_SSL(err); //print properlistInfo err = SSL_write (ssl, properlistInfo, sizeof(struct ProperTable)); CHK_SSL(err); err = SSL_read (ssl, buf2, sizeof(buf2) - 1); CHK_SSL(err); buf2[err] = '\0'
Re: [openssl.org #1451] PATCH (Re: Cross compile OpenSSL in Linux using MinGW32)
Hello, Can I further help regarding this issue? Is something wrong with the patch? I will fix per your comments. Best Regards, Aon Bar-Lev. __ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager [EMAIL PROTECTED]
[openssl.org #1476] bug report s3_srvr.c OpenSSL-0.9.8d
fixed in 0.9.8-stable and in the cvs head. Please test a new snapshot. Thanks ! Cheers, Nils __ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager [EMAIL PROTECTED]
[Fwd: [openssl.org #1480]]
RT access configuration has been changed. Best regards, Lutz --- Begin Message --- This transaction appears to have no content __ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager [EMAIL PROTECTED] --- End Message ---
[openssl.org #1480]
This transaction appears to have no content __ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager [EMAIL PROTECTED]
[openssl.org #1479]
This transaction appears to have no content __ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager [EMAIL PROTECTED]
[openssl.org #1478] BUG: Compile error on AIX 4.3 with zlib and IBM C-Compiler
Type: Bug Version: 0.9.8b, 0.9.8d (0.9.8c not tested) Operating System: AIX 4.3.3 ML11 Compiler: IBM VAC 5.0.2.9 Hardware: Bull Escala T104, PowerPC 604e, 32bit Description: When I try to compile the package with zlib and statical linking, I get a compile error. The file zlib.h cannot be found, even tough I explicitly specified the location. I built with: ./config --prefix=/usr/local --openssldir=/usr/local/share/ssl \ zlib no-shared \ --with-zlib-lib=/usr/local/lib \ --with-zlib-include=/usr/local/include and then: make The error message is: ... making all in crypto/comp... cc -I.. -I../.. -I../../include -DZLIB -DOPENSSL_THREADS -qthreaded -DDSO_DLFCN -DHAVE_DLFCN_H -q32 -O -DB_ENDIAN -qmaxmem=16384 -c comp_lib.c cc -I.. -I../.. -I../../include -DZLIB -DOPENSSL_THREADS -qthreaded -DDSO_DLFCN -DHAVE_DLFCN_H -q32 -O -DB_ENDIAN -qmaxmem=16384 -c comp_err.c cc -I.. -I../.. -I../../include -DZLIB -DOPENSSL_THREADS -qthreaded -DDSO_DLFCN -DHAVE_DLFCN_H -q32 -O -DB_ENDIAN -qmaxmem=16384 -c c_rle.c cc -I.. -I../.. -I../../include -DZLIB -DOPENSSL_THREADS -qthreaded -DDSO_DLFCN -DHAVE_DLFCN_H -q32 -O -DB_ENDIAN -qmaxmem=16384 -c c_zlib.c "c_zlib.c", line 25.10: 1506-296 (S) #include file not found. "c_zlib.c", line 112.9: 1506-046 (S) Syntax error. "c_zlib.c", line 114.9: 1506-278 (S) The structure definition must specify a member list. "c_zlib.c", line 136.33: 1506-045 (S) Undeclared identifier Z_NULL. "c_zlib.c", line 144.37: 1506-045 (S) Undeclared identifier z_stream. "c_zlib.c", line 144.17: 1506-045 (S) Undeclared identifier ZLIB_VERSION. "c_zlib.c", line 145.20: 1506-045 (S) Undeclared identifier Z_OK. "c_zlib.c", line 155.44: 1506-045 (S) Undeclared identifier Z_DEFAULT_COMPRESSION. "c_zlib.c", line 187.19: 1506-045 (S) Undeclared identifier Z_OK. "c_zlib.c", line 200.48: 1506-045 (S) Undeclared identifier Z_SYNC_FLUSH. "c_zlib.c", line 214.19: 1506-045 (S) Undeclared identifier Z_OK. "c_zlib.c", line 228.48: 1506-045 (S) Undeclared identifier Z_SYNC_FLUSH. make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 1. Stop. ... It seems to me that the Configure script doesn't generate correct Makefiles, because there's no "-I/usr/local/include" in the compiler invocation. Normally, there should be a "-I/usr/local/include" in the line "INCLUDES=" in crypto/comp/Makefile, if I specify the zlib include dir, but it isn't. Furthermore, if I add "-I/usr/local/include" to the line "INCLUDES=" in crypto/comp/Makefile, it isn't used. I had to add it to crypto/Makefile to be honored. Now, with the line INCLUDES= -I.. -I../.. -I../../include -I/usr/local/include in crypto/Makefile, the compile run gives the next error. The zlib library file (libz.a) cannot be found. The error message is: ... making all in apps... cc -DMONOLITH -I.. -I../include -DZLIB -DOPENSSL_THREADS -qthreaded -DDSO_DLFCN -DHAVE_DLFCN_H -q32 -O -DB_ENDIAN -qmaxmem=16384 -c verify.c ... cc -DMONOLITH -I.. -I../include -DZLIB -DOPENSSL_THREADS -qthreaded -DDSO_DLFCN -DHAVE_DLFCN_H -q32 -O -DB_ENDIAN -qmaxmem=16384 -c openssl.c rm -f openssl shlib_target=; if [ -n "" ]; then shlib_target="aix-shared"; fi; if [ "${shlib_target}" = "darwin-shared" ] ; then LIBRARIES="../libssl.a ../libcrypto.a" ; else LIBRARIES="-L.. -lssl -L.. -lcrypto" ; fi; make -f ../Makefile.shared -e APPNAME=openssl OBJECTS="openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o spkac.o smime.o rand.o engine.o ocsp.o prime.o" LIBDEPS=" $LIBRARIES -lz" link_app.${shlib_target} ( :;LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto -lz}"; LDCMD="${LDCMD:-cc}"; LDFLAGS="${LDFLAGS:--DZLIB -DOPENSSL_THREADS -qthreaded -DDSO_DLFCN -DHAVE_DLFCN_H -q32 -O -DB_ENDIAN -qmaxmem=16384}"; LIBPATH=`for x in $LIBDEPS; do if echo $x | grep '^ *-L' > /dev/null 2>&1; then echo $x | sed -e 's/^ *-L// '; fi; done | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o spkac.o smime.o rand.o engine.o ocsp.o prime.o ${LIBDEPS} ) ld: 0706-006 Cannot find or open library file: -l z ld:open(): A file or directory in the path name does not exis
[openssl.org #1477]
This transaction appears to have no content __ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager [EMAIL PROTECTED]
does openssl support (or up to support) twofish and serpent
Dear openssl developers: as title. besides, I found that openssl doesn't support CAST-256 (yet). A trivial question, if I want to replace S-BOXes in symmetric cipher, is there S-BOX generator available? Thanks for your attention. -- Best regards, Hong-Bin blog: http://furseal.wordpress.com msn: [EMAIL PROTECTED] __ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager [EMAIL PROTECTED]