diff src/ch/ethz/ssh2/Session.java @ 287:db9b028016de ganymed

start conversion from trilead to ganymed
author Carl Byington <carl@five-ten-sg.com>
date Fri, 18 Jul 2014 19:52:08 -0700
parents 91a31873c42a
children 9ae4ed7bb523
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/Session.java	Fri Jul 18 19:26:29 2014 -0700
+++ b/src/ch/ethz/ssh2/Session.java	Fri Jul 18 19:52:08 2014 -0700
@@ -336,6 +336,26 @@
 		cm.requestSubSystem(cn, name);
 	}
 
+    /**
+     * Request authentication agent forwarding.
+     * @param agent object that implements the callbacks
+     *
+     * @throws IOException in case of any problem or when the session is closed
+     */
+
+    public synchronized boolean requestAuthAgentForwarding(AuthAgentCallback agent) throws IOException {
+        synchronized (this) {
+            /*
+             * The following is just a nicer error, we would catch it anyway
+             * later in the channel code
+             */
+            if (flag_closed)
+                throw new IOException("This session is closed.");
+        }
+
+        return cm.requestChannelAgentForwarding(cn, agent);
+    }
+
 	public int getState()
 	{
 		return cn.getState();