summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/kex.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2017-04-30 23:10:44 +0000
committerDamien Miller <djm@cvs.openbsd.org>2017-04-30 23:10:44 +0000
commitc836d45ce77214fc6c999eb2c2b45f13e08c9117 (patch)
treee61bd5f201c7e75e8d64862da207dac9235b3387 /usr.bin/ssh/kex.c
parent9ea8e1ac837654ec4c1d518612a662b10581ada2 (diff)
unifdef WITH_SSH1
ok markus@
Diffstat (limited to 'usr.bin/ssh/kex.c')
-rw-r--r--usr.bin/ssh/kex.c43
1 files changed, 1 insertions, 42 deletions
diff --git a/usr.bin/ssh/kex.c b/usr.bin/ssh/kex.c
index 064fc3b0858..40dfb09c2b4 100644
--- a/usr.bin/ssh/kex.c
+++ b/usr.bin/ssh/kex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.131 2017/03/15 07:07:39 markus Exp $ */
+/* $OpenBSD: kex.c,v 1.132 2017/04/30 23:10:43 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -966,47 +966,6 @@ kex_derive_keys_bn(struct ssh *ssh, u_char *hash, u_int hashlen,
}
#endif
-#ifdef WITH_SSH1
-int
-derive_ssh1_session_id(BIGNUM *host_modulus, BIGNUM *server_modulus,
- u_int8_t cookie[8], u_int8_t id[16])
-{
- u_int8_t hbuf[2048], sbuf[2048], obuf[SSH_DIGEST_MAX_LENGTH];
- struct ssh_digest_ctx *hashctx = NULL;
- size_t hlen, slen;
- int r;
-
- hlen = BN_num_bytes(host_modulus);
- slen = BN_num_bytes(server_modulus);
- if (hlen < (512 / 8) || (u_int)hlen > sizeof(hbuf) ||
- slen < (512 / 8) || (u_int)slen > sizeof(sbuf))
- return SSH_ERR_KEY_BITS_MISMATCH;
- if (BN_bn2bin(host_modulus, hbuf) <= 0 ||
- BN_bn2bin(server_modulus, sbuf) <= 0) {
- r = SSH_ERR_LIBCRYPTO_ERROR;
- goto out;
- }
- if ((hashctx = ssh_digest_start(SSH_DIGEST_MD5)) == NULL) {
- r = SSH_ERR_ALLOC_FAIL;
- goto out;
- }
- if (ssh_digest_update(hashctx, hbuf, hlen) != 0 ||
- ssh_digest_update(hashctx, sbuf, slen) != 0 ||
- ssh_digest_update(hashctx, cookie, 8) != 0 ||
- ssh_digest_final(hashctx, obuf, sizeof(obuf)) != 0) {
- r = SSH_ERR_LIBCRYPTO_ERROR;
- goto out;
- }
- memcpy(id, obuf, ssh_digest_bytes(SSH_DIGEST_MD5));
- r = 0;
- out:
- ssh_digest_free(hashctx);
- explicit_bzero(hbuf, sizeof(hbuf));
- explicit_bzero(sbuf, sizeof(sbuf));
- explicit_bzero(obuf, sizeof(obuf));
- return r;
-}
-#endif
#if defined(DEBUG_KEX) || defined(DEBUG_KEXDH) || defined(DEBUG_KEXECDH)
void