polkadot-fellows / RFCs

Proposals for change to standards administered by the Fellowship.
https://polkadot-fellows.github.io/RFCs/
Creative Commons Zero v1.0 Universal
109 stars 47 forks source link

Increase the maximum length of identity PGP fingerprint values from 20 bytes #77

Open ltfschoen opened 4 months ago

davxy commented 4 months ago

PGP key fingerprints are 20 bytes long. If you hex encode 20 bytes obviously you get 40 chars (as 1 byte is encoded in 2 chars).

AFAICT the current implementation is correct as it allows you to put there 20 bytes. In polkadot.js, to insert any data as a raw byte string you need to prefix it with 0x, otherwise is interpreted as a sequence of characters (40 in this case).

Source: I'm using pgp entry for my identity

muelli commented 3 months ago

PGP key fingerprints are 20 bytes long.

note that the upcoming openpgp standard defines "A v6 fingerprint [as] the 256-bit SHA2-256 hash" in section 5.5.4.3. "Version 6 Key ID and Fingerprint" in https://datatracker.ietf.org/doc/draft-ietf-openpgp-crypto-refresh/ which is close to publication.

davxy commented 3 months ago

PGP key fingerprints are 20 bytes long.

note that the upcoming openpgp standard defines "A v6 fingerprint [as] the 256-bit SHA2-256 hash" in section 5.5.4.3. "Version 6 Key ID and Fingerprint" in https://datatracker.ietf.org/doc/draft-ietf-openpgp-crypto-refresh/ which is close to publication.

In that case we eventually need to update the max length to 32 bytes.

BTW, the issue with this RFC is mostly not the proposal to increase the max supported length of the fingerprint. Here the main issue is that there is a bit of confusion between the length in bytes and the length when the bytes are encoded as a hex string e.g. here and here