| Summary: | Regression in server-sig-algs offer in 7.4p1 (Deprecation of SHA1 is not being enforced) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Jakub Jelen <jjelen> | ||||
| Component: | ssh | Assignee: | Damien Miller <djm> | ||||
| Status: | CLOSED FIXED | ||||||
| Severity: | enhancement | CC: | djm, dtucker, nunojpg | ||||
| Priority: | P5 | ||||||
| Version: | 7.4p1 | ||||||
| Hardware: | Other | ||||||
| OS: | Linux | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 2647 | ||||||
| Attachments: |
|
||||||
|
Description
Jakub Jelen
2017-02-18 03:13:59 AEDT
add to list for 7.5 Created attachment 2947 [details]
patch
Comment on attachment 2947 [details]
patch
ok, but would it be clearer if that was a bitmask rather than 3 booleans?
I'm the patch author. I agree a bitmask is preferred, but I'm unsure of the names to give the constants. The bools currently are: int certs_only int plain_only int sigonly_also Maybe the constants could be in a additive model as: PLAIN CERTS SIGN (or HASH_EXT?) Patch is applied and will be in OpenSSH 7.5 Although the patch looks reasonable and I considered it as a resolved issue, it is not as the current master (openssh 7.5) still reports:
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,null>
The problem is in the order of the checks in the condition "!include_sigonly && kt->sigonly". With the following patch I can see the correct list offered by the server again:
diff --git a/sshkey.c b/sshkey.c
--- a/sshkey.c
+++ b/sshkey.c
@@ -203,7 +203,7 @@ sshkey_alg_list(int certs_only, int plain_only, int include_sigonly, char sep)
for (kt = keytypes; kt->type != -1; kt++) {
if (kt->name == NULL)
continue;
- if (!include_sigonly && kt->sigonly)
+ if (include_sigonly && !kt->sigonly)
continue;
if ((certs_only && !kt->cert) || (plain_only && kt->cert))
continue;
The correct list:
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
(In reply to Jakub Jelen from comment #6) > Although the patch looks reasonable and I considered it as a > resolved issue, it is not as the current master (openssh 7.5) still > reports: > > debug1: kex_input_ext_info: > server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh- > dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,null> That's AFAIK what it's supposed to be, excepting the "null" at the end of the list - where does that come from? > The correct list: > > debug1: kex_input_ext_info: > server-sig-algs=<rsa-sha2-256,rsa-sha2-512> Doesn't list non-RSA signature algorithms. Per https://tools.ietf.org/html/draft-ietf-curdle-ssh-ext-info-10 : > This extension is sent by the server, and contains a list of public > key algorithms that the server is able to process as part of a > "publickey" authentication request. That doesn't limit the contents to just new signature algorithms. We don't currently provide a knob to disable SHA1 signtures, but feel free to file another bug to request it and I'll try to get it done before 7.6. Though there at least one error in the contents of server-sig-algs: we shouldn't offer ssh-dss when we're unwilling to offer a ssh-dss hostkey (true by default). I'll look at filtering the contents for that. (In reply to Damien Miller from comment #7) > (In reply to Jakub Jelen from comment #6) > > Although the patch looks reasonable and I considered it as a > > resolved issue, it is not as the current master (openssh 7.5) still > > reports: > > > > debug1: kex_input_ext_info: > > server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh- > > dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,null> > > That's AFAIK what it's supposed to be, excepting the "null" at the > end of the list - where does that come from? That is gssapi key exchange. Sorry for confusion. > > The correct list: > > > > debug1: kex_input_ext_info: > > server-sig-algs=<rsa-sha2-256,rsa-sha2-512> > > Doesn't list non-RSA signature algorithms. Per > https://tools.ietf.org/html/draft-ietf-curdle-ssh-ext-info-10 : > > > This extension is sent by the server, and contains a list of public > > key algorithms that the server is able to process as part of a > > "publickey" authentication request. > > That doesn't limit the contents to just new signature algorithms. Ok. So it was a change from the initial implementation. Thanks for a clarification. But I am wondering what is the point of of listing all the algorithms that are already defined by the standard in extension. They are ignored by OpenSSH at least. > We don't currently provide a knob to disable SHA1 signtures, but > feel free to file another bug to request it and I'll try to get it > done before 7.6. I will do if it is the time already (it was not some time ago). > Though there at least one error in the contents of server-sig-algs: we shouldn't offer ssh-dss when we're unwilling to offer a ssh-dss hostkey (true by default). That is one of the thing I things why it is bogus to list all supported pkalgs, when they are already negotiated. Closing again, since it looks like it is correct according to the draft. I will fill separate bugs for the other issues. closing resolved bugs as of 8.6p1 release |