myproposal.h revision 256281
1/* $OpenBSD: myproposal.h,v 1.32 2013/01/08 18:49:04 markus Exp $ */ 2/* $FreeBSD: stable/10/crypto/openssh/myproposal.h 255767 2013-09-21 21:36:09Z des $ */ 3 4/* 5 * Copyright (c) 2000 Markus Friedl. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <openssl/opensslv.h> 29 30/* conditional algorithm support */ 31 32#ifdef OPENSSL_HAS_ECC 33# define KEX_ECDH_METHODS \ 34 "ecdh-sha2-nistp256," \ 35 "ecdh-sha2-nistp384," \ 36 "ecdh-sha2-nistp521," 37# define HOSTKEY_ECDSA_CERT_METHODS \ 38 "ecdsa-sha2-nistp256-cert-v01@openssh.com," \ 39 "ecdsa-sha2-nistp384-cert-v01@openssh.com," \ 40 "ecdsa-sha2-nistp521-cert-v01@openssh.com," 41# define HOSTKEY_ECDSA_METHODS \ 42 "ecdsa-sha2-nistp256," \ 43 "ecdsa-sha2-nistp384," \ 44 "ecdsa-sha2-nistp521," 45#else 46# define KEX_ECDH_METHODS 47# define HOSTKEY_ECDSA_CERT_METHODS 48# define HOSTKEY_ECDSA_METHODS 49#endif 50 51#ifdef OPENSSL_HAVE_EVPGCM 52# define AESGCM_CIPHER_MODES \ 53 "aes128-gcm@openssh.com,aes256-gcm@openssh.com," 54#else 55# define AESGCM_CIPHER_MODES 56#endif 57 58#ifdef HAVE_EVP_SHA256 59# define KEX_SHA256_METHODS \ 60 "diffie-hellman-group-exchange-sha256," 61#define SHA2_HMAC_MODES \ 62 "hmac-sha2-256," \ 63 "hmac-sha2-512," 64#else 65# define KEX_SHA256_METHODS 66# define SHA2_HMAC_MODES 67#endif 68 69# define KEX_DEFAULT_KEX \ 70 KEX_ECDH_METHODS \ 71 KEX_SHA256_METHODS \ 72 "diffie-hellman-group-exchange-sha1," \ 73 "diffie-hellman-group14-sha1," \ 74 "diffie-hellman-group1-sha1" 75 76#define KEX_DEFAULT_PK_ALG \ 77 HOSTKEY_ECDSA_CERT_METHODS \ 78 "ssh-rsa-cert-v01@openssh.com," \ 79 "ssh-dss-cert-v01@openssh.com," \ 80 "ssh-rsa-cert-v00@openssh.com," \ 81 "ssh-dss-cert-v00@openssh.com," \ 82 HOSTKEY_ECDSA_METHODS \ 83 "ssh-rsa," \ 84 "ssh-dss" 85 86/* the actual algorithms */ 87 88#define KEX_DEFAULT_ENCRYPT \ 89 "aes128-ctr,aes192-ctr,aes256-ctr," \ 90 "arcfour256,arcfour128," \ 91 AESGCM_CIPHER_MODES \ 92 "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \ 93 "aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se" 94#ifdef NONE_CIPHER_ENABLED 95#define KEX_ENCRYPT_INCLUDE_NONE KEX_DEFAULT_ENCRYPT \ 96 ",none" 97#endif 98 99#define KEX_DEFAULT_MAC \ 100 "hmac-md5-etm@openssh.com," \ 101 "hmac-sha1-etm@openssh.com," \ 102 "umac-64-etm@openssh.com," \ 103 "umac-128-etm@openssh.com," \ 104 "hmac-sha2-256-etm@openssh.com," \ 105 "hmac-sha2-512-etm@openssh.com," \ 106 "hmac-ripemd160-etm@openssh.com," \ 107 "hmac-sha1-96-etm@openssh.com," \ 108 "hmac-md5-96-etm@openssh.com," \ 109 "hmac-md5," \ 110 "hmac-sha1," \ 111 "umac-64@openssh.com," \ 112 "umac-128@openssh.com," \ 113 SHA2_HMAC_MODES \ 114 "hmac-ripemd160," \ 115 "hmac-ripemd160@openssh.com," \ 116 "hmac-sha1-96," \ 117 "hmac-md5-96" 118 119#define KEX_DEFAULT_COMP "none,zlib@openssh.com,zlib" 120#define KEX_DEFAULT_LANG "" 121 122 123static char *myproposal[PROPOSAL_MAX] = { 124 KEX_DEFAULT_KEX, 125 KEX_DEFAULT_PK_ALG, 126 KEX_DEFAULT_ENCRYPT, 127 KEX_DEFAULT_ENCRYPT, 128 KEX_DEFAULT_MAC, 129 KEX_DEFAULT_MAC, 130 KEX_DEFAULT_COMP, 131 KEX_DEFAULT_COMP, 132 KEX_DEFAULT_LANG, 133 KEX_DEFAULT_LANG 134}; 135