|
Lines 182-194
proto_spec(const char *spec)
Link Here
|
| 182 |
} |
182 |
} |
| 183 |
|
183 |
|
| 184 |
char * |
184 |
char * |
| 185 |
compat_cipher_proposal(char *cipher_prop) |
185 |
compat_cipher_proposal(char *cipher_prop, u_int compat) |
| 186 |
{ |
186 |
{ |
| 187 |
if (!(datafellows & SSH_BUG_BIGENDIANAES)) |
187 |
char *cp; |
|
|
188 |
|
| 189 |
if (!(compat & SSH_BUG_BIGENDIANAES)) |
| 188 |
return cipher_prop; |
190 |
return cipher_prop; |
| 189 |
debug2("%s: original cipher proposal: %s", __func__, cipher_prop); |
191 |
debug2("%s: original cipher proposal: %s", __func__, cipher_prop); |
| 190 |
if ((cipher_prop = match_filter_blacklist(cipher_prop, "aes*")) == NULL) |
192 |
if ((cp = match_filter_blacklist(cipher_prop, "aes*")) == NULL) |
| 191 |
fatal("match_filter_blacklist failed"); |
193 |
fatal("match_filter_blacklist failed"); |
|
|
194 |
free(cipher_prop); |
| 195 |
cipher_prop = cp; |
| 192 |
debug2("%s: compat cipher proposal: %s", __func__, cipher_prop); |
196 |
debug2("%s: compat cipher proposal: %s", __func__, cipher_prop); |
| 193 |
if (*cipher_prop == '\0') |
197 |
if (*cipher_prop == '\0') |
| 194 |
fatal("No supported ciphers found"); |
198 |
fatal("No supported ciphers found"); |
|
Lines 196-208
compat_cipher_proposal(char *cipher_prop)
Link Here
|
| 196 |
} |
200 |
} |
| 197 |
|
201 |
|
| 198 |
char * |
202 |
char * |
| 199 |
compat_pkalg_proposal(char *pkalg_prop) |
203 |
compat_pkalg_proposal(char *pkalg_prop, u_int compat) |
| 200 |
{ |
204 |
{ |
| 201 |
if (!(datafellows & SSH_BUG_RSASIGMD5)) |
205 |
char *cp; |
|
|
206 |
|
| 207 |
if (!(compat & SSH_BUG_RSASIGMD5)) |
| 202 |
return pkalg_prop; |
208 |
return pkalg_prop; |
| 203 |
debug2("%s: original public key proposal: %s", __func__, pkalg_prop); |
209 |
debug2("%s: original public key proposal: %s", __func__, pkalg_prop); |
| 204 |
if ((pkalg_prop = match_filter_blacklist(pkalg_prop, "ssh-rsa")) == NULL) |
210 |
if ((cp = match_filter_blacklist(pkalg_prop, "ssh-rsa")) == NULL) |
| 205 |
fatal("match_filter_blacklist failed"); |
211 |
fatal("match_filter_blacklist failed"); |
|
|
212 |
free(pkalg_prop); |
| 213 |
pkalg_prop = cp; |
| 206 |
debug2("%s: compat public key proposal: %s", __func__, pkalg_prop); |
214 |
debug2("%s: compat public key proposal: %s", __func__, pkalg_prop); |
| 207 |
if (*pkalg_prop == '\0') |
215 |
if (*pkalg_prop == '\0') |
| 208 |
fatal("No supported PK algorithms found"); |
216 |
fatal("No supported PK algorithms found"); |
|
Lines 210-233
compat_pkalg_proposal(char *pkalg_prop)
Link Here
|
| 210 |
} |
218 |
} |
| 211 |
|
219 |
|
| 212 |
char * |
220 |
char * |
| 213 |
compat_kex_proposal(char *p) |
221 |
compat_kex_proposal(char *kex_prop, u_int compat) |
| 214 |
{ |
222 |
{ |
| 215 |
if ((datafellows & (SSH_BUG_CURVE25519PAD|SSH_OLD_DHGEX)) == 0) |
223 |
char *cp; |
| 216 |
return p; |
224 |
|
| 217 |
debug2("%s: original KEX proposal: %s", __func__, p); |
225 |
if ((compat & (SSH_BUG_CURVE25519PAD|SSH_OLD_DHGEX)) == 0) |
| 218 |
if ((datafellows & SSH_BUG_CURVE25519PAD) != 0) |
226 |
return kex_prop; |
| 219 |
if ((p = match_filter_blacklist(p, |
227 |
debug2("%s: original KEX proposal: %s", __func__, kex_prop); |
|
|
228 |
if ((compat & SSH_BUG_CURVE25519PAD) != 0) { |
| 229 |
if ((cp = match_filter_blacklist(kex_prop, |
| 220 |
"curve25519-sha256@libssh.org")) == NULL) |
230 |
"curve25519-sha256@libssh.org")) == NULL) |
| 221 |
fatal("match_filter_blacklist failed"); |
231 |
fatal("match_filter_blacklist failed"); |
| 222 |
if ((datafellows & SSH_OLD_DHGEX) != 0) { |
232 |
free(kex_prop); |
| 223 |
if ((p = match_filter_blacklist(p, |
233 |
kex_prop = cp; |
|
|
234 |
} |
| 235 |
if ((compat & SSH_OLD_DHGEX) != 0) { |
| 236 |
if ((cp = match_filter_blacklist(kex_prop, |
| 224 |
"diffie-hellman-group-exchange-sha256," |
237 |
"diffie-hellman-group-exchange-sha256," |
| 225 |
"diffie-hellman-group-exchange-sha1")) == NULL) |
238 |
"diffie-hellman-group-exchange-sha1")) == NULL) |
| 226 |
fatal("match_filter_blacklist failed"); |
239 |
fatal("match_filter_blacklist failed"); |
|
|
240 |
free(kex_prop); |
| 241 |
kex_prop = cp; |
| 227 |
} |
242 |
} |
| 228 |
debug2("%s: compat KEX proposal: %s", __func__, p); |
243 |
debug2("%s: compat KEX proposal: %s", __func__, kex_prop); |
| 229 |
if (*p == '\0') |
244 |
if (*kex_prop == '\0') |
| 230 |
fatal("No supported key exchange algorithms found"); |
245 |
fatal("No supported key exchange algorithms found"); |
| 231 |
return p; |
246 |
return kex_prop; |
| 232 |
} |
247 |
} |
| 233 |
|
248 |
|