From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.comp.encryption.gpg.gnutls.devel,gmane.emacs.devel Subject: Re: Emacs core TLS support Date: Mon, 06 Sep 2010 17:53:46 +0200 Message-ID: References: <878wc1vfh3.fsf@lifelogs.com> <87r5ptpnz2.fsf@stupidchicken.com> <871vhsvkut.fsf@lifelogs.com> <87d41csktn.fsf@lifelogs.com> <87k4v0n0m8.fsf@lifelogs.com> <87wrrvfnc4.fsf@lifelogs.com> <87r5i2d00q.fsf@lifelogs.com> <87zkwqijye.fsf@stupidchicken.com> <878w4actmg.fsf@lifelogs.com> <877hju123h.fsf@stupidchicken.com> <8762yklrdk.fsf@lifelogs.com> <87wrqzhrjv.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1283788991 28213 80.91.229.12 (6 Sep 2010 16:03:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Sep 2010 16:03:11 +0000 (UTC) Cc: gnutls-devel@gnu.org, emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: gnutls-devel-bounces+pgp-gnutls-dev=m.gmane.org@gnu.org Mon Sep 06 18:03:08 2010 Return-path: Envelope-to: pgp-gnutls-dev@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ose9z-0000RR-U1 for pgp-gnutls-dev@m.gmane.org; Mon, 06 Sep 2010 18:03:08 +0200 Original-Received: from localhost ([127.0.0.1]:48614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ose1C-0006pP-4E for pgp-gnutls-dev@m.gmane.org; Mon, 06 Sep 2010 11:54:02 -0400 Original-Received: from [140.186.70.92] (port=52520 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ose18-0006mR-4B for gnutls-devel@gnu.org; Mon, 06 Sep 2010 11:53:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ose17-0001a5-32 for gnutls-devel@gnu.org; Mon, 06 Sep 2010 11:53:57 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.10]:44959) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ose14-0001Z3-8V; Mon, 06 Sep 2010 11:53:54 -0400 Original-Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 25E351C003AB; Mon, 6 Sep 2010 17:53:46 +0200 (CEST) Original-Received: from hase.home (ppp-88-217-99-98.dynamic.mnet-online.de [88.217.99.98]) by mail.mnet-online.de (Postfix) with ESMTP id 78A971C000FE; Mon, 6 Sep 2010 17:53:46 +0200 (CEST) X-Yow: This ASEXUAL PIG really BOILS my BLOOD... He's so..so.....URGENT!! In-Reply-To: <87wrqzhrjv.fsf@lifelogs.com> (Ted Zlatanov's message of "Mon, 06 Sep 2010 09:31:32 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: gnutls-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GnuTLS development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: gnutls-devel-bounces+pgp-gnutls-dev=m.gmane.org@gnu.org Errors-To: gnutls-devel-bounces+pgp-gnutls-dev=m.gmane.org@gnu.org Xref: news.gmane.org gmane.comp.encryption.gpg.gnutls.devel:4479 gmane.emacs.devel:129708 Archived-At: Ted Zlatanov writes: >>> +DEFUN ("gnutls-init", Fgnutls_init, Sgnutls_init, 2, 2, 0, > ... >>> + ret = gnutls_init((gnutls_session_t*)&(XPROCESS(proc)->gnutls_state), > > AS> Aliasing violation. > > Can you explain please? The function wants to store a value of one type into an object of a different type. BAD. The compiler is allowed to assume the object was never changed. > AS> IMHO all your functions should return t on success and either some error > AS> symbol on failure or even raise an error. > > Yes, but I'm not sure which one. Can you recommend? Take your pick. I don't know anything about gnutls. >>> === modified file 'src/process.h' >>> + >>> +#ifdef HAVE_GNUTLS >>> + /* XXX Store GNU TLS state and auth mechanisms in Lisp_Objects. */ >>> + Lisp_Object gnutls_state; >>> + Lisp_Object x509_cred, x509_callback; >>> + Lisp_Object anon_cred; >>> + Lisp_Object srp_cred; >>> +#endif > > AS> None of them should be Lisp_Objects. Also make sure the resources are > AS> properly released when the process object is deleted. > > I don't know enough (the choice of using Lisp_Objects was in the > original patch) to know what to do instead of using Lisp_Objects. Why > not, first of all? You never store Lisp_Object values in there, so what's the point? x509_callback is never used, btw. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."