summaryrefslogtreecommitdiff
path: root/ssh-agent.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-05-15 14:24:09 +1000
committerDamien Miller <djm@mindrot.org>2014-05-15 14:24:09 +1000
commit1f0311c7c7d10c94ff7f823de9c5b2ed79368b14 (patch)
treeae708c2a25f84a04bcb04f2dbf3e8039e0f692bc /ssh-agent.c
parentc5893785564498cea73cb60d2cf199490483e080 (diff)
- markus@cvs.openbsd.org 2014/04/29 18:01:49
[auth.c authfd.c authfile.c bufaux.c cipher.c cipher.h hostfile.c] [kex.c key.c mac.c monitor.c monitor_wrap.c myproposal.h packet.c] [roaming_client.c ssh-agent.c ssh-keygen.c ssh-keyscan.c ssh-keysign.c] [ssh-pkcs11.h ssh.c sshconnect.c sshconnect2.c sshd.c] make compiling against OpenSSL optional (make OPENSSL=no); reduces algorithms to curve25519, aes-ctr, chacha, ed25519; allows us to explore further options; with and ok djm
Diffstat (limited to 'ssh-agent.c')
-rw-r--r--ssh-agent.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ssh-agent.c b/ssh-agent.c
index f4c0524cc..bc96ad705 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-agent.c,v 1.184 2014/03/15 17:28:26 deraadt Exp $ */ 1/* $OpenBSD: ssh-agent.c,v 1.185 2014/04/29 18:01:49 markus Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -49,8 +49,10 @@
49#endif 49#endif
50#include "openbsd-compat/sys-queue.h" 50#include "openbsd-compat/sys-queue.h"
51 51
52#ifdef WITH_OPENSSL
52#include <openssl/evp.h> 53#include <openssl/evp.h>
53#include "openbsd-compat/openssl-compat.h" 54#include "openbsd-compat/openssl-compat.h"
55#endif
54 56
55#include <errno.h> 57#include <errno.h>
56#include <fcntl.h> 58#include <fcntl.h>
@@ -221,9 +223,11 @@ process_request_identities(SocketEntry *e, int version)
221 buffer_put_int(&msg, tab->nentries); 223 buffer_put_int(&msg, tab->nentries);
222 TAILQ_FOREACH(id, &tab->idlist, next) { 224 TAILQ_FOREACH(id, &tab->idlist, next) {
223 if (id->key->type == KEY_RSA1) { 225 if (id->key->type == KEY_RSA1) {
226#ifdef WITH_SSH1
224 buffer_put_int(&msg, BN_num_bits(id->key->rsa->n)); 227 buffer_put_int(&msg, BN_num_bits(id->key->rsa->n));
225 buffer_put_bignum(&msg, id->key->rsa->e); 228 buffer_put_bignum(&msg, id->key->rsa->e);
226 buffer_put_bignum(&msg, id->key->rsa->n); 229 buffer_put_bignum(&msg, id->key->rsa->n);
230#endif
227 } else { 231 } else {
228 u_char *blob; 232 u_char *blob;
229 u_int blen; 233 u_int blen;
@@ -238,6 +242,7 @@ process_request_identities(SocketEntry *e, int version)
238 buffer_free(&msg); 242 buffer_free(&msg);
239} 243}
240 244
245#ifdef WITH_SSH1
241/* ssh1 only */ 246/* ssh1 only */
242static void 247static void
243process_authentication_challenge1(SocketEntry *e) 248process_authentication_challenge1(SocketEntry *e)
@@ -308,6 +313,7 @@ send:
308 BN_clear_free(challenge); 313 BN_clear_free(challenge);
309 buffer_free(&msg); 314 buffer_free(&msg);
310} 315}
316#endif
311 317
312/* ssh2 only */ 318/* ssh2 only */
313static void 319static void
@@ -733,6 +739,7 @@ process_message(SocketEntry *e)
733 case SSH_AGENTC_UNLOCK: 739 case SSH_AGENTC_UNLOCK:
734 process_lock_agent(e, type == SSH_AGENTC_LOCK); 740 process_lock_agent(e, type == SSH_AGENTC_LOCK);
735 break; 741 break;
742#ifdef WITH_SSH1
736 /* ssh1 */ 743 /* ssh1 */
737 case SSH_AGENTC_RSA_CHALLENGE: 744 case SSH_AGENTC_RSA_CHALLENGE:
738 process_authentication_challenge1(e); 745 process_authentication_challenge1(e);
@@ -750,6 +757,7 @@ process_message(SocketEntry *e)
750 case SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES: 757 case SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES:
751 process_remove_all_identities(e, 1); 758 process_remove_all_identities(e, 1);
752 break; 759 break;
760#endif
753 /* ssh2 */ 761 /* ssh2 */
754 case SSH2_AGENTC_SIGN_REQUEST: 762 case SSH2_AGENTC_SIGN_REQUEST:
755 process_sign_request2(e); 763 process_sign_request2(e);
@@ -1040,7 +1048,9 @@ main(int ac, char **av)
1040 prctl(PR_SET_DUMPABLE, 0); 1048 prctl(PR_SET_DUMPABLE, 0);
1041#endif 1049#endif
1042 1050
1051#ifdef WITH_OPENSSL
1043 OpenSSL_add_all_algorithms(); 1052 OpenSSL_add_all_algorithms();
1053#endif
1044 1054
1045 __progname = ssh_get_progname(av[0]); 1055 __progname = ssh_get_progname(av[0]);
1046 seed_rng(); 1056 seed_rng();