-
Notifications
You must be signed in to change notification settings - Fork 791
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 reading keys without User IDs #1144
Comments
Hey 👋 Yes, I think this approach can make sense 👍 Since Also here, please make a PR to the v5 branch? |
Hello again :)
Thanks!
Great, I'll see how the unit tests react to this change :)
Just out of curiosity what's the timeframe for releasing v5? I don't mind waiting a little just wonder if that's a matter of weeks or months :) |
🙃
Unfortunately, probably more months. Ideally speaking, we would like to switch to ECC, AEAD and v5 keys by default in v5. However, AEAD and v5 keys still haven't been released in GPG, so we either have to wait for that, or release without that, neither of which are ideal. |
Since the usecase we have for this doesn't appear to be an urgent one, doing a PR into v5 as Daniel suggested is ok. Thanks for the feedback 👍 |
Isn't possible to use a |
@drzraf even though encryption subkey is used in the process the user preferences (e.g. which symmetric algorithms to use) are stored in User ID signatures. So in general UIDless keys shouldn't be used for encryption (of course there are edge cases like preferences in direct key signatures but this is rarely used). |
@wiktor-k: It's correct that Preferences are stored on the addressed User ID's self signature (or the primary User ID, if the certificate is addressed by its key id or fingerprint), but the RFC is explicit that if the preferences are not found on the User ID, then the implementation should fallback to the direct key signature, from Section 2.3.3:
As such, it is safe to use a certificate without a User ID. Of course, for the certificate to be valid, it has to then have a direct key signature. |
Good point @nwalfield, thanks for clarifying! I guess @twiss would be open for a PR to better align OpenPGP.js with the spec in case you're happy to provide one @drzraf :) |
Closing the ticket as it already has been addressed in #1146. |
I would like to use
openpgp.reformatKey
to fix User ID-less key but unfortunatelyopenpgp.key.readArmored
does the check early and throws if there are no User IDs:I think it would be useful to move the check later, for example to
key.getPrimaryUser()
so that keys without users can be read, inspected and reformatted. A similar approach was used in #1017 where the check was moved to a later stage.If this sounds good I can provide the PR, if not I'm happy to discuss alternative approaches :)
The text was updated successfully, but these errors were encountered: