1

OpenPGP in RFC4880 allow to tag signature sub packets as "critical" by setting the high bit 7 in the packet type. I checked a few keys generated with GnuPG2 and all the sub packets are not critical, even for things like "9 - key expiration time".

So I wonder:

  • can I control which packet is marked critical when using GnuPG CLI to create a key signature,
  • are the interoperability issues expected
  • is there an agreement to not use critical for well known (i.e. specified in the RFC) packets?

1 Answer 1

2

The Critical Bit

OpenPGP in RFC4880 allow to tag signature sub packets as "critical" by setting the high bit 7 in the packet type. I checked a few keys generated with GnuPG2 and all the sub packets are not critical, even for things like "9 - key expiration time".

OpenPGP, RFC 4880, 5.2.3.1. Signature Subpacket Specification defines the critical bit. It can be set to inform older implementations of OpenPGP that if they do not understand a subpacket, they should consider the whole signature as invalid.

Bit 7 of the subpacket type is the "critical" bit. If set, it denotes that the subpacket is one that is critical for the evaluator of the signature to recognize. If a subpacket is encountered that is marked critical but is unknown to the evaluating software, the evaluator SHOULD consider the signature to be in error.

So if a new release of OpenPGP defines new kinds of signatures, and a signature is restricted in some way that older implementations will not understand, you could have the newer OpenPGP implementation have the critical bit set to denote "If you don't understand the signature subpacket, consider the whole signature as invalid".

As all those subpackets have been defined at the same time the critical bit was defined, fully-fledged implementations should support those anyway.

Is there an agreement to not use critical for well known (i.e. specified in the RFC) packets?

The RFCs relevant for OpenPGP (especially 4880) do not mention details on when not to use it.

Setting the Critical Bit in GnuPG

Can I control which packet is marked critical when using GnuPG CLI to create a key signature?

man gpg2 shows up some use cases, in which you can set the critical bit for notations and key server/policy URIs by prefixing !:

--sig-keyserver-url string

Use string as a preferred keyserver URL for data signatures. If you prefix it with an exclamation mark (!), the keyserver URL packet will be flagged as critical.

Interoperability

Are the interoperability issues expected?

Well, the critical bit is meant to prevent "broken" interoperability, when an older implementation does not implement important new features. So to some extent, it prevents operability, but at the same time this is why it was set after all.

2
  • I am specifically wondering about setting the expire to critical. But I guess I should better not care.
    – eckes
    Mar 13, 2016 at 18:05
  • 1
    From the GnuPG manual and man page: you can't. The key expiration is saved in a self-signature, so in theory setting the bit should be possible -- but there does not seem to be an option to do so without changing the code.
    – Jens Erat
    Mar 13, 2016 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .