Conversation
18a711f to
37efb24
Compare
4bc1ff2 to
aa6e63e
Compare
|
@willco007 Any comments? |
|
I'm poking at this using the WIP testcase PR (I have an ECDSA userauth testcase coming up). Right now it's causing memory corruption, as it seems you're missing a call to AFAIU all our key support matrix issues are caused by our hostkey support going like this :
Hence, you might be able to crack open the key using our PEM parser, and use the things inside to build the key manually. This SO question seems to imply it's doable. |
👍
Strange, for me it works. But in general you're right. It's missing there. I'll add it.
Only PEM/DER format is supported. I successfully tested userauth and remote command execution with a ecdsa key created as follows: That creates a |
aa6e63e to
668e783
Compare
|
I did
Because the one provided by mbedTLS doesn't handle OpenSSH keys (like the one I generated above), so you're leaving that one the table compatibility-wise. Would you be so kind to PR my repo with a couple of those Hence, we have "a bunch" of pem parsers, one which knows RSA/DSA, one which knows OpenSSH. This one is used by Libgcrypt and WinCNG. OpenSSL uses our OpenSSH parser, but its own for RSA/DSA. mbedTLS uses its own parser exclusively. Do note that I'm trying to grasp how the codebase is architected at the moment, so take what I'm saying with a grain a salt, but I feel that the mbedTLS backend should follow the same logic and go through our parser as well. And then add Arguably, I was misled by the format issue, so if I get one of those keys, I'll give it a try and review. It's one less missing feature after all 😉. |
|
@tiennou @willco007 I've also added support to handle OpenSSL keys. Would be nice if one of you could review my PR. |
97e12d9 to
cda14b2
Compare
|
@katzer the |
tiennou
left a comment
There was a problem hiding this comment.
A few minor review comments, please take the macro stuff with a grain of salt.
AFAICT the mbedTLS backend never supported OpenSSH keys (OPENSSH PRIVATE KEY), the current architecture makes it hard to have consistent support for stuff, so I'm fine with it only supporting ECDSA keys for now.
Done
Now I've implemented it, so lets keep it. |
6225a44 to
75320e9
Compare
8085158 to
2b405c3
Compare
|
@willco007 @tiennou Any chance to see that being merged into master any time soon? |
2b405c3 to
6bc4b0b
Compare
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
0490bfa to
882b8b2
Compare
|
What state are we in with this, it looks ready to be merged, is that correct? |
|
@willco007 Yes |
willco007
left a comment
There was a problem hiding this comment.
I've added a couple comments about additional bounds checking, but otherwise it looks great. Thanks for the PR!
src/mbedtls.c
Outdated
| p += 4; | ||
| *p = 0; | ||
|
|
||
| mbedtls_mpi_write_binary(mpi, p + 1, bytes - 1); |
There was a problem hiding this comment.
also advancing p here, and if bytes is 0 length this could go negative. Same below in the memmove.
b82ae61 to
306a519
Compare
|
This PR is still waiting on bounds checks updates I noted on May 15, thanks. |
306a519 to
d9f4509
Compare
Files: mbedtls.c, mbedtls.h, .travis.yml Notes: This PR adds support for ECDSA for both key exchange and host key algorithms. The following elliptic curves are supported: 256-bit curve defined by FIPS 186-4 and SEC1 384-bit curve defined by FIPS 186-4 and SEC1 521-bit curve defined by FIPS 186-4 and SEC1 Credit: Sebastián Katzer
Files: mbedtls.c, mbedtls.h, .travis.yml Notes: This PR adds support for ECDSA for both key exchange and host key algorithms. The following elliptic curves are supported: 256-bit curve defined by FIPS 186-4 and SEC1 384-bit curve defined by FIPS 186-4 and SEC1 521-bit curve defined by FIPS 186-4 and SEC1 Credit: Sebastián Katzer
This is just a stub to make `_libssh2_mbedtls_ecdsa_new_private` compile. mbedtls 3.6.0 silently deleted its public API `mbedtls_pk_load_file`, which this function relies on. Closes #1349
About
This PR adds support for
ECDSAfor both key exchange and host key algorithms.The following elliptic curves are supported: