comparison cli-authpubkey.c @ 668:405418f7dc5e

Fixed compilation with unset ENABLE_{SVR,CLI}_AGENTFWD. Got rid of ENABLE_AGENTFWD macro.
author Andrey Mazo <ahippo@yandex.ru>
date Mon, 26 Mar 2012 16:17:16 +0400
parents 52d7301e46bd
children a8367733e8cd
comparison
equal deleted inserted replaced
667:fc7ae88e63b3 668:405418f7dc5e
121 } 121 }
122 122
123 void cli_buf_put_sign(buffer* buf, sign_key *key, int type, 123 void cli_buf_put_sign(buffer* buf, sign_key *key, int type,
124 const unsigned char *data, unsigned int len) 124 const unsigned char *data, unsigned int len)
125 { 125 {
126 #ifdef ENABLE_CLI_AGENTFWD
126 if (key->source == SIGNKEY_SOURCE_AGENT) { 127 if (key->source == SIGNKEY_SOURCE_AGENT) {
127 /* Format the agent signature ourselves, as buf_put_sign would. */ 128 /* Format the agent signature ourselves, as buf_put_sign would. */
128 buffer *sigblob; 129 buffer *sigblob;
129 sigblob = buf_new(MAX_PUBKEY_SIZE); 130 sigblob = buf_new(MAX_PUBKEY_SIZE);
130 agent_buf_sign(sigblob, key, data, len); 131 agent_buf_sign(sigblob, key, data, len);
132 buf_putstring(buf, buf_getptr(sigblob, sigblob->len), 133 buf_putstring(buf, buf_getptr(sigblob, sigblob->len),
133 sigblob->len); 134 sigblob->len);
134 135
135 buf_free(sigblob); 136 buf_free(sigblob);
136 } else { 137 } else {
138 #endif
137 buf_put_sign(buf, key, type, data, len); 139 buf_put_sign(buf, key, type, data, len);
138 } 140 #ifdef ENABLE_CLI_AGENTFWD
141 }
142 #endif
139 143
140 } 144 }
141 145
142 /* TODO: make it take an agent reference to use as well */ 146 /* TODO: make it take an agent reference to use as well */
143 static void send_msg_userauth_pubkey(sign_key *key, int type, int realsign) { 147 static void send_msg_userauth_pubkey(sign_key *key, int type, int realsign) {
185 /* Returns 1 if a key was tried */ 189 /* Returns 1 if a key was tried */
186 int cli_auth_pubkey() { 190 int cli_auth_pubkey() {
187 191
188 TRACE(("enter cli_auth_pubkey")) 192 TRACE(("enter cli_auth_pubkey"))
189 193
194 #ifdef ENABLE_CLI_AGENTFWD
190 if (!cli_opts.agent_keys_loaded) { 195 if (!cli_opts.agent_keys_loaded) {
191 /* get the list of available keys from the agent */ 196 /* get the list of available keys from the agent */
192 cli_load_agent_keys(cli_opts.privkeys); 197 cli_load_agent_keys(cli_opts.privkeys);
193 cli_opts.agent_keys_loaded = 1; 198 cli_opts.agent_keys_loaded = 1;
194 } 199 }
200 #endif
195 201
196 if (cli_opts.privkeys->first) { 202 if (cli_opts.privkeys->first) {
197 sign_key * key = (sign_key*)cli_opts.privkeys->first->item; 203 sign_key * key = (sign_key*)cli_opts.privkeys->first->item;
198 /* Send a trial request */ 204 /* Send a trial request */
199 send_msg_userauth_pubkey(key, key->type, 0); 205 send_msg_userauth_pubkey(key, key->type, 0);