-
Notifications
You must be signed in to change notification settings - Fork 58
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
addition of v6 and PQC 23/06 #2126
Conversation
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.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2126 +/- ##
==========================================
- Coverage 83.89% 76.87% -7.02%
==========================================
Files 161 193 +32
Lines 32249 37051 +4802
==========================================
+ Hits 27054 28483 +1429
- Misses 5195 8568 +3373
☔ View full report in Codecov by Sentry. |
I checked the findings of CodeQL. Except for one case, they all refer to lines of commented out code which we had agreed on to leave there as hints on how to complete the algorithm support once it is ready in the backend(s). The remaining one is a false positive about a switch-case block having too few case labels. The result is invalid because apparently CodeQL does not consider the case-block enclosed by an |
@falko-strenzke oss-fuzz uses version 2.16.0 of botan, so probably that header is not installed within current implementation. Given that it is required (as I understand) only for PQC (and/or v6), you may just hide it out via ifdefs. |
correction of key and signature related code based on rnp feedback address some more points of PR reiew address some more points of PR reiew rename parse_v3 and update comments correction of key version handling according to rnp feedback changes to v6 key & sig remove redundant ifdef fix conditional compilation of Botan C++ RNG
addressed various feedback comments
…/eddsa abstraction for the following PQC integration
correction of dilithium based on rnp feedback
correction of kyber based on rnp feedback
conditionally compile RNP_ALGNAME_* macros address some more points of PR review (JRH) corrections of key-gen ui according to rnp feedback SHA3 hash binding for dilithium-exdsa-composite
…and pgp_key_material_t::curve()
manual correction of code formatting that still deviates
update copyright (2)
pqc draft: remove packet hash pqc draft: add ecc pubkey to hashed ecdh key share pqc draft: check AES for v3 PKESK
check SPHINCS+ Botan feature
fix Botan deprecation in kyber code fix build system remove comments reverse ifdefs and config.h inclusion in rnp.h fix false positive in CodeQL
a7e3388
to
89e91a3
Compare
OK, we enclosed the inclusion of the Botan RNG headers with an |
We have now a different CI job failing: Cirrus CI. To the best of my knowledge, this one wasn't failing in status before we corrected the inclusion of the Botan RNG headers. Is this maybe a known problem for this test to occasionally fail? In any case, I cannot force a re-run of this job. P.S.: We had seen this test failing locally on my system some time ago as documented here, but most likely this is not the same cause. Without the logs from the CI it's not possible to say what goes wrong here. And we don't have Cirrus CI in our repo... |
@falko-strenzke Hm, I believed I left a comment, but seems not. Cirrus CI, as well as some other jobs may fail occasionally due to some issue between RNP and GnuPG, which should be fixed at some point. For now restarting job helps :) Okay, it's all green now. |
@ronaldtse @antonsviridenko Could you please review this, as this PR blocks bunch of others? If there any major issues, we can address those via separate PR(s). |
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.
LGTM, thanks! Hope we'll soon get this merged.
This PR is quite big, will try to finish the review tomorrow. |
Yeah, it's big indeed. Thanks! |
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.
It fails to build with Botan version 3.0, it would be nice to have some check that Botan is at least 3.1:
fatal error: botan/sphincsplus.h: No such file or directory
35 | #include <botan/sphincsplus.h>
Now with Botan v3.1.1:
|
Please try to run it against the current master branch of Botan. No released version of Botan can possibly work: alone because KMAC, which is used as the KDF in composite encryption schemes. KMAC was merged into Botan master branch only a few days ago. |
We should add some PQC-related CI runner to avoid such issue in the future. But, this could be done after this PR is merged to not grow it any further. Main thing is that non-PQC CI runs well. |
Is there any other existing implementation of PGP v6 to test against? |
ok, so I've managed to build, now I'm trying to generate some key and it fails to load and display this key on the next run of
|
I can confirm this bug. We'll look into this and ensure that keys with all algorithms can be generated, listed and used via the commandline. |
I fear unfortunately not. We know about some that are working on it, but as far as I know nothing has been released. |
At the moment it would be enough to test against self, as PQC support would be marked as experimental within the upcoming release, and all related functionality (must be) cut out via defines from the already existing functionality. |
fixed missing case in forget_secret_key_fields()
Fixed this now in 737c71f According to our tests, key generation, signing, encrypting, verifying and decrypting through the CLI with unprotected and password protected keys are now all working. |
The pipeline obviously has the usual sporadic Windows / GnuPG. Maybe someone with the required rights can force a re-run. In our own dev repo I now added PQC CLI tests that cover signing/verification encryption/decryption with all the PQC keys types that are available via the CLI tool. However, currently they run unconditionally and thus would fail for the non-PQC build. I don't know what is the best way to make the test execution dependent on the build configuration. Once I can implement that, we could add these tests. Any suggestions? |
Also I want to point out that our v6 support ist not complete. That was not the main target of our endeavours, but we rather implemented v6 only to the degree necessary to support PQC. That is of course including the data formats for encryption and signing. But SKESK with v6 are for instance not supported. See here for some more information about the v6 features that are supported / not supported. |
Thank you @falko-strenzke |
This may be done similarly to the IDEA tests, please see the |
This should not be a problem as v6 is not something required at the moment. |
@antonsviridenko @falko-strenzke Thanks, finally this one is merged so we can continue with incremental changes/updates/fixes. |
In correspondence with our project schedule we'll postpone the implementation of the CLI tests for now. We can still work on testing during the the first quarter of 2024, and latest then we will implement the tests. |
@falko-strenzke Ok, np. I plan to add PQC CI runner at some point, so it could at least basic checks. Do you need anything from our side for your schedule, or everything is fine for now? |
One question that is interesting to us is when you plan to make a new release. This is relevant for us to some degree as in our project we are also creating a Thunderbird version that supports PQC using RNP. |
We still have some things to finish before the release, so unfortunately don't see any exact date yet. Is it critical for your project or you may create Thunderbird version based on some commit from the main branch? P.S. Botan released version 3.2.0, do I correctly assume that it includes all the stuff, required for PQC? |
It is not critical and we can use the main branch for the time being.
Yes. It includes the required features, namely KMAC, Kyber, Dilithium, and SPHINCS+. To be sure, I compiled it and ran the tests and it works. Some Kyber Enum values have been deprecated and give warnings. They are still valid but should be replaced at some point. |
The branch is a mirror of https://github.com/pqc-thunderbird/rnp for the purpose of making a PR to the upstream RNP repo.