From fw at deneb.enyo.de Thu Jul 1 00:12:47 2004 From: fw at deneb.enyo.de (Florian Weimer) Date: Tue Jul 6 16:41:29 2004 Subject: patch for libgcrypt 1.2.0 on pthreads In-Reply-To: <878ye64fc4.fsf@wheatstone.g10code.de> (Werner Koch's message of "Tue, 29 Jun 2004 16:19:07 +0200") References: <40DB60C8.7050100@danger.com> <878ye64fc4.fsf@wheatstone.g10code.de> Message-ID: <87pt7gwv8g.fsf@deneb.enyo.de> * Werner Koch: > malloc returns void* and that type must be assignable to any other > pointer object. Thus this patch does not make sense for C. The patch is for a header file, which probably should be made C++-friendly if it's supposed to be a public interface. (But at least in libgcrypt 1.1.90, the offending parts are missing from that file.) From lowhalo at hush.com Sun Jul 4 04:35:22 2004 From: lowhalo at hush.com (low halo, Defender of Truth and Liberty) Date: Tue Jul 6 16:45:09 2004 Subject: libgcrypt 1.2.0 crash Message-ID: <200407040235.i642ZQAN041460@mailserver3.hushmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A bug in my base64 functions triggered this crash. Sorry, but I don't have the exact input that caused it. I hope this backtrace helps anyway: Program received signal SIGFPE, Arithmetic exception. 0x40058b7f in gcry_mpi_powm (res=0x805a798, base=0x805a810, expo=0x1, mod=0x805a860) at mpi-pow.c:73 73 mpi-pow.c: No such file or directory. in mpi-pow.c (gdb) bt full #0 0x40058b7f in gcry_mpi_powm (res=0x805a798, base=0x805a810, expo=0x1, mod=0x805a860) at mpi-pow.c:73 rp = 0x805a878 ep = 0x0 bp = 0x4006c570 esize = 0 msize = 0 bsize = -1073747032 rsize = 0 msign = 0 bsign = 1074185584 rsign = 1077057184 esec = 0 msec = 0 bsec = 0 rsec = 0 mod_shift_cnt = 1073868800 negative_result = 3004 mp_marker = 0x400147a0 bp_marker = 0x0 ep_marker = 0x0 xp_marker = 0x0 mp_nlimbs = 0 - ---Type to continue, or q to quit--- bp_nlimbs = 0 ep_nlimbs = 0 xp_nlimbs = 0 assign_rp = 0 tspace = 0x0 tsize = 0 #1 0x4004bbe9 in check_secret_key (sk=0xbfffec40) at dsa.c:280 rc = -1073746880 y = 0x805a798 #2 0x4004bfb1 in _gcry_dsa_check_secret_key (algo=17, skey=0x1) at dsa.c:405 err = GPG_ERR_NO_ERROR sk = {p = 0x805a860, q = 0x805a838, g = 0x805a810, y = 0x805a7e8, x = 0x805a7c0} #3 0x4002c027 in pubkey_check_secret_key (algorithm=17, skey=0x1) at pubkey.c:506 err = GPG_ERR_PUBKEY_ALGO pubkey = 0x8057178 #4 0x4002e448 in gcry_pk_testkey (s_key=0x1) at pubkey.c:1760 module = 0x8057178 key = (gcry_mpi_t *) 0x805a888 rc = GPG_ERR_NO_ERROR - low halo - -- low halo Defender of Truth and Liberty http://ultramagnetic.sourceforge.net/ http://www.hacktivismo.com/ http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x3AFB17F6 9AB1 FF04 016F 89A3 5B4E A585 BDBB 5FBE 3AFB 17F6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Your Mother) iD8DBQFA52wQvbtfvjr7F/YRAtQFAJwPOdVzPMLzGxbnqYh1xqh/qVMWbgCgg3RL 5MekGDAVBNLgoZdH2byUy9E= =1Gsv -----END PGP SIGNATURE----- Concerned about your privacy? Follow this link to get secure FREE email: http://www.hushmail.com/?l=2 Free, ultra-private instant messaging with Hush Messenger http://www.hushmail.com/services-messenger?l=434 Promote security and make money with the Hushmail Affiliate Program: http://www.hushmail.com/about-affiliate?l=427 From moritz at duesseldorf.ccc.de Sun Jul 4 18:44:41 2004 From: moritz at duesseldorf.ccc.de (Moritz Schulte) Date: Wed Jul 14 18:13:00 2004 Subject: serpent fix for sparc64 In-Reply-To: <20040622031438.GB18868@marvin.sec.informatik.tu-darmstadt.de> References: <20040622031438.GB18868@marvin.sec.informatik.tu-darmstadt.de> Message-ID: <86u0wn90xy.wl@duesseldorf.ccc.de> At Tue, 22 Jun 2004 05:14:38 +0200, Nikolay Sturm wrote: > Following diff fixes serpent on sparc64/OpenBSD. (please cc me in > answers, as I am not subscribed) Thanks, the patch is in CVS now. moritz From wk at gnupg.org Wed Jul 7 12:03:35 2004 From: wk at gnupg.org (Werner Koch) Date: Wed Jul 14 18:14:39 2004 Subject: patch for libgcrypt 1.2.0 on pthreads In-Reply-To: <87pt7gwv8g.fsf@deneb.enyo.de> (Florian Weimer's message of "Thu, 01 Jul 2004 00:12:47 +0200") References: <40DB60C8.7050100@danger.com> <878ye64fc4.fsf@wheatstone.g10code.de> <87pt7gwv8g.fsf@deneb.enyo.de> Message-ID: <871xjoi16w.fsf@wheatstone.g10code.de> On Thu, 01 Jul 2004 00:12:47 +0200, Florian Weimer said: > The patch is for a header file, which probably should be made > C++-friendly if it's supposed to be a public interface. (But at least True, but the offending macro is just a convenience for C code. Werner From nmav at gnutls.org Sat Jul 10 12:18:33 2004 From: nmav at gnutls.org (Nikos Mavroyanopoulos) Date: Wed Jul 14 18:15:29 2004 Subject: RSA blinding Message-ID: <200407101318.33089.nmav@gnutls.org> Hello, In rsa.c:546 it seems there is a memory leak. if (! (flags & PUBKEY_FLAG_NO_BLINDING)) { /* Undo blinding. */ gcry_mpi_t a = gcry_mpi_copy (y); gcry_mpi_release (y); y = rsa_unblind (a, ri, sk.n); } a does not get freed anywhere. -- Nikos Mavroyanopoulos From salvatore_uni at tiscali.it Wed Jul 14 01:37:18 2004 From: salvatore_uni at tiscali.it (salvatore) Date: Fri Jul 16 11:07:58 2004 Subject: decrypting string Message-ID: <200407140137.18957.salvatore_uni@tiscali.it> Hi... I'm trying to implement rsa algorithm into my program by using libgcrypt functions.I had a look at some examples under the test directory but i still have some doubts about encrypting and decrypting.Where i can find some more example on how to encrypt and decrypt strings with gcry_pk(encrypt| decrypt)?? I have also some doubts on how to save key on files;what format should i use?! Thanks in advance Salvo From mo at g10code.com Wed Jul 14 18:54:09 2004 From: mo at g10code.com (Moritz Schulte) Date: Fri Jul 16 11:08:24 2004 Subject: RSA blinding In-Reply-To: <200407101318.33089.nmav@gnutls.org> References: <200407101318.33089.nmav@gnutls.org> Message-ID: <863c3u8r7y.wl@duesseldorf.ccc.de> Thanks, the problem is fixed in CVS. From salvatore_uni at tiscali.it Thu Jul 15 14:09:55 2004 From: salvatore_uni at tiscali.it (salvatore) Date: Fri Jul 16 11:09:20 2004 Subject: newbie questions Message-ID: <200407151409.55842.salvatore_uni@tiscali.it> Hi guys, After reading ALL the messages in the mailing list since 1999 i was finally able to write some working code(almost working).I also had a look at the code in the test dir.Ok i'll go straight to the point... here is the code int main() { gcry_sexp_t p_key, s_key, data_to_encrypt, data_encrypted, data_decrypted; gcry_mpi_t mpi_string, mpi_decrypted; char buffer[1024],d_buffer[1024]; size_t len_buffer, written; int err; printf("\nGenerating RSA key...\n"); sleep(1); generate_rsa_keys(&p_key,&s_key); printf("\nTo encrypt a buffer these are the steps ... \ \nchar -> mpi -> S-exp -> cripta \ \n"); printf("\nString to encrypt ---> "); fgets(buffer, 1024, stdin); len_buffer = strlen(buffer); printf("\nChar -> mpi ...\t"); if( err = gcry_mpi_scan( &mpi_string,GCRYMPI_FMT_USG, buffer, len_buffer, NULL) ) /* From char to mpi */ { fprintf(stderr,"Errore nella conversione da char a mpi\n"); exit(1); } sleep(1); printf("[ok]\n"); printf("\nmpi -> S-exp ...\t"); if( err = gcry_sexp_build( &data_to_encrypt, NULL, "(data(flags raw)(value %m))",mpi_string)) /* From mpi to S-exp */ { fprintf(stderr,"Errore nella conversione da mpi a S-exp\n"); exit(1); } sleep(1); printf("[ok]\n"); gcry_mpi_release( mpi_string ); /* la mpi non serve piu */ printf("\nCripta la S-exp...\t"); if( err = gcry_pk_encrypt( &data_encrypted, data_to_encrypt ,p_key)) /* Encrpt the S-exp in data_to_crypt and put the result in data encrypted */ { fprintf(stderr,"Errore durante la criptazione\n"); exit(1); } sleep(1); printf("[ok]\n"); gcry_sexp_release( data_to_encrypt ); /* non serve piu */ printf("\nAdesso facciamo il contrario... \ \ndecripta -> S-exp -> mpi -> char \ \n"); printf("\nDecripta la S-exp...\t"); sleep(1); if( err = gcry_pk_decrypt( &data_decrypted, data_encrypted, s_key) ) /* decripta la S-exp */ { fprintf(stderr,"Errore durante la decriptazione\n"); exit(1); } sleep(1); printf("[ok]\n"); gcry_sexp_release( data_encrypted ); /* non server piu */ printf("\nS-exp -> mpi ...\t"); if( (mpi_decrypted = gcry_sexp_nth_mpi( data_decrypted, 0 , 0 )) == NULL ) /* da S-exp a mpi */ { fprintf(stderr,"Errore nella conversione da S-exp a mpi\n"); exit(1); } sleep(1); printf("[ok]\n"); gcry_sexp_release( data_decrypted ); printf("\nmpi -> char ...\t"); /* I think here is the problem */ if( err = gcry_mpi_print(GCRYMPI_FMT_USG, d_buffer, len_buffer, &written, mpi_decrypted )) /* da mpi a char */ { fprintf(stderr,"Errore nella conversione da mpi a char \n"); exit(1); } sleep(1); printf("[ok]\n"); gcry_mpi_release( mpi_decrypted ); /* non serve piu */ printf("\n La stringa decriptata ----> %s",d_buffer); /* se coincide con buffer funziona! */ return 0; } The problem is that the string decrypted is the one i entered PLUS some weird characters!!Really don't where those characters come from.What do i do wrong?! Thanks in advance Regards Salvo From nmav at gnutls.org Fri Jul 16 01:37:57 2004 From: nmav at gnutls.org (Nikos Mavroyanopoulos) Date: Fri Jul 16 11:09:28 2004 Subject: patch for libgcrypt 1.2.0 on pthreads In-Reply-To: <871xjoi16w.fsf@wheatstone.g10code.de> References: <40DB60C8.7050100@danger.com> <87pt7gwv8g.fsf@deneb.enyo.de> <871xjoi16w.fsf@wheatstone.g10code.de> Message-ID: <200407160237.57255.nmav@gnutls.org> On Wednesday 07 July 2004 13:03, Werner Koch wrote: > On Thu, 01 Jul 2004 00:12:47 +0200, Florian Weimer said: > > The patch is for a header file, which probably should be made > > C++-friendly if it's supposed to be a public interface. (But at least > True, but the offending macro is just a convenience for C code. Well it could be inserted into an extern "C" block. Since the changes to support c++ are that trivial, I don't think that we should introduce that inconvenience to c++ programmers. > Werner -- Nikos Mavroyanopoulos From salvatore_uni at tiscali.it Sat Jul 17 23:14:02 2004 From: salvatore_uni at tiscali.it (salvatore) Date: Sat Jul 17 23:02:51 2004 Subject: code Message-ID: <200407172314.02490.salvatore_uni@tiscali.it> I'm trying to figure out what is wrong with my decrypt_function,could you have a look at it.. /* Encrypt the buffer in b_to_encrypt */ int encrypt_buffer(char *b_to_encrypt, char *b_encrypted ) { gcry_sexp_t data_to_encrypt, data_encrypted; gcry_mpi_t mpi_string; int err; /* i don't really know if it's necessary */ memset( b_encrypted,0,MAX_CHARS ); /* Char ---> MPI */ if( (err = gcry_mpi_scan( &mpi_string,GCRYMPI_FMT_USG, b_to_encrypt, MAX_CHARS , NULL)) ) { fprintf(stderr,"Error while converting from char to MPI\n"); return 0; } /* MPI -----> S-exp */ if( (err = gcry_sexp_build( &data_to_encrypt, NULL, "(data(flags raw)(value %m))",mpi_string)) ) { fprintf(stderr,"Error while converting from mpi to S-exp\n"); return 0; } gcry_mpi_release( mpi_string ); /* Encrypt the S-exp with his public key */ if( (err = gcry_pk_encrypt( &data_encrypted, data_to_encrypt ,key.his_public_key)) ) { fprintf(stderr,"Error while encrypting\n"); return 0; } gcry_sexp_release( data_to_encrypt ); /* Convert encrypted S-exp to a valid format so i can send it trought internet (or save in a file) */ gcry_sexp_sprint(data_encrypted, GCRYSEXP_FMT_CANON, b_encrypted, MAX_CHARS ); gcry_sexp_release( data_encrypted ); return 1; } /* Decrypt buffer in b_to_decrypt */ int decrypt_buffer(char *b_to_decrypt, char *b_decrypted, int n_bytes ) { gcry_sexp_t data_to_decrypt, data_decrypted; gcry_mpi_t mpi_decrypted; size_t written; int rc, error_code; /* Char ----> S-exp */ if( (rc = gcry_sexp_sscan(&data_to_decrypt, &error_code, b_to_decrypt, n_bytes )) ) { fprintf(stderr,"Error while converting from char to S-exp "); return 0; } /* Decrypt with my private key */ if( (rc = gcry_pk_decrypt( &data_decrypted, data_to_decrypt, key.my_private_key)) ) { fprintf(stderr,"Error while decrypting \n"); return 0; } gcry_sexp_release( data_to_decrypt ); /* I think here is the error,because i don't understand how this function work */ if( (mpi_decrypted = gcry_sexp_nth_mpi( data_decrypted, 0 , GCRYMPI_FMT_USG )) == NULL ) { fprintf(stderr,"Error while converting from S-exp to mpi \n"); return 0; } gcry_sexp_release( data_decrypted ); /* Convert the decrypted mpi to the original string */ if( (rc = gcry_mpi_print(GCRYMPI_FMT_USG, b_decrypted, MAX_CHARS , &written, mpi_decrypted ) )) { fprintf(stderr,"Error while converting from mpi to char \n"); return 0; } gcry_mpi_release( mpi_decrypted ); return 1; } I don't get any error from neither of these functions but when i display the decrypted buffer it's still encrypted. Can anybody give me a hint?! Regards Salvo From smurf at smurf.noris.de Sat Jul 17 23:26:57 2004 From: smurf at smurf.noris.de (Matthias Urlichs) Date: Sat Jul 17 23:24:02 2004 Subject: code In-Reply-To: <200407172314.02490.salvatore_uni@tiscali.it> References: <200407172314.02490.salvatore_uni@tiscali.it> Message-ID: <20040717212656.GC21288@kiste> Hi, salvatore: > int encrypt_buffer(char *b_to_encrypt, char *b_encrypted ) > int decrypt_buffer(char *b_to_decrypt, char *b_decrypted, int n_bytes ) > > I don't get any error from neither of these functions but when i > display the decrypted buffer it's still encrypted. Can anybody give me > a hint?! > Hmmm... you might want to send a complete test program (i.e. one that has main() ;-) which demonstratess the problem. -- Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : /pipermail/attachments/20040717/45d55ab0/attachment.bin From salvatore_uni at tiscali.it Sun Jul 18 13:54:40 2004 From: salvatore_uni at tiscali.it (salvatore) Date: Sun Jul 18 13:43:21 2004 Subject: code In-Reply-To: <20040717212656.GC21288@kiste> References: <200407172314.02490.salvatore_uni@tiscali.it> <20040717212656.GC21288@kiste> Message-ID: <200407181354.40687.salvatore_uni@tiscali.it> I can't sent you all the program but i can make a short test program.Anyway the program i am working on is basically a chat,which encrypt the test before it sends it(with his public key) and it decripts the message with the private.I also find out that the program works locally,but i tested it on two different computers i get a SegFault.So i was wondering if those functions are correct... (?) Thanks Salvo On Saturday 17 July 2004 23:26, you wrote: > Hi, > > salvatore: > > int encrypt_buffer(char *b_to_encrypt, char *b_encrypted ) > > int decrypt_buffer(char *b_to_decrypt, char *b_decrypted, int n_bytes ) > > > > I don't get any error from neither of these functions but when i > > display the decrypted buffer it's still encrypted. Can anybody give me > > a hint?! > > > Hmmm... you might want to send a complete test program (i.e. one that > has main() ;-) which demonstratess the problem. > > -- > Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de > From mo at g10code.com Sun Jul 18 14:48:52 2004 From: mo at g10code.com (Moritz Schulte) Date: Sun Jul 18 14:45:55 2004 Subject: decrypting string In-Reply-To: <200407140137.18957.salvatore_uni@tiscali.it> References: <200407140137.18957.salvatore_uni@tiscali.it> Message-ID: <86r7r9qy4r.wl@duesseldorf.ccc.de> At Wed, 14 Jul 2004 01:37:18 +0200, salvatore wrote: > I have also some doubts on how to save key on files;what format > should i use?! Well, it's your decision. Libgcrypt does not implement formats like OpenPGP or SSH key blobs (although you could implement them on top of Libgcrypt). Storing the key material (i.e. the MPI values) is easy to do; another approach, which is used by gpg-agent, is to store complete S-Expressions. moritz From salvatore_uni at tiscali.it Sun Jul 18 20:51:25 2004 From: salvatore_uni at tiscali.it (salvatore) Date: Sun Jul 18 20:40:05 2004 Subject: decrypting string In-Reply-To: <86r7r9qy4r.wl@duesseldorf.ccc.de> References: <200407140137.18957.salvatore_uni@tiscali.it> <86r7r9qy4r.wl@duesseldorf.ccc.de> Message-ID: <200407182051.25935.salvatore_uni@tiscali.it> I stored them as S-exp in CANON format and it seems they work absolutely fine Thanks On Sunday 18 July 2004 14:48, you wrote: > At Wed, 14 Jul 2004 01:37:18 +0200, salvatore wrote: > > > I have also some doubts on how to save key on files;what format > > should i use?! > > Well, it's your decision. Libgcrypt does not implement formats like > OpenPGP or SSH key blobs (although you could implement them on top of > Libgcrypt). Storing the key material (i.e. the MPI values) is easy to > do; another approach, which is used by gpg-agent, is to store complete > S-Expressions. > > moritz > From wk at gnupg.org Mon Jul 19 09:04:16 2004 From: wk at gnupg.org (Werner Koch) Date: Mon Jul 19 09:20:18 2004 Subject: code In-Reply-To: <200407172314.02490.salvatore_uni@tiscali.it> (salvatore_uni@tiscali.it's message of "Sat, 17 Jul 2004 23:14:02 +0200") References: <200407172314.02490.salvatore_uni@tiscali.it> Message-ID: <87fz7oxytr.fsf@wheatstone.g10code.de> s/gg_strerror/gpg_strerror/ From wk at gnupg.org Mon Jul 19 09:03:47 2004 From: wk at gnupg.org (Werner Koch) Date: Mon Jul 19 09:20:56 2004 Subject: code In-Reply-To: <200407172314.02490.salvatore_uni@tiscali.it> (salvatore_uni@tiscali.it's message of "Sat, 17 Jul 2004 23:14:02 +0200") References: <200407172314.02490.salvatore_uni@tiscali.it> Message-ID: <87k6x0xyuk.fsf@wheatstone.g10code.de> On Sat, 17 Jul 2004 23:14:02 +0200, salvatore said: > fprintf(stderr,"Error while converting from char to MPI\n"); fprintf(stderr,"Error while converting from char to MPI: %s\n", gg_strerror (err) ); should give you a better insight what's going wrong. Werner From rajoshi at cisco.com Thu Jul 15 04:51:24 2004 From: rajoshi at cisco.com (Rajeev Joshi) Date: Mon Jul 19 13:33:09 2004 Subject: Need Help Message-ID: <4.3.2.7.2.20040714194948.0213aae8@wells.cisco.com> I am importing Public Key by doing 'gpg --import keyFile'. After i do this, it shows in error 'time warp or clock problem'. Need some help on this pls. Thanks, Rajeev. From wk at gnupg.org Mon Jul 19 19:01:08 2004 From: wk at gnupg.org (Werner Koch) Date: Mon Jul 19 19:03:20 2004 Subject: Need Help In-Reply-To: <4.3.2.7.2.20040714194948.0213aae8@wells.cisco.com> (Rajeev Joshi's message of "Wed, 14 Jul 2004 19:51:24 -0700") References: <4.3.2.7.2.20040714194948.0213aae8@wells.cisco.com> Message-ID: <87fz7orkx7.fsf@wheatstone.g10code.de> On Wed, 14 Jul 2004 19:51:24 -0700, Rajeev Joshi said: > I am importing Public Key by doing 'gpg --import keyFile'. > After i do this, it shows in error 'time warp or clock problem'. > Need some help on this pls. Easy: Throttle back to Warp 0 and use the impulse drive while importing keys ;-) The clock on one of the machines is somewhat off. For example, you created a key at 2004-07-19 12:00:00Z and then tried to import it on a machine where the clock says 2004-07-19 11:00:00Z. Ether wait a while or use the option --ignore-time-conflict. Hth, Werner From salvatore_uni at tiscali.it Mon Jul 19 20:49:00 2004 From: salvatore_uni at tiscali.it (salvatore) Date: Mon Jul 19 20:37:57 2004 Subject: code In-Reply-To: <87fz7oxytr.fsf@wheatstone.g10code.de> References: <200407172314.02490.salvatore_uni@tiscali.it> <87fz7oxytr.fsf@wheatstone.g10code.de> Message-ID: <200407192049.00957.salvatore_uni@tiscali.it> On Monday 19 July 2004 09:04, Werner Koch wrote: > s/gg_strerror/gpg_strerror/ > > Didn't work for me... but i tried gcry_sterror() Thanks From salvatore_uni at tiscali.it Mon Jul 19 21:44:26 2004 From: salvatore_uni at tiscali.it (salvatore) Date: Mon Jul 19 21:33:23 2004 Subject: new interface Message-ID: <200407192144.26680.salvatore_uni@tiscali.it> I'm still working on those encrypt and decrypt functions but i still didnt solve the problem.As you saw in one of my previous mail i used the old interface with S-exp,so since i use old interface in all my program(i.e. generation of key) i was wondering if they are compatible with the new interface(gcry_ac_*),that is,if i generate RSA with old interface and then encrypt using the new interface(gcry_ac_*),will i have problems!?Or shall i rewrite everything using the new interface?!?! Regards Salvo From job at jobbogan.com Tue Jul 20 07:22:17 2004 From: job at jobbogan.com (job@jobbogan.com) Date: Tue Jul 20 10:45:17 2004 Subject: assertion in _gcry_ath_mutex_lock Message-ID: <200407200522.i6K5MIft028244@piquin.uchicago.edu> I'm getting assertions w/ openldap 2.1.20 compiled against gnutls-1.0.16 & libgcrypt-1.2.0. I've tried several versions of gnutls & libgcrypt but the failure mode is constant across all the versions I've tried. I've attached a stack trace. The other active threads differ from crash to crash, but the asserting thread is constant. If there's other debugging info that would help, just let me know. Thanks job here's what I'm currently running (debian testing base): gnutls-1.0.16.tar.bz2 libgcrypt11_1.2.0.orig.tar.gz libtasn1-0.2.10.tar.gz opencdk8_0.5.5.orig.tar.gz openldap2_2.1.30.orig.tar.gz pella:~# !gd gdb /usr/sbin/slapd GNU gdb 6.1-debian 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 "i386-linux"...(no debugging symbols found)...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run -d0 Starting program: /usr/sbin/slapd -d0 [Thread debugging using libthread_db enabled] [New Thread 16384 (LWP 11139)] [New Thread 32769 (LWP 11168)] [New Thread 16386 (LWP 11169)] [New Thread 32771 (LWP 11171)] [New Thread 49156 (LWP 11173)] [New Thread 65541 (LWP 11176)] [New Thread 81926 (LWP 11177)] slapd: ath.c:181: _gcry_ath_mutex_lock: Assertion `*lock == ((ath_mutex_t) 0)' failed. Program received signal SIGABRT, Aborted. [Switching to Thread 32771 (LWP 11171)] 0x4037a721 in kill () from /lib/libc.so.6 (gdb) bt #0 0x4037a721 in kill () from /lib/libc.so.6 #1 0x402f5771 in pthread_kill () from /lib/libpthread.so.0 #2 0x402f5a7b in raise () from /lib/libpthread.so.0 #3 0x4037a4d4 in raise () from /lib/libc.so.6 #4 0x4037b9e8 in abort () from /lib/libc.so.6 #5 0x40373b3f in __assert_fail () from /lib/libc.so.6 #6 0x4024fe9b in _gcry_ath_mutex_lock (lock=0x40293920) at ath.c:177 #7 0x4025cbaf in _gcry_fast_random_poll () at random.c:991 #8 0x402587b5 in md_open (h=0x0, algo=2, secure=0, hmac=2) at md.c:441 #9 0x402588b2 in gcry_md_open (h=0x0, algo=0, flags=1076866676) at md.c:472 #10 0x401e3000 in _gnutls_hmac_init (algorithm=GNUTLS_MAC_SHA, key=0x41809d10, keylen=20) at gnutls_hash_int.c:155 #11 0x401d8105 in _gnutls_compressed2ciphertext (session=0x41803570, cipher_data=0x818196d "\023H@?\177\037\006o???u?NABh\rVd\a?\006?Q", cipher_size=2596, compressed= {data = 0x8124a38 "?Z\236?$??\002?'I\231\224D+?\220M?(??\226g(?b\031??Ln??^B?\031\212???\031", size = 48}, _type=0, random_pad=0) at gnutls_cipher.c:176 #12 0x401d7e4c in _gnutls_encrypt (session=0x41803570, headers=0x0, headers_size=5, data=0x81277d8 "0\202\001&\002\001\003d\202\001\037\0049uid=vba-daemon-start,ou=People,dc=vanburenadvisors,dc=com0\201?0\030\004\002cn1\022\004\020vba-daemon-start0:\004\vobjectClass1+\004\aaccount\004\fposixAccount\004\rshadowAccount\004\003top0\031\004\003uid1\022\004\020vba-daemon-start0\023\004\tuidNumber1"..., data_size=298, ciphertext=0x8181968 "\024\023H@\024\023H@?\177\037\006o???u?NABh\rVd\a?\006?Q", ciphertext_size=2596, type=0, random_pad=0) at gnutls_cipher.c:90 #13 0x401d686d in _gnutls_send_int (session=0x41803570, type=GNUTLS_APPLICATION_DATA, htype=4294967295, _data=0x81277d8, sizeofdata=5) at gnutls_record.c:340 #14 0x401d764f in gnutls_record_send (session=0x0, data=0x0, sizeofdata=0) at gnutls_record.c:871 #15 0x4004de03 in gnutls_SSL_write (ssl=0x402fae74, buf=0x0, buflen=0) at gnutls.c:724 #16 0x4004b369 in sb_tls_write (sbiod=0x41802f70, buf=0x0, len=0) at tls.c:678 #17 0x4005fb57 in sb_debug_write (sbiod=0x81d4168, buf=0x81277d8, len=298) at /root/openldap2-2.1.30/libraries/liblber/sockbuf.c:841 #18 0x4005eec4 in ber_int_sb_write (sb=0x81818c8, buf=0x81277d8, len=298) at /root/openldap2-2.1.30/libraries/liblber/sockbuf.c:427 #19 0x4005bbe9 in ber_flush (sb=0x81818c8, ber=0xbf57e604, freeit=0) at /root/openldap2-2.1.30/libraries/liblber/io.c:234 #20 0x08066ee8 in backend_operational () #21 0x08068855 in slap_send_search_entry () #22 0x40674dde in bdb_search (be=0x8102290, conn=0x4074e958, op=0x8133278, base=0xbf5fe884, nbase=0x0, scope=2, deref=0, slimit=473, tlimit=3600, filter=0x8116e78, filterstr=0xbf5fe874, attrs=0x8183708, attrsonly=0) at /root/openldap2-2.1.30/servers/slapd/back-bdb/search.c:774 #23 0x08058f56 in do_search () #24 0x08057688 in connection_done () #25 0x4002b754 in ldap_int_thread_pool_wrapper (xpool=0x63) at /root/openldap2-2.1.30/libraries/libldap_r/tpool.c:432 #26 0x402f2e51 in pthread_start_thread () from /lib/libpthread.so.0 #27 0x402f2ecf in pthread_start_thread_event () from /lib/libpthread.so.0 #28 0x4042869a in clone () from /lib/libc.so.6 (gdb) info threads 7 Thread 81926 (LWP 11177) 0x402f5604 in __pthread_sigsuspend () from /lib/libpthread.so.0 6 Thread 65541 (LWP 11176) 0x402f5604 in __pthread_sigsuspend () from /lib/libpthread.so.0 5 Thread 49156 (LWP 11173) 0x402f5604 in __pthread_sigsuspend () from /lib/libpthread.so.0 * 4 Thread 32771 (LWP 11171) 0x4037a721 in kill () from /lib/libc.so.6 3 Thread 16386 (LWP 11169) 0x403e2ea1 in gettimeofday () from /lib/libc.so.6 2 Thread 32769 (LWP 11168) 0x4041f85a in poll () from /lib/libc.so.6 1 Thread 16384 (LWP 11139) 0x402f5604 in __pthread_sigsuspend () from /lib/libpthread.so.0 (gdb) info reg eax 0x0 0 ecx 0x6 6 edx 0x402fae74 1076866676 ebx 0x2ba3 11171 esp 0xbf57dd80 0xbf57dd80 ebp 0xbf57dd98 0xbf57dd98 esi 0x2ba3 11171 edi 0x402fd170 1076875632 eip 0x4037a721 0x4037a721 eflags 0x246 582 cs 0x23 35 ss 0x2b 43 ds 0x2b 43 es 0x2b 43 fs 0x0 0 gs 0x0 0 (gdb) bt full #0 0x4037a721 in kill () from /lib/libc.so.6 No symbol table info available. #1 0x402f5771 in pthread_kill () from /lib/libpthread.so.0 No symbol table info available. #2 0x402f5a7b in raise () from /lib/libpthread.so.0 No symbol table info available. #3 0x4037a4d4 in raise () from /lib/libc.so.6 No symbol table info available. #4 0x4037b9e8 in abort () from /lib/libc.so.6 No symbol table info available. #5 0x40373b3f in __assert_fail () from /lib/libc.so.6 No symbol table info available. #6 0x4024fe9b in _gcry_ath_mutex_lock (lock=0x40293920) at ath.c:177 No locals. #7 0x4025cbaf in _gcry_fast_random_poll () at random.c:991 err = 0 #8 0x402587b5 in md_open (h=0x0, algo=2, secure=0, hmac=2) at md.c:441 err = GPG_ERR_NO_ERROR bufsize = 0 ctx = (struct gcry_md_context *) 0x812b710 hd = 0x812b300 #9 0x402588b2 in gcry_md_open (h=0x0, algo=0, flags=1076866676) at md.c:472 err = GPG_ERR_BAD_PUBKEY hd = 0x3 #10 0x401e3000 in _gnutls_hmac_init (algorithm=GNUTLS_MAC_SHA, key=0x41809d10, keylen=20) at gnutls_hash_int.c:155 ret = 0x8182488 result = 0 #11 0x401d8105 in _gnutls_compressed2ciphertext (session=0x41803570, cipher_data=0x818196d "\023H@?\177\037\006o???u?NABh\rVd\a?\006?Q", cipher_size=2596, compressed= {data = 0x8124a38 "?Z\236?$??\002?'I\231\224D+?\220M?(??\226g(?b\031??Ln??^B?\031\212???\031", size = 48}, _type=0, random_pad=0) at gnutls_cipher.c:176 MAC = "p5\200A\224?W?\\?W??z\035@?\004\200A" c_length = 16419 pad = 0 '\0' length = 2 ret = 0 type = 23 '\027' major = 3 '\003' minor = 1 '\001' hash_size = 20 ver = GNUTLS_TLS1_0 blocksize = 16 block_algo = CIPHER_BLOCK data_ptr = (opaque *) 0x0 #12 0x401d7e4c in _gnutls_encrypt (session=0x41803570, headers=0x0, headers_size=5, data=0x81277d8 "0\202\001&\002\001\003d\202\001\037\0049uid=vba-daemon-start,ou=People,dc=vanburenadvisors,dc=com0\201?0\030\004\002cn1\022\004\020vba-daemon-start0:\004\vobjectClass1+\004\aaccount\004\fposixAccount\004\rshadowAccount\004\003top0\031\004\003uid1\022\004\020vba-daemon-start0\023\004\tuidNumber1"..., data_size=298, ciphertext=0x8181968 "\024\023H@\024\023H@?\177\037\006o???u?NABh\rVd\a?\006?Q", ciphertext_size=2596, type=0, random_pad=0) at gnutls_cipher.c:90 plain = {data = 0x0, size = 1076866676} comp = { data = 0x8124a38 "?Z\236?$??\002?'I\231\224D+?\220M?(??\226g(?b\031??Ln??^B?\031\212???\031", size = 48} ret = 5 free_comp = 1 #13 0x401d686d in _gnutls_send_int (session=0x41803570, type=GNUTLS_APPLICATION_DATA, htype=4294967295, _data=0x81277d8, sizeofdata=5) at gnutls_record.c:340 cipher = ( uint8 *) 0x8181968 "\024\023H@\024\023H@?\177\037\006o???u?NABh\rVd\a?\006?Q" cipher_size = 5 retval = 0 ret = 298 data2send_size = 298 headers = "\027\003\001\000" #14 0x401d764f in gnutls_record_send (session=0x0, data=0x0, sizeofdata=0) at gnutls_record.c:871 No locals. #15 0x4004de03 in gnutls_SSL_write (ssl=0x402fae74, buf=0x0, buflen=0) at gnutls.c:724 ret = 0 #16 0x4004b369 in sb_tls_write (sbiod=0x41802f70, buf=0x0, len=0) at tls.c:678 p = (struct tls_data *) 0x41807d68 ---Type to continue, or q to quit--- ret = 0 err = 0 #17 0x4005fb57 in sb_debug_write (sbiod=0x81d4168, buf=0x81277d8, len=298) at /root/openldap2-2.1.30/libraries/liblber/sockbuf.c:841 ret = 135796936 #18 0x4005eec4 in ber_int_sb_write (sb=0x81818c8, buf=0x81277d8, len=298) at /root/openldap2-2.1.30/libraries/liblber/sockbuf.c:427 ret = 298 #19 0x4005bbe9 in ber_flush (sb=0x81818c8, ber=0xbf57e604, freeit=0) at /root/openldap2-2.1.30/libraries/liblber/io.c:234 towrite = 298 rc = 0 #20 0x08066ee8 in backend_operational () No symbol table info available. #21 0x08068855 in slap_send_search_entry () No symbol table info available. #22 0x40674dde in bdb_search (be=0x8102290, conn=0x4074e958, op=0x8133278, base=0xbf5fe884, nbase=0x0, scope=2, deref=0, slimit=473, tlimit=3600, filter=0x8116e78, filterstr=0xbf5fe874, attrs=0x8183708, attrsonly=0) at /root/openldap2-2.1.30/servers/slapd/back-bdb/search.c:774 result = 0 dn = {bv_len = 0, bv_val = 0x0} bdb = (struct bdb_info *) 0x8102348 rc = 1081403736 stoptime = 1090301527 id = 69 cursor = 27 candidates = {58, 16, 18, 20, 22, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 124, 125, 126, 0 , 1076846491, 1078461776, 3210731132, 1076846456, 3210731164, 1077709046, 5, 135014227, 1099291552, 3210733404, 134769920, 3210733404, 3210731196, 134769974, 1099291541, 135014216, 0, 0, 0, 135014536, 3210731228, 134825857, 3210733404, 135014520, 0, 1099291541, 0, 3210733424, 3210731260, 134770067, 135015656, 3210733404, 1076846491, 1078461776, 3210731260, 1076846456, 3210731292, 1077709046, 5, 135014227, 1099291673, 3210733532, 134769920, 3210733532, 3210731324, 134769974, 1099291662, 135014216, 0, 0, 0, 135014536, 3210731356, 134825857, 3210733532, 135014520, 3210731372, 1099291662, 0, 3210733552, 3210731388, 134770067, 135015656, 3210733532, 134769920, 1073921455, 0, 3210733552, 3210733580, 134765207, 3210732484, 0, 1032, 0 , 1077606753, 0, 1078461776, 3210731664, 0, 134867508, 135444952, 3210733200, 1077518235, 3210733236, 134867508, 1, 0, 0, 0, 0, 0, 3210733180, 1077511159, 0 , 544407552, 0, 4294967295, 4294967284, 0 , 3210732108, 0, 2, 3210733520, 3210733180...} e = (Entry *) 0x81d6ea0 v2refs = 0x0 matched = (Entry *) 0x0 realbase = {bv_len = 26, bv_val = 0x81824a0 "dc=vanburenadvisors,dc=com"} nentries = 26 manageDSAit = 0 limit = (struct slap_limits_set *) 0x81022f8 isroot = 0 locker = 22 lock = {off = 280640, ndx = 685, gen = 111, mode = DB_LOCK_READ} #23 0x08058f56 in do_search () No symbol table info available. #24 0x08057688 in connection_done () No symbol table info available. #25 0x4002b754 in ldap_int_thread_pool_wrapper (xpool=0x63) at /root/openldap2-2.1.30/libraries/libldap_r/tpool.c:432 ctx = (ldap_int_thread_ctx_t *) 0x8102290 ltc_key = {{ltk_key = 0x8121af8, ltk_data = 0x16, ltk_free = 0x40681e70 }, {ltk_key = 0x40675920, ltk_data = 0x4079f008, ltk_free = 0x406758f0 }, { ltk_key = 0x0, ltk_data = 0x0, ltk_free = 0}, {ltk_key = 0x0, ltk_data = 0x0, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0xffffffff, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0xffffffff, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0xffffffff, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0xffffffff, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0xffffffff, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0xffffffff, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0xffffffff, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0xffffffff, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0xffffffff, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0xffffffff, ltk_free = 0xffffffff}, {ltk_key = 0x0, ltk_data = 0x0, ltk_free = 0} , {ltk_key = 0x0, ---Type to continue, or q to quit--- ltk_data = 0x40480550, ltk_free = 0xbf5ffaac}, {ltk_key = 0x0, ltk_data = 0xbf5ffacc, ltk_free = 0x40373579 }} i = 135275152 #26 0x402f2e51 in pthread_start_thread () from /lib/libpthread.so.0 No symbol table info available. #27 0x402f2ecf in pthread_start_thread_event () from /lib/libpthread.so.0 No symbol table info available. #28 0x4042869a in clone () from /lib/libc.so.6 No symbol table info available. (gdb) From smurf at smurf.noris.de Tue Jul 20 12:45:25 2004 From: smurf at smurf.noris.de (Matthias Urlichs) Date: Tue Jul 20 12:44:03 2004 Subject: assertion in _gcry_ath_mutex_lock In-Reply-To: <200407200522.i6K5MIft028244@piquin.uchicago.edu> References: <200407200522.i6K5MIft028244@piquin.uchicago.edu> Message-ID: <20040720104525.GB3379@kiste> Hi, job@jobbogan.com: > I'm getting assertions w/ openldap 2.1.20 compiled against > gnutls-1.0.16 & libgcrypt-1.2.0. > Ouch. > I've tried several versions of gnutls & libgcrypt but the failure mode > is constant across all the versions I've tried. I've attached a stack > trace. The other active threads differ from crash to crash, but the > asserting thread is constant. > Can you try reproducing this under Electric Fence? (gdb) set env LD_PRELOAD /usr/lib/libefence.so (gdb) run -d0 -- Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : /pipermail/attachments/20040720/f1d7bee9/attachment-0001.bin From salvatore_uni at tiscali.it Tue Jul 20 18:08:15 2004 From: salvatore_uni at tiscali.it (salvatore) Date: Tue Jul 20 17:57:02 2004 Subject: trading keys Message-ID: <200407201808.15367.salvatore_uni@tiscali.it> Here is how i trade publics key... might be this wrong?!7 int trade_publics(void) { char my_pub[KEY_LENTGH], his_pub[KEY_LENTGH]; gcry_error_t rc,error_code; /* KEY_LENTGH is 1024 */ memset(my_pub,0,KEY_LENTGH); memset(his_pub,0,KEY_LENTGH); /* Convert my public */ gcry_sexp_sprint(key.my_public_key, GCRYSEXP_FMT_CANON, my_pub, sizeof(my_pub)); /* Send my public */ while( (write(sockt, (char *) my_pub, sizeof(my_pub)) ) < 0 ) ; if( (read(sockt, (char *) his_pub, KEY_LENTGH ) ) < 0 ) return 0; rc = gcry_sexp_sscan(&key.his_public_key, &error_code, his_pub, sizeof(his_pub)); if( rc ) { fprintf(stderr,"Errore durante la conversione della sua pubblica"); return 0; } return 1; } Regards Emitrax From wk at gnupg.org Tue Jul 20 19:54:47 2004 From: wk at gnupg.org (Werner Koch) Date: Tue Jul 20 19:53:21 2004 Subject: trading keys In-Reply-To: <200407201808.15367.salvatore_uni@tiscali.it> (salvatore_uni@tiscali.it's message of "Tue, 20 Jul 2004 18:08:15 +0200") References: <200407201808.15367.salvatore_uni@tiscali.it> Message-ID: <87658ik1i0.fsf@wheatstone.g10code.de> On Tue, 20 Jul 2004 18:08:15 +0200, salvatore said: > Here is how i trade publics key... might be this wrong?!7 Yes. > /* KEY_LENTGH is 1024 */ > memset(my_pub,0,KEY_LENTGH); Why using a macro at all if you state above that it is 1024 byte? Are you sure about the 1024 byte? It is not the key length (we usually count by bits) but the maximum length of the S-expression (in bytes). gcry_sexp_sprint(key.my_public_key, GCRYSEXP_FMT_CANON, my_pub, sizeof(my_pub)); No error checking done. > /* Send my public */ > while( (write(sockt, (char *) my_pub, sizeof(my_pub)) ) < 0 ) > ; This will leand to an endless loop as soon as there is a write error - don't do this. Casting to char* is unneeded: ist is already a char* and write takes a void* anyway. > if( (read(sockt, (char *) his_pub, KEY_LENTGH ) ) < 0 ) > return 0; Same remarks as above. Why do you use KEY_LENGH here but above sizeof? Actuall In general you should send the actual length of the key and not a fixed buffer. However your approach works as long as you don't enlarge the key size. The actual length is returned by gcry_sexp_sprint; encode it in network byte order; ie. unsigned char length_buffer[4]; size_t length; length = gcry_sexp_sprint (....); if (!length) die (); length_buffer[0] = length >> 24; length_buffer[1] = length >> 16; length_buffer[2] = length >> 8; length_buffer[3] = length; if (writen (sock, length_buffer, 4)) die (); if (writen (sock, my_pub, sizeof my_pub)) die (); writen() is the usual write wrapper, making sure that all bytes are written and protects against INTR. See Steven's APUE for example (This is a must read for everyone doing network stuff or serious Unix hacking). Salam-Shalom, Werner From salvatore_uni at tiscali.it Tue Jul 20 21:50:58 2004 From: salvatore_uni at tiscali.it (salvatore) Date: Tue Jul 20 21:39:53 2004 Subject: trading keys In-Reply-To: <87658ik1i0.fsf@wheatstone.g10code.de> References: <200407201808.15367.salvatore_uni@tiscali.it> <87658ik1i0.fsf@wheatstone.g10code.de> Message-ID: <200407202150.58428.salvatore_uni@tiscali.it> Thanks a lot Werner I've applied some changes as you said int trade_publics(void) { char my_pub[KEY_LENTGH], his_pub[KEY_LENTGH]; gcry_error_t rc,error_code; size_t lentgh_buffer; memset(my_pub,0,sizeof(my_pub)); memset(his_pub,0,sizeof(his_pub)); /* Converto la mia pubblica in un formato opportuno per l'invio */ lentgh_buffer = gcry_sexp_sprint(key.my_public_key, GCRYSEXP_FMT_CANON, my_pub, sizeof(my_pub)); if(!lentgh_buffer) { fprintf(stderr,"\nError returned by sprint()\n"); return 0; } /* Invio la chiave (ritento finche non la manda */ if( (write(sockt, my_pub, lentgh_buffer)) < 0 ) return 0; /* Ricevo la sua chiave pubblica */ if( (read(sockt, his_pub, sizeof(his_pub))) < 0 ) return 0; /* Converto la chiave ricevuta e la salvo nella struttura */ rc = gcry_sexp_sscan(&key.his_public_key, &error_code, his_pub, sizeof(his_pub)); if( rc ) { fprintf(stderr,"Errore durante la conversione della sua pubblica"); return 0; } return 1; } Anyway once the program starts key are traded ok (apparently ),but when i send the first message with one client i get this from the other one that actually try to decrypt Program received signal SIGSEGV, Segmentation fault.0x40030733 in sexp_sscan (retsexp=0xbffff27c, erroff=0xbffff280, buffer=0xbffff3b0 "(7:enc-val(3:rsa(1:a128:\032N\215Jb?%\177?\002\002n\001wa?*k\221\001&='!\020?\207A\221???t \206\223~\030)\206qG%\027??+??", length=0, argflag=0, arg_ptr=0xbffff7a4 "????????", arg_list=0x0) at sexp.c:1022 1022 else if (*p == '\\') (gdb) bt #0 0x40030733 in sexp_sscan (retsexp=0xbffff27c, erroff=0xbffff280, buffer=0xbffff3b0 "(7:enc-val(3:rsa(1:a128:\032N\215Jb?%\177?\002\002n\001wa?*k\221\001&='!\020?\207A\221???t \206\223~\030)\206qG%\027??+??", length=0, argflag=0, arg_ptr=0xbffff7a4 "????????", arg_list=0x0) at sexp.c:1022 #1 0x400310d3 in gcry_sexp_sscan (retsexp=0xbffff27c, erroff=0xbffff280, buffer=0xbffff3b0 "(7:enc-val(3:rsa(1:a128:\032N\215Jb?%\177?\002\002n\001wa?*k\221\001&='!\020?\207A\221???t \206\223~\030)\206qG%\027??+??", length=4) at sexp.c:1397 #2 0x0804bb4a in decrypt_buffer ( b_to_decrypt=0xbffff3b0 "(7:enc-val(3:rsa(1:a128:\032N\215Jb?%\177?\002\002n\001wa?*k\221\001&='!\020?\207A\221???t \206\223~\030)\206qG%\027??+??", b_decrypted=0xbffff5b0 "") at crypto.c:72 #3 0x0804b44b in talk () at io.c:142 #4 0x0804b7d8 in main (argc=2, argv=0xbffff7a4) at talk.c:74 (gdb) q emitrax@freek:~/lab_project$ cat errors.text Program received signal SIGSEGV, Segmentation fault.0x40030f96 in sexp_sscan (retsexp=0xbffff27c, erroff=0xbffff280, buffer=0xbffff3b0 "(7:enc-val(3:rsa(1:a129:", length=3221225432, argflag=0, arg_ptr=0xbffff7a4 "????????", arg_list=0x0) at sexp.c:942 942 if (strchr (tokenchars, *p)) (gdb) bt full #0 0x40030f96 in sexp_sscan (retsexp=0xbffff27c, erroff=0xbffff280, buffer=0xbffff3b0 "(7:enc-val(3:rsa(1:a129:", length=3221225432, argflag=0, arg_ptr=0xbffff7a4 "????????", arg_list=0x0) at sexp.c:942 err = GPG_ERR_SEXP_BAD_CHARACTER tokenchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-./_:*+=" p = 0xc0000000
n = 4294964148 digptr = 0x0 quoted = 0x0 tokenp = 0xbfffffd8 "s" hexfmt = 0x0 base64 = 0x0 disphint = 0xbffff4d5 "[\001@5M\031@G\233\004\b ??? ???\t" percent = 0x0 hexcount = 0 quoted_esc = 0 datalen = 0 dummy_erroff = 1074663610 c = {sexp = 0x8065518, allocated = 334, pos = 0x806564d "\a"} arg_counter = 0 level = 0 #1 0x400310d3 in gcry_sexp_sscan (retsexp=0xbffff27c, erroff=0xbffff280, buffer=0xbffff3b0 "(7:enc-val(3:rsa(1:a129:", length=4) at sexp.c:1397 dummy_arg_ptr = 0xbffff7a4 "????????" #2 0x0804bb4a in decrypt_buffer (b_to_decrypt=0xbffff3b0 "(7:enc-val(3:rsa(1:a129:", b_decrypted=0xbffff5b0 "") at crypto.c:72 data_to_decrypt = 0x804b2e6 data_decrypted = 0xbffff730 mpi_decrypted = 0xbffff5b0 written = 3221223088 rc = 1074157606 error_code = 3111 #3 0x0804b44b in talk () at io.c:142 i = -1073744464 read_set = {__fds_bits = {1024, 0 }} nb = 1074157606 k = -1073744464 num_of_chars = 0 buffer_to_read = '\0' buf_tmp = "\020@" buffer_to_send = '\0' , "????\000\000\000@\000\000\000\000.?\r@\000?\v@?[\001@5M\031@G\233\004\b ??? ???\t\000\000\000\036?\f@\t\000\000\000\f6\036@h???\f6\036@\030???????\000\000\000\000\002\000\000\000`?\004\b\t", '\0' , "\001", '\0' , "nl[\001@p???\001|\000@\233\214\004\bx[\001@\000\000\000\000\200M\001@\000\000\000\000\214\004\000\000????\031{\000@?\216\f@\225\216\004\b\000\000\000\000\000\000\000\000 \000\000\000\234\217\f@?=\f@??\v@?[\001@\b\000\000"... enc_buffer = "(7:enc-val(3:rsa(1:a129:\000\227\204 \003\211\223\031??\0059\234\\$\031\000???S\206(j\214\2036??\030p!/?\t\201??.]???fB??os\005C=??z\024??0u\200\215L~\231??h\a?cB\f\211u0\206[Q\b\227?\201\\\021~O+???v?\215?'\204\016?R?\002\020?\206\035?\\Z\224\233V \024\n\032\227?\210F5?c\\e??})))", '\0' dec_buffer = "E@\006\bB\006\b?????j\v@B\006\b?j\v@\210?????\n@E@\006\bB\006\b\001\000\000\000$\000\000\000[\000\000\0---Type to continue, or q to quit--- 00\203???\b????B\n@[\000\000\000\200\r\036@h?\000\000?\234\021@\020\000\000\000\f6\036@X???\000\027\022@\200\r\036@\001\000\000\000?\001\000\000\021C\n@\200?????\004\b???\000\000\000\000??\004\000\001\000\000\000?\000\000?j\v@", '\0' , "?j\v@d\000\000\000????x????B\n@d\000\000\000\200\r\036@\233\214\004n\200???4\000\000\000?j\v@?"... #4 0x0804b7d8 in main (argc=2, argv=0xbffff7a4) at talk.c:74 No locals. ------------------------------------ while on the other client ------------------------------------ Program received signal SIGINT, Interrupt.0x4018dc62 in select () from /lib/libc.so.6 (gdb) bt full #0 0x4018dc62 in select () from /lib/libc.so.6 No symbol table info available. #1 0xbffff2b0 in ?? () No symbol table info available. #2 0xbffff6b0 in ?? () No symbol table info available. #3 0xbffff730 in ?? () No symbol table info available. #4 0x0804b2e6 in talk () at io.c:108 read_set = {__fds_bits = {513, 0 }} nb = -514 k = 11 num_of_chars = 0 buffer_to_read = "`???ok\000@\234\215\004\bt\213\a\000\204\212\004\b\020????P\001@\004\000\000\000?u\036@\000\000\000\000\001", '\0' , "\020???", '\0' , "t\213\a\000 ???\220O\001@\000\000\000\000\000\000\000\000\220?\v@?[\001@", '\0' , "?\217\v\f????\220O\001@h???\203\236\004\b@)\f@?[\001@\000???\000\000\000\000P?\v@\200M\001@?\002\000\000\220O\001@?????\000@,Q\001@?u\036@\001\000\000\000\000\000\000\000??????\030@????????\023\000\000\000\200"... buf_tmp = "\n@" buffer_to_send = "lillo che succede?\n\000??\004\bZ\000\000\000?\214\004\b\000?\v@ ???\001\000\000\000 ??? ??? ???\t\000\000\000\036?\f@\t\000\000\000\f6\036@h???\f6\036@\030???\000???", '\0' , "\t", '\0' , "\001", '\0' , "nl[\001@p???\001|\000@\233\214\004\bx[\001@\000\000\000\000\200M\001@\000\000\000\000\214\004\000\000????\031{\000@?\216\f@\225\216\004\b ???\001|\000@ \000\000\000\234\217\f@?=\f@??\v@?[\001"... enc_buffer = "?=\f@??\v@ \000\000\000\234\217\f@?=\f@??\v@?[\001@\b\000\000\000\214u\036@\200M\001@,Q\001@?\214\004\b\220???ok\000@?\214\004\b\213\a\000\004\212\004\b@????P\001@\004\000\000\000?u\036@\000\000\000\000\001\000\000\000D\234\a\000????\220O\001@@???+\234\a????\220O\001@\000\000\000\000\213\a\000????\220O\001@\000\000\000\000\002\000\000\000\000?\v@?[\001@x \005@\036?\f@\000\000\000\000\f6\036@????\f6\036@\000\000\000\000\200M\001@\217\002\000\000\220O\001@????\200M\001@"... (this is what it sends) dec_buffer = "(7:enc-val(3:rsa(1:a129:\000\227\204 \003\211\223\031??\0059\234\\$\031\000???S\206(j\214\2036??\030p!/?\t\201??.]???fB??os\005C=??z\024??0u\200\215L~\231??h\a?cB\f\211u0\206[Q\b\227?\201\\\021~O+???v?\215?'\204\016?R?\002\020?\206\035?\\Z\224\233V \024\n\032\227?\210F5?c\\e??})))", '\0' #5 0x0804b7d8 in main (argc=2, argv=0xbffff7a4) at talk.c:74 No locals. Sorry about the size of the mail. By the way i'm reading steven's UNP vol II but not APUN. Regards Salvo From marcus.brinkmann at ruhr-uni-bochum.de Tue Jul 20 22:05:04 2004 From: marcus.brinkmann at ruhr-uni-bochum.de (Marcus Brinkmann) Date: Tue Jul 20 22:02:01 2004 Subject: assertion in _gcry_ath_mutex_lock In-Reply-To: <200407200522.i6K5MIft028244@piquin.uchicago.edu> References: <200407200522.i6K5MIft028244@piquin.uchicago.edu> Message-ID: <871xj678cv.wl@ulysses.g10code.de> At Tue, 20 Jul 2004 00:22:17 -0500, job@jobbogan.com wrote: > > I'm getting assertions w/ openldap 2.1.20 compiled against > gnutls-1.0.16 & libgcrypt-1.2.0. > > I've tried several versions of gnutls & libgcrypt but the failure mode > is constant across all the versions I've tried. I've attached a stack > trace. The other active threads differ from crash to crash, but the > asserting thread is constant. You are using pthread, but you have not initialized gcrypt to use the pthread mutex stubs. Please refer to the documentation on how to do that. I am waging a guess that this is already your problem. The stubs used for the non-threaded case use the assertions to check for locking issues, but they rely on the fact that there is never contention in a single-threaded program (otherwise it would dead lock anyway :). So, if there is contention, and you didn't initialize gcrypt properly, you will trigger the assertion. A programming error in gcrypt could also trigger this assertion, but this would show as a dead lock in the threaded case (if properly initialized). Thanks, Marcus From marowa at gold.livedoor.com Wed Jul 21 04:35:53 2004 From: marowa at gold.livedoor.com (DMR) Date: Wed Jul 21 04:32:46 2004 Subject: encrypt & decrypt file Message-ID: Hi, my name is Abu Farhan. I have an interest about encrypt-decrypt file by libgcrypt. How can i get a simple source about encrypt-decrypt a file, by glibcrypt? I already installed libgcrypt-1.2.0. Thanks. AF From wk at gnupg.org Wed Jul 21 09:30:08 2004 From: wk at gnupg.org (Werner Koch) Date: Wed Jul 21 09:33:24 2004 Subject: encrypt & decrypt file In-Reply-To: (marowa@gold.livedoor.com's message of "Wed, 21 Jul 2004 11:35:53 +0900") References: Message-ID: <87fz7lhl6n.fsf@wheatstone.g10code.de> On Wed, 21 Jul 2004 11:35:53 +0900, DMR said: > I have an interest about encrypt-decrypt file by libgcrypt. > How can i get a simple source about encrypt-decrypt a file, > by glibcrypt? Libgcrypt is a libary of cryptgraphic building blocks. You can't use it instantly to encrypt files. You first need to come up with a protocol on how the encryption should work and then implement this protocol. The crypto stuff is only a small part. If you want to look at such a protocol, see rfc2440. Salam-Shalom, Werner From mo at g10code.com Fri Jul 23 01:38:35 2004 From: mo at g10code.com (Moritz Schulte) Date: Fri Jul 23 01:26:35 2004 Subject: new interface In-Reply-To: <200407192144.26680.salvatore_uni@tiscali.it> References: <200407192144.26680.salvatore_uni@tiscali.it> Message-ID: <86ekn3hatg.wl@duesseldorf.ccc.de> At Mon, 19 Jul 2004 21:44:26 +0200, salvatore wrote: > if i generate RSA with old interface and then encrypt using the new > interface(gcry_ac_*),will i have problems!?Or shall i rewrite > everything using the new interface?!?! These interfaces should be usable absolutely interchangeable (actually the one interface is a wrapper for the other one). Of course you may be forced to care of the conversion of data yourself when doing so. moritz From mo at g10code.com Thu Jul 29 12:56:16 2004 From: mo at g10code.com (Moritz Schulte) Date: Thu Jul 29 12:53:28 2004 Subject: libgcrypt/tests/Makefile.am patch In-Reply-To: References: Message-ID: <86r7qv2ib3.wl@duesseldorf.ccc.de> At Tue, 27 Jul 2004 23:00:07 -0500 (CDT), Bob Friesenhahn wrote: [I'm redirecting this thread to gcrypt-devel@, which seems to be more appropriate to me] Hello, > Libgcrypt does not completely build under Solaris due to a missing > Makefile.am library dependency. I wonder wether this is the correct patch; after all, Libtool libraries (*.la) should keep track of such library dependencies themselves. src/Makefile.am contains: libgcrypt_la_DEPENDENCIES = ../cipher/libcipher.la ../mpi/libmpi.la \ $(srcdir)/libgcrypt.vers Therefore, linking against libgcrypt.la should imply linking against libcipher.la and libmpi.la. When speaking of libmpi.la: I also wonder why, assuming that your dependencies are broken, you don't have to add libmpi.la to the LDADD line as well. Thanks, Moritz From bfriesen at simple.dallas.tx.us Thu Jul 29 18:49:42 2004 From: bfriesen at simple.dallas.tx.us (Bob Friesenhahn) Date: Fri Jul 30 11:11:17 2004 Subject: libgcrypt/tests/Makefile.am patch In-Reply-To: <86r7qv2ib3.wl@duesseldorf.ccc.de> References: <86r7qv2ib3.wl@duesseldorf.ccc.de> Message-ID: You are right there is indeed another problem. There is an incorrect assuption that libgcrypt_la_DEPENDENCIES has something to do with libtool and library dependencies when in fact it does not. Perhaps libgcrypt_la_LDADD should be used instead? Bob On Thu, 29 Jul 2004, Moritz Schulte wrote: > At Tue, 27 Jul 2004 23:00:07 -0500 (CDT), Bob Friesenhahn wrote: > > [I'm redirecting this thread to gcrypt-devel@, which seems to be more > appropriate to me] > > Hello, > >> Libgcrypt does not completely build under Solaris due to a missing >> Makefile.am library dependency. > > I wonder wether this is the correct patch; after all, Libtool > libraries (*.la) should keep track of such library dependencies > themselves. > > src/Makefile.am contains: > > libgcrypt_la_DEPENDENCIES = ../cipher/libcipher.la ../mpi/libmpi.la \ > $(srcdir)/libgcrypt.vers > > Therefore, linking against libgcrypt.la should imply linking against > libcipher.la and libmpi.la. When speaking of libmpi.la: I also wonder > why, assuming that your dependencies are broken, you don't have to add > libmpi.la to the LDADD line as well. > > Thanks, > Moritz > ====================================== Bob Friesenhahn bfriesen@simple.dallas.tx.us http://www.simplesystems.org/users/bfriesen