From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] lisp/server.el: Introduction of server-auth-key variable Date: Sat, 30 Apr 2011 16:31:29 +0200 Message-ID: References: <835b9d42b15c18e5adf7381138f347061fbc17e8.1298381336.git.mina86@mina86.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1304173939 31070 80.91.229.12 (30 Apr 2011 14:32:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 30 Apr 2011 14:32:19 +0000 (UTC) Cc: Michal Nazarewicz , Michal Nazarewicz , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 30 16:32:15 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QGBDT-00013R-1l for ged-emacs-devel@m.gmane.org; Sat, 30 Apr 2011 16:32:15 +0200 Original-Received: from localhost ([::1]:54026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGBDS-0006nX-HG for ged-emacs-devel@m.gmane.org; Sat, 30 Apr 2011 10:32:14 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGBDP-0006my-Kn for emacs-devel@gnu.org; Sat, 30 Apr 2011 10:32:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QGBDO-0000tc-Ir for emacs-devel@gnu.org; Sat, 30 Apr 2011 10:32:11 -0400 Original-Received: from mail-yw0-f41.google.com ([209.85.213.41]:56744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGBDO-0000tS-GX for emacs-devel@gnu.org; Sat, 30 Apr 2011 10:32:10 -0400 Original-Received: by ywa1 with SMTP id 1so1916286ywa.0 for ; Sat, 30 Apr 2011 07:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=pOCqmq5N9wA3RafaLaX2kOgrG+gorWFjFgaM31oMZGA=; b=ovAe7b15+VMMIUpBLYOeZdudZVsQlVSLmu3GKNlcYWQf9mLhVXaJphvcdM1Lla1BTk Yi+jrGSJNElTtrJkm7SxlBohbq2j/04iLhO9/qGxecGOioonUXO2N/qk7z4MgZEGPD6j isShn/KJO1j3QwscjAKFnLnjaToiLfoA7RY8Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=VSb4ZEeOapiLfnmhA57eSvY9zBLpRHisjPFuYG75Vvi3JOOvdCTLBN2hJQshw2LwnY eKWHAqjhJroef7BAem6gh7lY4fKoM/XOn4/WJAknECoAHX6OYeMMt+Nk2LaY7eYBxqr9 nekASl+JcDViWzZYbuj1+pDRRlXk5mQGg6Twg= Original-Received: by 10.236.115.135 with SMTP id e7mr609625yhh.428.1304173929220; Sat, 30 Apr 2011 07:32:09 -0700 (PDT) Original-Received: by 10.147.182.5 with HTTP; Sat, 30 Apr 2011 07:31:29 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138927 Archived-At: On Fri, Apr 29, 2011 at 18:22, Stefan Monnier wr= ote: > PS: emacsclient should really try not to send the key in cleartext, but > instead send something like "nonce,hash(nonce,key)". That's not hard to do, assuming that md5 is an acceptable hash (because we already include C and elisp implementation, unlike SHA-xx). In the server side, (unless (process-get proc :authenticated) (if (or ;; New method: -auth2 nonce md5(nonce . auth-key) (and (string-match "-auth2 \\([!-~]+\\) \\([0-9a-f]\\{32\\}\\)\n?" string) (string=3D (md5 (concat (match-string 1 string) (process-get proc :auth-key))) (match-string 2 string))) ;; Old method: -auth auth-key (and (string-match "-auth \\([!-~]+\\)\n?" string) (string=3D (match-string 1 string) (process-get proc :auth-ke= y)))) (...set authenticated) (...fail)) but in the emacsclient side, if it sends -auth2 it won't be back-compatible with pre-24.1, and if it tries -auth, then -auth2, -auth2 is not really used beause -auth is always accepted. So the only ways I see to make this useful at all is to remove compatibility, or introduce some kind of version check, perhaps resurrecting the currently obsolete -version command: ;; -version CLIENT-VERSION: obsolete at birth. (`"-version" (pop args-left)) =C2=A0 =C2=A0 Juanma