Discussion:
libssh2 crypto back-ends: need for bignum access
Chris Hanson
2016-11-28 00:37:56 UTC
Permalink
I was wondering if someone who has an understanding of libssh2 crypto back-end implementation could describe why it needs access to the crypto system’s bignum implementation. What I’d like to know specifically is whether this just an implementation artifact (i.e. just how libssh2 happened to be written) or whether this is actually necessary to implement the SSHv2 protocol correctly/securely.

What am I really trying to do? Right now there’s no back-end that can use CommonCrypto on Darwin-based platforms without using internals, because CommonCrypto doesn’t expose its bignum implementation as public API. If there’s a real need to expose this for a correct implementation, I’d like to file a bug with Apple that contains a detailed justification. If there’s not a real need for it, then I might look into what’s needed to wire CommonCrypto up without using its bignum implementation.

-- Chris


_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinf
Peter Stuge
2016-11-28 01:51:38 UTC
Permalink
Post by Chris Hanson
I was wondering if someone who has an understanding of libssh2
crypto back-end implementation could describe why it needs access
to the crypto system’s bignum implementation.
The SSH 2 protocol sends "mpint" values in various messages.

See RFC 4251 5. on bottom of page 8 for the wire format.

The ssh-dss public key format is REQUIRED, and ssh-rsa is RECOMMENDED,
by RFC 4253 6.6. on pages 13-14.

Finally, RFC 4253 8. also uses mpint in the DH key exchange. Search
for SSH_MSG_KEXDH_INIT and SSH_MSG_KEXDH_REPLY.
Post by Chris Hanson
whether this is actually necessary to implement the SSHv2 protocol
correctly/securely.
Yes.
Post by Chris Hanson
If there’s a real need to expose this for a correct implementation,
I’d like to file a bug with Apple that contains a detailed
justification.
Cool. RFC 4251 and 4253 are good references. See also RFC 4419.


//Peter
_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailm
Chris Hanson
2016-11-30 19:35:19 UTC
Permalink
Post by Peter Stuge
Cool. RFC 4251 and 4253 are good references. See also RFC 4419.
Thanks for the details, they’ll be very useful!

-- Chris


_______________________________________________
libssh2-devel https://cool.haxx.se/cgi

Loading...