myproposal.h revision 221420
1221420Sdes/* $OpenBSD: myproposal.h,v 1.27 2010/09/01 22:42:13 djm Exp $ */
276259Sgreen
365668Skris/*
465668Skris * Copyright (c) 2000 Markus Friedl.  All rights reserved.
565668Skris *
665668Skris * Redistribution and use in source and binary forms, with or without
765668Skris * modification, are permitted provided that the following conditions
865668Skris * are met:
965668Skris * 1. Redistributions of source code must retain the above copyright
1065668Skris *    notice, this list of conditions and the following disclaimer.
1165668Skris * 2. Redistributions in binary form must reproduce the above copyright
1265668Skris *    notice, this list of conditions and the following disclaimer in the
1365668Skris *    documentation and/or other materials provided with the distribution.
1465668Skris *
1565668Skris * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1665668Skris * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1765668Skris * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1865668Skris * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1965668Skris * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2065668Skris * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2165668Skris * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2265668Skris * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2365668Skris * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2465668Skris * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2565668Skris */
26162856Sdes
27162856Sdes#include <openssl/opensslv.h>
28162856Sdes
29221420Sdes#ifdef OPENSSL_HAS_ECC
30221420Sdes# define KEX_ECDH_METHODS \
31221420Sdes	"ecdh-sha2-nistp256," \
32221420Sdes	"ecdh-sha2-nistp384," \
33221420Sdes	"ecdh-sha2-nistp521,"
34221420Sdes# define HOSTKEY_ECDSA_CERT_METHODS \
35221420Sdes	"ecdsa-sha2-nistp256-cert-v01@openssh.com," \
36221420Sdes	"ecdsa-sha2-nistp384-cert-v01@openssh.com," \
37221420Sdes	"ecdsa-sha2-nistp521-cert-v01@openssh.com,"
38221420Sdes# define HOSTKEY_ECDSA_METHODS \
39221420Sdes	"ecdsa-sha2-nistp256," \
40221420Sdes	"ecdsa-sha2-nistp384," \
41221420Sdes	"ecdsa-sha2-nistp521,"
42221420Sdes#else
43221420Sdes# define KEX_ECDH_METHODS
44221420Sdes# define HOSTKEY_ECDSA_CERT_METHODS
45221420Sdes# define HOSTKEY_ECDSA_METHODS
46221420Sdes#endif
47221420Sdes
48162856Sdes/* Old OpenSSL doesn't support what we need for DHGEX-sha256 */
49221420Sdes#if OPENSSL_VERSION_NUMBER >= 0x00907000L
50221420Sdes# define KEX_SHA256_METHODS \
51221420Sdes	"diffie-hellman-group-exchange-sha256,"
52162856Sdes#else
53221420Sdes# define KEX_SHA256_METHODS
54221420Sdes#endif
55221420Sdes
56221420Sdes# define KEX_DEFAULT_KEX \
57221420Sdes	KEX_ECDH_METHODS \
58221420Sdes	KEX_SHA256_METHODS \
59162856Sdes	"diffie-hellman-group-exchange-sha1," \
60162856Sdes	"diffie-hellman-group14-sha1," \
61162856Sdes	"diffie-hellman-group1-sha1"
62162856Sdes
63215116Sdes#define	KEX_DEFAULT_PK_ALG	\
64221420Sdes	HOSTKEY_ECDSA_CERT_METHODS \
65221420Sdes	"ssh-rsa-cert-v01@openssh.com," \
66221420Sdes	"ssh-dss-cert-v01@openssh.com," \
67221420Sdes	"ssh-rsa-cert-v00@openssh.com," \
68221420Sdes	"ssh-dss-cert-v00@openssh.com," \
69221420Sdes	HOSTKEY_ECDSA_METHODS \
70221420Sdes	"ssh-rsa," \
71221420Sdes	"ssh-dss"
72192595Sdes
7369587Sgreen#define	KEX_DEFAULT_ENCRYPT \
74192595Sdes	"aes128-ctr,aes192-ctr,aes256-ctr," \
75192595Sdes	"arcfour256,arcfour128," \
76149753Sdes	"aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \
77192595Sdes	"aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se"
7876259Sgreen#define	KEX_DEFAULT_MAC \
79181111Sdes	"hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160," \
8076259Sgreen	"hmac-ripemd160@openssh.com," \
8176259Sgreen	"hmac-sha1-96,hmac-md5-96"
82149753Sdes#define	KEX_DEFAULT_COMP	"none,zlib@openssh.com,zlib"
8360573Skris#define	KEX_DEFAULT_LANG	""
8460573Skris
8560573Skris
8661209Skrisstatic char *myproposal[PROPOSAL_MAX] = {
8760573Skris	KEX_DEFAULT_KEX,
8860573Skris	KEX_DEFAULT_PK_ALG,
8960573Skris	KEX_DEFAULT_ENCRYPT,
9060573Skris	KEX_DEFAULT_ENCRYPT,
9160573Skris	KEX_DEFAULT_MAC,
9260573Skris	KEX_DEFAULT_MAC,
9360573Skris	KEX_DEFAULT_COMP,
9460573Skris	KEX_DEFAULT_COMP,
9560573Skris	KEX_DEFAULT_LANG,
9660573Skris	KEX_DEFAULT_LANG
9760573Skris};
98