1/* 2 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * All rights reserved 5 * Created: Sat Mar 18 22:15:47 1995 ylo 6 * Code to connect to a remote host, and to perform the client side of the 7 * login (authentication) dialog. 8 * |
9 * $FreeBSD: head/crypto/openssh/sshconnect.c 61212 2000-06-03 09:58:15Z kris $ |
10 */ 11 12#include "includes.h" |
13RCSID("$OpenBSD: sshconnect.c,v 1.74 2000/05/17 16:57:02 markus Exp $"); |
14 15#include <openssl/bn.h> 16#include <openssl/dsa.h> 17#include <openssl/rsa.h> 18 19#include "xmalloc.h" 20#include "rsa.h" 21#include "ssh.h" --- 226 unchanged lines hidden (view full) --- 248 249 /* Connect to the host. We use the user's uid in the 250 * hope that it will help with tcp_wrappers showing 251 * the remote uid as root. 252 */ 253 temporarily_use_uid(original_real_uid); 254 if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { 255 /* Successful connection. */ |
256 memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); |
257 restore_uid(); 258 break; 259 } else { 260 debug("connect: %.100s", strerror(errno)); 261 restore_uid(); 262 /* 263 * Close the failed socket; there appear to 264 * be some problems when reusing a socket for --- 29 unchanged lines hidden (view full) --- 294 setsockopt(sock, SOL_SOCKET, SO_LINGER, (void *) &linger, sizeof(linger)); 295 296 /* Set the connection. */ 297 packet_set_connection(sock, sock); 298 299 return 1; 300} 301 |
302/* 303 * Waits for the server identification string, and sends our own 304 * identification string. 305 */ 306void 307ssh_exchange_identification() 308{ 309 char buf[256], remote_version[256]; /* must be same size! */ --- 618 unchanged lines hidden --- |