From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86865 Path: news.gmane.org!not-for-mail From: Jochen Hein Newsgroups: gmane.emacs.gnus.general Subject: [PATCH 2/4] network-stream: allow type gssapi Date: Sun, 14 Feb 2016 17:07:07 +0100 Message-ID: <1455466029-12376-3-git-send-email-jochen@jochen.org> References: <1455466029-12376-1-git-send-email-jochen@jochen.org> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1455466288 16691 80.91.229.3 (14 Feb 2016 16:11:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Feb 2016 16:11:28 +0000 (UTC) Cc: larsi@gnus.org, Jochen Hein To: ding@gnus.org Original-X-From: ding-owner+M35089@lists.math.uh.edu Sun Feb 14 17:11:17 2016 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aUzGV-000070-Uv for ding-account@gmane.org; Sun, 14 Feb 2016 17:11:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1aUzFh-0003qG-DH; Sun, 14 Feb 2016 10:10:25 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1aUzFe-0003pO-Ce for ding@lists.math.uh.edu; Sun, 14 Feb 2016 10:10:22 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1aUzFY-0006d3-Vd for ding@lists.math.uh.edu; Sun, 14 Feb 2016 10:10:22 -0600 Original-Received: from smtp.dinoex.de ([188.40.204.4] ident=root) by quimby.gnus.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1aUzFX-0003zP-FV; Sun, 14 Feb 2016 17:10:15 +0100 Original-Received: from smtp.dinoex.de (uucp@smtp.dinoex.de [188.40.204.4]) by smtp.dinoex.de (8.15.2/8.15.1) with ESMTPS id u1EGA6qC055274 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 14 Feb 2016 17:10:07 +0100 (CET) (envelope-from jochen@jochen.org) Original-Received: (from uucp@localhost) by smtp.dinoex.de (8.15.2/8.15.1/Submit) with UUCP id u1EGA6Ci055273; Sun, 14 Feb 2016 17:10:06 +0100 (CET) (envelope-from jochen@jochen.org) Original-Received: from jochen.org (echidna.jochen.org [IPv6:fd23:e163:19f7:1234:222:4dff:fe7c:d76a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by jupiter.jochen.org (Postfix) with ESMTPS id 425CF2B6; Sun, 14 Feb 2016 17:07:37 +0100 (CET) Original-Received: (nullmailer pid 13281 invoked by uid 1004); Sun, 14 Feb 2016 16:07:37 -0000 X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455466029-12376-1-git-send-email-jochen@jochen.org> X-Milter: Spamilter (Reciever: smtp.dinoex.de; Sender-ip: 188.40.204.4; Sender-helo: smtp.dinoex.de;) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (smtp.dinoex.de [188.40.204.4]); Sun, 14 Feb 2016 17:10:07 +0100 (CET) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86865 Archived-At: * lisp/net/network-stram.el (open-network-stream): allow type 'gssapi. (network-stream-open-gssapi): new function. --- lisp/net/network-stream.el | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index e5557b8..3f1d9fd 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el @@ -44,6 +44,7 @@ (require 'tls) (require 'starttls) +(require 'gssapi) (require 'auth-source) (require 'nsm) (require 'puny) @@ -87,6 +88,7 @@ open-network-stream `tls' -- A TLS connection. `ssl' -- Equivalent to `tls'. `shell' -- A shell connection. + `gssapi' -- a GSSAPI connection. :return-list specifies this function's return value. If omitted or nil, return a process object. A non-nil means to @@ -161,6 +163,7 @@ open-network-stream 'network-stream-open-starttls) ((memq type '(tls ssl)) 'network-stream-open-tls) ((eq type 'shell) 'network-stream-open-shell) + ((eq type 'gssapi) 'network-stream-open-gssapi) (t (error "Invalid connection type %s" type)))) result) (unwind-protect @@ -177,6 +180,24 @@ open-network-stream :error (nth 4 result)) (car result)))))) +(defun network-stream-open-gssapi (name buffer host service parameters) + (let* ((start (with-current-buffer buffer (point))) + (capability-command (plist-get parameters :capability-command)) + (eoc (plist-get parameters :end-of-command)) + (eo-capa (or (plist-get parameters :end-of-capability) + eoc)) + (stream (open-gssapi-stream name buffer host service)) + (greeting (network-stream-get-response stream start eoc)) + (capabilities (when capability-command + (network-stream-command stream + capability-command + (or eo-capa eoc))))) + ;; Return (STREAM GREETING CAPABILITIES RESULTING-TYPE) + (list stream + greeting + capabilities + 'gssapi))) + (defun network-stream-certificate (host service parameters) (let ((spec (plist-get :client-certificate parameters))) (cond -- 2.1.4