Skip to content
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

Max cert length still too small #20

Open
jmwilson opened this issue Nov 16, 2014 · 3 comments
Open

Max cert length still too small #20

jmwilson opened this issue Nov 16, 2014 · 3 comments

Comments

@jmwilson
Copy link

I saw that the max buffer size and cert length were increased to:

private static short BUFFER_MAX_LENGTH = 1221;
private static short CERT_MAX_LENGTH = 1216;

It turns out the certificate I want to load is 1345 bytes long.

  1. Is there a reason these numbers were picked?
  2. Could they be increased, and to what limit?
  3. If it's a waste of space for the common case, would it still work if I forked it to increase the size of these two constants for my own use?
@klali
Copy link
Member

klali commented Nov 17, 2014

The limit we run into is the amount of RAM available to store the incoming cert in before writing to storage. Fixing this to support even larger cert would require some thinking and refactoring.

You're welcome to play with it and try to get more data in there, remember to change the size in EXTENDED_CAP as well.

@omnihil0
Copy link

Note that an X509v3 certificate using 4096bit RSA keys for the issuer and subject will easily be around 1.9k. Other OpenPGP implementations seem to choose 2k for this size limit. It doesn't seem like 4096bit keys are really fully supported if 4096bit certificates are too large to store.

@tofurky
Copy link

tofurky commented May 28, 2018

i've run into the same issue on a yubikey 4. maybe the applet there shares code with this? anyhow, 1216 bytes seems to be the limit. major bummer as was already mentioned, that is useless for 4096 bit (e.g. self-signed using advertised the "RSA 4096 (PGP)" support) issuers. i have a hard time believing that this is a real hardware limitation on the 4, but rather the applet was used as-is on that card without accommodating the revised chipset's actual capabilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants