-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ring
0.17 - monitor source crate for warning fixes
#507
Comments
Overall, the changes to Some of the changes to
The obvious (and favored) path forward is to similarly adopt The obvious alternative would be to define I will progress along these lines and submit a PR - all going well. |
What's the size difference of holding a whole X.509 certificate versus just the critical fields? My intuition says it's on the order of 10's of kiB, so it shouldn't be a problem to retain the whole certificate. We just have to retain a handful of them too, correct? I did notice when I tried to compile against the static list of certificates from webpki crate that it add +2MiB to the binary size but I assumed we wouldn't carry that around and instead we'd just cherry pick a few certificates from that list. Basically if the impact is on the order of 10kiB (or even low 100's kiB) I'm not too worried about the size impact. But if we are talking about +2MiB of static data being linked in I should take a closer look. |
Looks like the I'm going to change the title of the issue to reflect that the upgrade is done, but, we need to check in periodically on the ring development and see if the deprecation notices and warnings have been cleaned up from the code base... |
ring
upgrade to 0.17ring
0.17 - monitor source crate for warning fixes
The new TODO:
I think unless something is urgently broken, this is a low-priority task, and we'll keep an eye on |
ring
is now at 0.17, which means we could absorb this if it benefited other efforts in Xous.TL;DR
To facilitate any testing, you may fetch the following branches:
You will need to make sure that the top level
Cargo.toml
patch forring
points to wherever you clonedring-xous
, and then you can build a test image with:cargo xtask app-image --feature simple-tls
@nworbnhoj :
lib/tls
breaks with the latestrustls
API at0.22.2
. Could you please have a look at the API differences and let me know what the estimated effort level would be to upgrade the library?@kotval / @nworbnhoj : moving forward on this depends heavily on if anyone finds their efforts on building Chat clients are held up on our version of
ring
being pinned at0.16
. If either of you say "this would greatly improve the porting process and reduce the effort to make it happen and/or make the chat clients easier to maintain", then, that would be a significant argument to move this forward sooner than later.However, absent any actual demand to move the
ring
API forward, and given that such a forward movement would break some existing libraries, I don't see a compelling reason to finish the forward-port?Details
I took a pass at bringing
ring-xous
to 0.17.7, which can be found here:https://github.com/betrusted-io/ring-xous/tree/0.17.7-merge
The port can do TLS, but there are some problems that prevent this from being merged and moving this forward really depends upon how much we need the latest
rustls
. In particular:tls
library that @nworbnhoj implemented breaks when you upgrade to the latestrustls
. I don't know at what point things broke, but it looks like they did a major refactor in how they handle locally sourced certificates. It's not a "shallow" refactor of API names shuffling around -- looks like they took a good solid whack at that process. This means the stuff in thedanger
module needs a deep cut. I don't know how it all works, so I'd appreciate it if @nworbnhoj could have a look and render an opinion on the effort level.ring
:First, they are using a deprecated method for doing prefixed exports:
The maintainer has a
TODO
to stop doing this, but it is still pending even with the latest code:https://github.com/briansmith/ring/blob/6762d656742d7ea431948356760da28e09292b72/src/arithmetic/montgomery.rs#L134-L136
Second, one function declaration is inconsistent:
The actual implementation is here:
https://github.com/briansmith/ring/blob/6762d656742d7ea431948356760da28e09292b72/crypto/mem.c#L60
And the declaration is here:
https://github.com/briansmith/ring/blob/6762d656742d7ea431948356760da28e09292b72/src/constant_time.rs#L34-L36
The declaration is an actual mismatch with the code in the maintainer's upstream. I think maybe it doesn't create a warning on most targets because this function is monkey-patched to an assembly implementation on most platforms. In fact, in general, a really awful design pattern has crept into
ring
, wherering
uses Rust FFI declarations in one name space, and then they use a series of macros to switch the names to an implementation-dependent, version-dependent external symbol that gets linked into FFI object files; so it really works hard to throw away any semblance of safety guarantees across FFI interfaces that Rust could provide. I guess they are "just really careful" in implementing this stuff.Anyways, this is fixable with a patch to the code -- in practice, I think the mismatch doesn't break anything? but I'd have to think about it.
Because the
tls
lib is broken on the latestrustls
, to do testing I re-introduced therustls
direct test stub in this branch, which you can build using this command line:cargo xtask app-image --feature simple-tls
I am able to do the most trivial TLS handshake with this:
I would hesitate to say "it works" at this point, it's more like "nothing is obviously broken and preventing forward progress". However, I don't want to merge this because I'm not sure if it's worth it right now. To move ahead, I think we have to satisfy two prerequisites:
lib/tls
has to be ported to therustls 0.22.2
API levelchat client
effort is blocked onring 0.17
The text was updated successfully, but these errors were encountered: