Merge branch 'vendor/OPENSSH'
[dragonfly.git] / crypto / openssh / sshd.c
index 7834d90..035da81 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.375 2010/04/16 01:47:26 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.381 2011/01/11 06:13:10 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -740,6 +740,7 @@ list_hostkey_types(void)
                switch (key->type) {
                case KEY_RSA:
                case KEY_DSA:
+               case KEY_ECDSA:
                        if (buffer_len(&b) > 0)
                                buffer_append(&b, ",", 1);
                        p = key_ssh_name(key);
@@ -755,6 +756,7 @@ list_hostkey_types(void)
                case KEY_DSA_CERT_V00:
                case KEY_RSA_CERT:
                case KEY_DSA_CERT:
+               case KEY_ECDSA_CERT:
                        if (buffer_len(&b) > 0)
                                buffer_append(&b, ",", 1);
                        p = key_ssh_name(key);
@@ -781,6 +783,7 @@ get_hostkey_by_type(int type, int need_private)
                case KEY_DSA_CERT_V00:
                case KEY_RSA_CERT:
                case KEY_DSA_CERT:
+               case KEY_ECDSA_CERT:
                        key = sensitive_data.host_certificates[i];
                        break;
                default:
@@ -1478,7 +1481,7 @@ main(int ac, char **av)
        else
                closefrom(REEXEC_DEVCRYPTO_RESERVED_FD);
 
-       SSLeay_add_all_algorithms();
+       OpenSSL_add_all_algorithms();
 
        /*
         * Force logging to stderr until we have loaded the private host
@@ -1605,6 +1608,7 @@ main(int ac, char **av)
                        break;
                case KEY_RSA:
                case KEY_DSA:
+               case KEY_ECDSA:
                        sensitive_data.have_ssh2_key = 1;
                        break;
                }
@@ -2064,8 +2068,8 @@ main(int ac, char **av)
        /* The connection has been terminated. */
        packet_get_state(MODE_IN, NULL, NULL, NULL, &ibytes);
        packet_get_state(MODE_OUT, NULL, NULL, NULL, &obytes);
-       verbose("Transferred: sent %ju, received %ju bytes",
-           (uintmax_t)obytes, (uintmax_t)ibytes);
+       verbose("Transferred: sent %llu, received %llu bytes",
+           (unsigned long long)obytes, (unsigned long long)ibytes);
 
        verbose("Closing connection to %.500s port %d", remote_ip, remote_port);
 
@@ -2341,6 +2345,8 @@ do_ssh2_kex(void)
                myproposal[PROPOSAL_COMP_ALGS_CTOS] =
                myproposal[PROPOSAL_COMP_ALGS_STOC] = "none,zlib@openssh.com";
        }
+       if (options.kex_algorithms != NULL)
+               myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms;
 
        myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = list_hostkey_types();
 
@@ -2350,6 +2356,7 @@ do_ssh2_kex(void)
        kex->kex[KEX_DH_GRP14_SHA1] = kexdh_server;
        kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
        kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
+       kex->kex[KEX_ECDH_SHA2] = kexecdh_server;
        kex->server = 1;
        kex->client_version_string=client_version_string;
        kex->server_version_string=server_version_string;