[Bug 1969118] Re: Certificate viewer shows extra bytes for RSA keys

2022-04-22 Thread Mikko Rantalainen
OK, I agree that this is not a security problem but UI issue only.

However, note that the UI says "Public key" and before that "Key
algorithm: RSA". As such, the public key should not have any extra bytes
at the start or at the end, just the public RSA 2048 bit key as is (as
desribed by "Key Algorithm" and "Key Size" fields immediately above).

Also note that the key displayed by gcr-viewer does not match key value
displayed by `openssl x509 -in ... -text`, Google Chrome, nor Firefox.
Is this also by design?

That said, I agree that gcr-viewer doesn't show the exponent separate
from the modulus either so maybe the easiest fix would be to change the
label "Public Key" to say "DER Encoded Public Key" to make it obvious
that user must decode the encoding of the key by themselves. When I'm
viewing PEM encoded key I sure didn't expect to see the public key as
DER encoded raw data.

A better fix would be to render modulus and exponent as separate fields
without any extra bytes. Of course, that would require different code
paths for e.g. RSA and x25519.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1969118

Title:
  Certificate viewer shows extra bytes for RSA keys

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcr/+bug/1969118/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1969118] Re: Certificate viewer shows extra bytes for RSA keys

2022-04-19 Thread Seth Arnold
Hello Mikko, thanks for the report; I believe that's working as
intended, those bytes are part of the DER encoding; there's an excellent
answer at https://crypto.stackexchange.com/a/19982/1400 that describes
the meanings of each of those bytes.

Thanks

** Information type changed from Private Security to Public Security

** Changed in: gcr (Ubuntu)
   Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1969118

Title:
  Certificate viewer shows extra bytes for RSA keys

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcr/+bug/1969118/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs