-
Notifications
You must be signed in to change notification settings - Fork 29
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
Allow supplying Sa/Key/Mc interfaces that have not been compiled with CryptoLib #257
Allow supplying Sa/Key/Mc interfaces that have not been compiled with CryptoLib #257
Conversation
This allows consumers of the library to supply their own implementation of these interfaces without having to either 1. Have a project structure that puts cryptolib as a top level git submodoule with a top level sa / key / mc directory 2. Modify the CryptoLib source code
(I'll send the signed CLA shortly) |
Can confirm receipt of CLA! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #257 +/- ##
=======================================
Coverage 82.68% 82.69%
=======================================
Files 40 40
Lines 10026 10029 +3
Branches 814 817 +3
=======================================
+ Hits 8290 8293 +3
Misses 1437 1437
Partials 299 299 ☔ View full report in Codecov by Sentry. |
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.
Looks good to me! Hadn't tested outside the project yet, thanks for the PR!
@williamposey: Would you mind looking over this quickly? Wanted to make sure you saw this upcoming change before we merged it in. |
Hey @rjbrown2 I just got back from vacation today, I will try and look things over by EOD! |
I like the approach of decoupling the library from the various interfaces. I have a few questions/concerns:
|
I think the code exists now to check that something has been initialized or one of the default configurations used. It'll error out otherwise if you built it assuming a custom interface then don't perform that init step for it as you make your calls.
As it's not really determined at runtime now sure this is needed. |
I think it makes sense to move this PR ahead and a follow up issue can address additional changes. I'll approve now |
Currently, the process for supplying a mission specific custom interface is to include CryptoLib as a git submodule, provide an e.g.
sa/sa_custom/sa_custom.c
next to the submodule and let CryptoLib compile it and initialize it inCrypto_Init()
. This approach has some drawbacks:With the proposed change, projects will be able to do e.g.
sa_if = &project_sa_if;
before callingCrypto_Init()
while the behaviour will be unchanged for library consumers that do not modify the interface pointers themselves.