-
Notifications
You must be signed in to change notification settings - Fork 144
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
support mbedtls as backend #495
Conversation
…ptional (see doc-comment of ptls_aead_context_t)
…s (/usr/local, lib)
…nd still refer to `MBEDTLS_SHA384_C` at least on homebrew
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@huitema Sorry for the delay.
Probably the best way to see the differences would be to run git diff -M10 -w -r cc9364e..7e7d39b
.
But my focus has been to minimize the cost of maintaining another backend. I've moved comments to picotls.h, changed tests so that existing ones will be reused, etc.
Comments below explain some of the big changes that I have made.
ctx->super.do_set_iv = aead_set_iv; | ||
if (is_enc) { | ||
ctx->super.do_encrypt = ptls_aead__do_encrypt; | ||
ctx->super.do_encrypt_v = aead_encrypt_v; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation has been simplified by dropping support for streaming encryption (~init
-> ~update
-> ~final
). We only support ptls_aead_encrypt
and ptls_aead_encrypt_v
.
These changes have led to reduction of states in ptls_mbedtls_aead_context_t
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that something we expect for every AEAD implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one question left: should we write some documentation on how to use MbedTLS? or, should we wait until we have ported the signature and verify functions?
@huitema Thank you for reviews. This PR has been merged.
I think we can add docs to https://github.com/h2o/picotls/wiki now that this PR has been merged. I can see the docs written in two ways. We can expand https://github.com/h2o/picotls/wiki/Using-picotls as it talks about two backends that we have already. Or, we can create a new document dedicated mbedtls backend. I'm fine either ways, but maybe the latter would be simpler and easier to understand? |
Subsumes #485.