summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-12-21 14:45:46 +1100
committerDamien Miller <djm@mindrot.org>2001-12-21 14:45:46 +1100
commit9f0f5c64bc4b6144e3fed6a7f538f7c21819a492 (patch)
treef79317ab211f59181a61b526f566e9c8cfe70c73 /sshd.c
parent89681214ca2f50a1b1ed6164c3afe1ce14995ffc (diff)
- deraadt@cvs.openbsd.org 2001/12/19 07:18:56
[auth1.c auth2.c auth2-chall.c auth-bsdauth.c auth.c authfile.c auth.h] [auth-krb4.c auth-rhosts.c auth-skey.c bufaux.c canohost.c channels.c] [cipher.c clientloop.c compat.c compress.c deattack.c key.c log.c mac.c] [match.c misc.c nchan.c packet.c readconf.c rijndael.c rijndael.h scard.c] [servconf.c servconf.h serverloop.c session.c sftp.c sftp-client.c] [sftp-glob.c sftp-int.c sftp-server.c ssh-add.c ssh-agent.c ssh.c] [sshconnect1.c sshconnect2.c sshconnect.c sshd.8 sshd.c sshd_config] [ssh-keygen.c sshlogin.c sshpty.c sshtty.c ttymodes.c uidswap.c] basic KNF done while i was looking for something else
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sshd.c b/sshd.c
index 91376de2e..c166a84ea 100644
--- a/sshd.c
+++ b/sshd.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: sshd.c,v 1.216 2001/12/10 16:45:04 stevesk Exp $"); 43RCSID("$OpenBSD: sshd.c,v 1.217 2001/12/19 07:18:56 deraadt Exp $");
44 44
45#include <openssl/dh.h> 45#include <openssl/dh.h>
46#include <openssl/bn.h> 46#include <openssl/bn.h>
@@ -399,7 +399,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
399 fatal_cleanup(); 399 fatal_cleanup();
400 } 400 }
401 debug("Client protocol version %d.%d; client software version %.100s", 401 debug("Client protocol version %d.%d; client software version %.100s",
402 remote_major, remote_minor, remote_version); 402 remote_major, remote_minor, remote_version);
403 403
404 compat_datafellows(remote_version); 404 compat_datafellows(remote_version);
405 405
@@ -467,7 +467,7 @@ destroy_sensitive_data(void)
467 key_free(sensitive_data.server_key); 467 key_free(sensitive_data.server_key);
468 sensitive_data.server_key = NULL; 468 sensitive_data.server_key = NULL;
469 } 469 }
470 for(i = 0; i < options.num_host_key_files; i++) { 470 for (i = 0; i < options.num_host_key_files; i++) {
471 if (sensitive_data.host_keys[i]) { 471 if (sensitive_data.host_keys[i]) {
472 key_free(sensitive_data.host_keys[i]); 472 key_free(sensitive_data.host_keys[i]);
473 sensitive_data.host_keys[i] = NULL; 473 sensitive_data.host_keys[i] = NULL;
@@ -483,7 +483,7 @@ list_hostkey_types(void)
483 static char buf[1024]; 483 static char buf[1024];
484 int i; 484 int i;
485 buf[0] = '\0'; 485 buf[0] = '\0';
486 for(i = 0; i < options.num_host_key_files; i++) { 486 for (i = 0; i < options.num_host_key_files; i++) {
487 Key *key = sensitive_data.host_keys[i]; 487 Key *key = sensitive_data.host_keys[i];
488 if (key == NULL) 488 if (key == NULL)
489 continue; 489 continue;
@@ -506,7 +506,7 @@ static Key *
506get_hostkey_by_type(int type) 506get_hostkey_by_type(int type)
507{ 507{
508 int i; 508 int i;
509 for(i = 0; i < options.num_host_key_files; i++) { 509 for (i = 0; i < options.num_host_key_files; i++) {
510 Key *key = sensitive_data.host_keys[i]; 510 Key *key = sensitive_data.host_keys[i];
511 if (key != NULL && key->type == type) 511 if (key != NULL && key->type == type)
512 return key; 512 return key;
@@ -687,9 +687,9 @@ main(int ac, char **av)
687 utmp_len = atoi(optarg); 687 utmp_len = atoi(optarg);
688 break; 688 break;
689 case 'o': 689 case 'o':
690 if (process_server_config_line(&options, optarg, 690 if (process_server_config_line(&options, optarg,
691 "command-line", 0) != 0) 691 "command-line", 0) != 0)
692 exit(1); 692 exit(1);
693 break; 693 break;
694 case '?': 694 case '?':
695 default: 695 default:
@@ -734,14 +734,14 @@ main(int ac, char **av)
734 734
735 /* load private host keys */ 735 /* load private host keys */
736 sensitive_data.host_keys = xmalloc(options.num_host_key_files*sizeof(Key*)); 736 sensitive_data.host_keys = xmalloc(options.num_host_key_files*sizeof(Key*));
737 for(i = 0; i < options.num_host_key_files; i++) 737 for (i = 0; i < options.num_host_key_files; i++)
738 sensitive_data.host_keys[i] = NULL; 738 sensitive_data.host_keys[i] = NULL;
739 sensitive_data.server_key = NULL; 739 sensitive_data.server_key = NULL;
740 sensitive_data.ssh1_host_key = NULL; 740 sensitive_data.ssh1_host_key = NULL;
741 sensitive_data.have_ssh1_key = 0; 741 sensitive_data.have_ssh1_key = 0;
742 sensitive_data.have_ssh2_key = 0; 742 sensitive_data.have_ssh2_key = 0;
743 743
744 for(i = 0; i < options.num_host_key_files; i++) { 744 for (i = 0; i < options.num_host_key_files; i++) {
745 key = key_load_private(options.host_key_files[i], "", NULL); 745 key = key_load_private(options.host_key_files[i], "", NULL);
746 sensitive_data.host_keys[i] = key; 746 sensitive_data.host_keys[i] = key;
747 if (key == NULL) { 747 if (key == NULL) {
@@ -842,7 +842,7 @@ main(int ac, char **av)
842 /* Chdir to the root directory so that the current disk can be 842 /* Chdir to the root directory so that the current disk can be
843 unmounted if desired. */ 843 unmounted if desired. */
844 chdir("/"); 844 chdir("/");
845 845
846 /* ignore SIGPIPE */ 846 /* ignore SIGPIPE */
847 signal(SIGPIPE, SIG_IGN); 847 signal(SIGPIPE, SIG_IGN);
848 848