comparison sysoptions.h @ 839:33207ed1174b

Merge in ECC
author Matt Johnston <matt@ucc.asn.au>
date Mon, 21 Oct 2013 22:57:21 +0800
parents 4095b6d7c9fc
children 4365e12c68e6
comparison
equal deleted inserted replaced
834:e378da7eae5d 839:33207ed1174b
67 67
68 /* success/failure defines */ 68 /* success/failure defines */
69 #define DROPBEAR_SUCCESS 0 69 #define DROPBEAR_SUCCESS 0
70 #define DROPBEAR_FAILURE -1 70 #define DROPBEAR_FAILURE -1
71 71
72 /* various algorithm identifiers */
73 #define DROPBEAR_KEX_NONE 0
74 #define DROPBEAR_KEX_DH_GROUP1 1
75 #define DROPBEAR_KEX_DH_GROUP14 2
76
77 #define DROPBEAR_SIGNKEY_ANY 0
78 #define DROPBEAR_SIGNKEY_RSA 1
79 #define DROPBEAR_SIGNKEY_DSS 2
80 #define DROPBEAR_SIGNKEY_NONE 3
81
82 #define DROPBEAR_COMP_NONE 0
83 #define DROPBEAR_COMP_ZLIB 1
84 #define DROPBEAR_COMP_ZLIB_DELAY 2
85
86 /* Required for pubkey auth */ 72 /* Required for pubkey auth */
87 #if defined(ENABLE_SVR_PUBKEY_AUTH) || defined(DROPBEAR_CLIENT) 73 #if defined(ENABLE_SVR_PUBKEY_AUTH) || defined(DROPBEAR_CLIENT)
88 #define DROPBEAR_SIGNKEY_VERIFY 74 #define DROPBEAR_SIGNKEY_VERIFY
89 #endif 75 #endif
90 76
91 #define SHA1_HASH_SIZE 20 77 #define SHA1_HASH_SIZE 20
92 #define MD5_HASH_SIZE 16 78 #define MD5_HASH_SIZE 16
93 79
94 #define MAX_KEY_LEN 32 /* 256 bits for aes256 etc */ 80 #define MAX_KEY_LEN 32 /* 256 bits for aes256 etc */
95 #define MAX_IV_LEN 20 /* must be same as max blocksize, 81 #define MAX_IV_LEN 20 /* must be same as max blocksize, */
96 and >= SHA1_HASH_SIZE */
97 82
98 #if defined(DROPBEAR_SHA2_512_HMAC) 83 #if defined(DROPBEAR_SHA2_512_HMAC)
99 #define MAX_MAC_LEN 64 84 #define MAX_MAC_LEN 64
100 #elif defined(DROPBEAR_SHA2_256_HMAC) 85 #elif defined(DROPBEAR_SHA2_256_HMAC)
101 #define MAX_MAC_LEN 32 86 #define MAX_MAC_LEN 32
102 #else 87 #else
103 #define MAX_MAC_LEN 20 88 #define MAX_MAC_LEN 20
104 #endif 89 #endif
105 90
91 #if defined(DROPBEAR_ECDH) || defined (DROPBEAR_ECDSA)
92 #define DROPBEAR_ECC
93 #endif
94
95 #ifdef DROPBEAR_ECC
96 #define DROPBEAR_ECC_256
97 #define DROPBEAR_ECC_384
98 #define DROPBEAR_ECC_521
99 #endif
100
101 #ifdef DROPBEAR_ECC
102 #define DROPBEAR_LTC_PRNG
103 #endif
104
105 // hashes which will be linked and registered
106 #if defined(DROPBEAR_SHA2_256_HMAC) || defined(DROPBEAR_ECC_256)
107 #define DROPBEAR_SHA256
108 #endif
109 #if defined(DROPBEAR_ECC_384)
110 #define DROPBEAR_SHA384
111 #endif
112 #if defined(DROPBEAR_SHA2_512_HMAC) || defined(DROPBEAR_ECC_521)
113 #define DROPBEAR_SHA512
114 #endif
115 #if defined(DROPBEAR_MD5_HMAC)
116 #define DROPBEAR_MD5
117 #endif
118
119 // roughly 2x 521 bits
120 #define MAX_ECC_SIZE 140
121
106 #define MAX_NAME_LEN 64 /* maximum length of a protocol name, isn't 122 #define MAX_NAME_LEN 64 /* maximum length of a protocol name, isn't
107 explicitly specified for all protocols (just 123 explicitly specified for all protocols (just
108 for algos) but seems valid */ 124 for algos) but seems valid */
109 125
110 #define MAX_PROPOSED_ALGO 20 126 #define MAX_PROPOSED_ALGO 20
132 /* For a 4096 bit DSS key, empirically determined */ 148 /* For a 4096 bit DSS key, empirically determined */
133 #define MAX_PUBKEY_SIZE 1700 149 #define MAX_PUBKEY_SIZE 1700
134 /* For a 4096 bit DSS key, empirically determined */ 150 /* For a 4096 bit DSS key, empirically determined */
135 #define MAX_PRIVKEY_SIZE 1700 151 #define MAX_PRIVKEY_SIZE 1700
136 152
153 #define MAX_HOSTKEYS 3
154
137 /* The maximum size of the bignum portion of the kexhash buffer */ 155 /* The maximum size of the bignum portion of the kexhash buffer */
138 /* Sect. 8 of the transport rfc 4253, K_S + e + f + K */ 156 /* Sect. 8 of the transport rfc 4253, K_S + e + f + K */
139 #define KEXHASHBUF_MAX_INTS (1700 + 130 + 130 + 130) 157 #define KEXHASHBUF_MAX_INTS (1700 + 130 + 130 + 130)
140 158
141 #define DROPBEAR_MAX_SOCKS 2 /* IPv4, IPv6 are all we'll get for now. Revisit 159 #define DROPBEAR_MAX_SOCKS 2 /* IPv4, IPv6 are all we'll get for now. Revisit
151 #define DROPBEAR_AES 169 #define DROPBEAR_AES
152 #endif 170 #endif
153 171
154 #if defined(DROPBEAR_TWOFISH256) || defined(DROPBEAR_TWOFISH128) 172 #if defined(DROPBEAR_TWOFISH256) || defined(DROPBEAR_TWOFISH128)
155 #define DROPBEAR_TWOFISH 173 #define DROPBEAR_TWOFISH
156 #endif
157
158 #ifdef DROPBEAR_MD5_HMAC
159 #define DROPBEAR_MD5
160 #endif
161
162 #ifdef DROPBEAR_SHA2_256_HMAC
163 #define DROPBEAR_SHA256
164 #endif
165
166 #if (defined(DROPBEAR_DSS) && defined(DSS_PROTOK)) \
167 || defined(DROPBEAR_SHA2_512_HMAC)
168 #define DROPBEAR_SHA512
169 #endif 174 #endif
170 175
171 #ifndef ENABLE_X11FWD 176 #ifndef ENABLE_X11FWD
172 #define DISABLE_X11FWD 177 #define DISABLE_X11FWD
173 #endif 178 #endif