Add missing license comments.

This commit is contained in:
Michael Jumper 2013-12-02 02:07:17 -08:00
parent a2921825b7
commit 84c484aa72
9 changed files with 254 additions and 7 deletions

View File

@ -68,6 +68,9 @@ const char* GUAC_CLIENT_ARGS[] = {
"enable-sftp", "enable-sftp",
"private-key", "private-key",
"passphrase", "passphrase",
#ifdef ENABLE_SSH_AGENT
"enable-agent",
#endif
NULL NULL
}; };
@ -118,6 +121,13 @@ enum __SSH_ARGS_IDX {
*/ */
IDX_PASSPHRASE, IDX_PASSPHRASE,
#ifdef ENABLE_SSH_AGENT
/**
* Whether SSH agent forwarding support should be enabled.
*/
IDX_ENABLE_AGENT,
#endif
SSH_ARGS_COUNT SSH_ARGS_COUNT
}; };
@ -168,6 +178,10 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
client_data->sftp_ssh_session = NULL; client_data->sftp_ssh_session = NULL;
strcpy(client_data->sftp_upload_path, "."); strcpy(client_data->sftp_upload_path, ".");
#ifdef ENABLE_SSH_AGENT
client_data->enable_agent = strcmp(argv[IDX_ENABLE_AGENT], "true") == 0;
#endif
/* Read port */ /* Read port */
if (argv[IDX_PORT][0] != 0) if (argv[IDX_PORT][0] != 0)
strcpy(client_data->port, argv[IDX_PORT]); strcpy(client_data->port, argv[IDX_PORT]);

View File

@ -103,6 +103,13 @@ typedef struct ssh_guac_client_data {
*/ */
bool enable_sftp; bool enable_sftp;
#ifdef ENABLE_SSH_AGENT
/**
* Whether the SSH agent is enabled.
*/
bool enable_agent;
#endif
/** /**
* The SSH client thread. * The SSH client thread.
*/ */

View File

@ -1,4 +1,40 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-ssh.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <unistd.h> #include <unistd.h>
@ -66,13 +102,13 @@ void ssh_auth_agent_list_identities(ssh_auth_agent* auth_agent) {
buffer_write_uint32(&pos, 1+4 buffer_write_uint32(&pos, 1+4
+ key->public_key_length+4 + key->public_key_length+4
+ sizeof("comment")+3); + sizeof(SSH_AGENT_COMMENT)+3);
buffer_write_byte(&pos, SSH2_AGENT_IDENTITIES_ANSWER); buffer_write_byte(&pos, SSH2_AGENT_IDENTITIES_ANSWER);
buffer_write_uint32(&pos, 1); buffer_write_uint32(&pos, 1);
buffer_write_string(&pos, key->public_key, key->public_key_length); buffer_write_string(&pos, key->public_key, key->public_key_length);
buffer_write_string(&pos, "comment", sizeof("comment")-1); buffer_write_string(&pos, SSH_AGENT_COMMENT, sizeof(SSH_AGENT_COMMENT)-1);
libssh2_channel_write(channel, buffer, pos-buffer); libssh2_channel_write(channel, buffer, pos-buffer);
libssh2_channel_flush(channel); libssh2_channel_flush(channel);

View File

@ -1,4 +1,40 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-ssh.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _GUAC_SSH_AGENT_H #ifndef _GUAC_SSH_AGENT_H
#define _GUAC_SSH_AGENT_H #define _GUAC_SSH_AGENT_H
@ -24,6 +60,11 @@
*/ */
#define SSH2_AGENT_SIGN_RESPONSE 0x0E #define SSH2_AGENT_SIGN_RESPONSE 0x0E
/**
* The comment to associate with public keys when listed.
*/
#define SSH_AGENT_COMMENT "Guacamole SSH Agent"
/** /**
* The packet sent by the SSH agent when an operation is not supported. * The packet sent by the SSH agent when an operation is not supported.
*/ */

View File

@ -1,4 +1,40 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-ssh.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>

View File

@ -1,4 +1,40 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-ssh.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _GUAC_SSH_BUFFER_H #ifndef _GUAC_SSH_BUFFER_H
#define _GUAC_SSH_BUFFER_H #define _GUAC_SSH_BUFFER_H

View File

@ -372,12 +372,17 @@ void* ssh_client_thread(void* data) {
} }
#ifdef ENABLE_SSH_AGENT #ifdef ENABLE_SSH_AGENT
/* Start SSH agent forwarding, if enabled */
if (client_data->enable_agent) {
libssh2_session_callback_set(client_data->session, libssh2_session_callback_set(client_data->session,
LIBSSH2_CALLBACK_AUTH_AGENT, (void*) ssh_auth_agent_callback); LIBSSH2_CALLBACK_AUTH_AGENT, (void*) ssh_auth_agent_callback);
/* Request agent forwarding */ /* Request agent forwarding */
if (libssh2_channel_request_auth_agent(client_data->term_channel)) if (libssh2_channel_request_auth_agent(client_data->term_channel))
guac_client_log_error(client, "Agent forwarding request failed"); guac_client_log_error(client, "Agent forwarding request failed");
else
guac_client_log_info(client, "Agent forwarding enabled.");
}
#endif #endif
/* Start SFTP session as well, if enabled */ /* Start SFTP session as well, if enabled */

View File

@ -1,4 +1,40 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-ssh.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <string.h> #include <string.h>
#include <openssl/err.h> #include <openssl/err.h>

View File

@ -1,4 +1,40 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-ssh.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _GUAC_SSH_KEY_H #ifndef _GUAC_SSH_KEY_H
#define _GUAC_SSH_KEY_H #define _GUAC_SSH_KEY_H