[PATCH] Compilation fix when ENABLE_CLI_AGENTFWD undefined

Laurent Bercot ska-dietlibc at skarnet.org
Wed Aug 3 18:25:09 WST 2011


 Hello,

 (I just subscribed to the list, so the following points might already
have been addressed; sorry if it's the case.)

 Here is a patch for dropbear-0.53.1 that fixes a compilation and
linking issue that currently comes up when ENABLE_CLI_AGENTFWD is not
defined at all. Only the cli-authpubkey.c file is touched.

 Matt, please review, and apply if it's correct. :)

 Also, please note that "make distclean", after a dropbear build, fails
to remove the following files:
 - config.log
 - config.status
 - libtomcrypt/Makefile
 - libtommath/Makefile
 I did not provide a patch for this because it could be intentional;
if it is not, please fix it too for completeness.


-- 
 Laurent
-------------- next part --------------
diff -rNU3 dropbear-0.53.1.old/cli-authpubkey.c dropbear-0.53.1/cli-authpubkey.c
--- dropbear-0.53.1.old/cli-authpubkey.c	2011-03-02 14:23:35.000000000 +0100
+++ dropbear-0.53.1/cli-authpubkey.c	2011-07-29 12:52:19.000000000 +0200
@@ -123,6 +123,7 @@
 void cli_buf_put_sign(buffer* buf, sign_key *key, int type, 
 			const unsigned char *data, unsigned int len)
 {
+#ifdef ENABLE_CLI_AGENTFWD
 	if (key->source == SIGNKEY_SOURCE_AGENT) {
 		/* Format the agent signature ourselves, as buf_put_sign would. */
 		buffer *sigblob;
@@ -134,9 +135,11 @@
 
 		buf_free(sigblob);
 	} else {
+#endif
 		buf_put_sign(buf, key, type, data, len);
+#ifdef ENABLE_CLI_AGENTFWD
 	}
-	
+#endif	
 }
 
 /* TODO: make it take an agent reference to use as well */
@@ -186,13 +189,13 @@
 int cli_auth_pubkey() {
 
 	TRACE(("enter cli_auth_pubkey"))
-
+#ifdef ENABLE_CLI_AGENTFWD
 	if (!cli_opts.agent_keys_loaded) {
 		/* get the list of available keys from the agent */
 		cli_load_agent_keys(cli_opts.privkeys);
 		cli_opts.agent_keys_loaded = 1;
 	}
-
+#endif
 	if (cli_opts.privkeys->first) {
 		sign_key * key = (sign_key*)cli_opts.privkeys->first->item;
 		/* Send a trial request */


More information about the Dropbear mailing list