kexdhc.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
#pragma ident "%Z%%M% %I% %E% SMI"
#include "xmalloc.h"
#include "buffer.h"
#include "bufaux.h"
#include "key.h"
#include "kex.h"
#include "log.h"
#include "packet.h"
#include "dh.h"
#include "ssh2.h"
#include "monitor_wrap.h"
void
{
/* generate and send 'e', client DH public key */
dh = dh_new_group1();
packet_send();
debug("sending SSH2_MSG_KEXDH_INIT");
#ifdef DEBUG_KEXDH
#endif
debug("expecting SSH2_MSG_KEXDH_REPLY");
/* key, cert */
if (server_host_key == NULL)
fatal("cannot decode server_host_key_blob");
fatal("type mismatch for decoded server_host_key_blob");
fatal("cannot verify server_host_key");
fatal("server_host_key verification failed");
/* DH paramter f, server public DH key */
fatal("dh_server_pub == NULL");
#ifdef DEBUG_KEXDH
#endif
/* signed H */
packet_disconnect("bad server public DH value");
#ifdef DEBUG_KEXDH
#endif
fatal("kexdh_client: BN_new failed");
/* calc and verify H */
hash = kex_dh_hash(
);
fatal("key_verify failed for server_host_key");
/* save session id */
}
}