From: Jochen Hein <jochen@jochen.org>
To: ding@gnus.org
Cc: larsi@gnus.org, Jochen Hein <jochen@jochen.org>
Subject: [PATCH 2/4] network-stream: allow type gssapi
Date: Sun, 14 Feb 2016 17:07:07 +0100 [thread overview]
Message-ID: <1455466029-12376-3-git-send-email-jochen@jochen.org> (raw)
In-Reply-To: <1455466029-12376-1-git-send-email-jochen@jochen.org>
* 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
next prev parent reply other threads:[~2016-02-14 16:07 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-14 16:07 allow GSSAPI for imap access Jochen Hein
2016-02-14 16:07 ` [PATCH 1/4] open-gssapi-stream: remove parameter user Jochen Hein
2016-02-14 16:07 ` Jochen Hein [this message]
2016-02-14 16:07 ` [PATCH 3/4] nnimap: handle imap connections with type 'gssapi Jochen Hein
2016-02-14 16:07 ` [PATCH 4/4] update nnimap documentation for gssapi connections Jochen Hein
2016-02-15 7:59 ` allow GSSAPI for imap access Lars Ingebrigtsen
2016-02-15 14:35 ` Adam Sjøgren
2016-02-15 16:39 ` Jochen Hein
2016-02-15 17:29 ` Adam Sjøgren
2016-02-15 18:31 ` Jochen Hein
2016-02-15 18:56 ` Adam Sjøgren
2016-02-15 19:58 ` Jochen Hein
2016-02-22 7:27 ` Adam Sjøgren
2016-02-22 18:41 ` Jochen Hein
2016-02-23 12:52 ` Adam Sjøgren
2016-02-15 14:38 ` Hein, Jochen
2016-02-15 14:46 ` Lars Ingebrigtsen
2016-02-16 5:57 ` Lars Ingebrigtsen
2016-02-16 9:21 ` Hein, Jochen
2016-02-21 3:10 ` Lars Ingebrigtsen
2016-03-20 19:11 ` Jochen Hein/Jochen Kellner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455466029-12376-3-git-send-email-jochen@jochen.org \
--to=jochen@jochen.org \
--cc=ding@gnus.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).