1 /* sshd.c */ 2 /* yet another ssh daemon (Yawn!) */ 3 /* 4 Copyright 2004 Aris Adamantiadis 5 6 This file is part of the SSH Library 7 8 The SSH Library is free software; you can redistribute it and/or modify 9 it under the terms of the GNU Lesser General Public License as published by 10 the Free Software Foundation; either version 2.1 of the License, or (at your 11 option) any later version. 12 13 The SSH Library is distributed in the hope that it will be useful, but 14 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 16 License for more details. 17 18 You should have received a copy of the GNU Lesser General Public License 19 along with the SSH Library; see the file COPYING. If not, write to 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 21 MA 02111-1307, USA. */ 22 23 #include <libssh/libssh.h> 24 #include <libssh/server.h> 25 #include "libssh/priv.h" 26 #include <unistd.h> 27 #include <stdio.h> 28 int main(int argc, char **argv){ 29 #ifdef WITH_SERVER 30 SSH_OPTIONS *opts=ssh_getopt(&argc,argv); 31 SSH_SESSION *server = getserver(opts); 32 if(!server){ 33 printf("pwned : %s\n",ssh_get_error(NULL)); 34 exit(-1); 35 } 36 server->clientbanner = ssh_get_banner(server); 37 if(!server->clientbanner){ 38 printf("%s\n",ssh_get_error(NULL)); 39 return -1; 40 } 41 server_set_kex(server); 42 send_kex(server,1); 43 if (ssh_get_kex(server,1)){ 44 printf("%s \n",ssh_get_error(NULL)); 45 return -1; 46 } 47 list_kex(&server->client_kex); 48 49 printf("Key exchange complete.\n"); 50 51 while(1); 52 #endif 53 return 0; 54 } |