<div dir="ltr"><div dir="ltr">On Tue, Feb 16, 2021 at 4:34 PM Hubert Kario <<a href="mailto:hkario@redhat.com">hkario@redhat.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tuesday, 16 February 2021 15:54:24 CET, Matthias Buehlmann wrote:<br>
> Hello Hubert (sorry, replied to your e-mail address directly before instead<br>
> of the mailing list),<br>
><br>
> thank you for your reply, but I don't think you're correct that timestamp<br>
> tokens expire together with the signing certificate! Timestamp tokens CAN<br>
> stay valid beyond the validity of the signing certificate, otherwise PAdES<br>
> LTV (Long Term Validity) wouldn't make much sense. Check RFC3161<br>
> specification chapter 4.1:<br>
><br>
>       When a TSA shall not be used anymore, but the TSA private key has<br>
>       not been compromised, the authority's certificate SHALL be<br>
>       revoked.  When the reasonCode extension relative to the revoked<br>
>       certificate from the TSA is present in the CRL entry extensions,<br>
>       it SHALL be set either to unspecified (0), affiliationChanged (3),<br>
>       superseded (4) or cessationOfOperation (5).  In that case, at any<br>
>       future time, the tokens signed with the corresponding key will be<br>
>       considered as invalid, but tokens generated before the revocation<br>
>       time will remain valid.  When the reasonCode extension relative to<br>
>       the revoked certificate from the TSA is not present in the CRL<br>
>       entry extensions, then all the tokens that have been signed with<br>
>       the corresponding key SHALL be considered as invalid.  For that<br>
>       reason, it is recommended to use the reasonCode extension.<br>
<br>
not necessarily, it does not talk about the notAfter date at all, only <br>
about<br>
"not used anymore", that may (and actually should) happen at least a year <br>
before<br>
notAfter date<br></blockquote><div><br></div><div>That's correct, the entire specification (unfortunately) doesn't explicitly mention notAfter/notBefore/expiration, but since this paragraph shows that while revocation invalidates a certificate this doesn't necessarily invalidate already issued token, this therefore means that one also can't assume that expiry of the certificate (which is another form of invalidation) would dictate invalidation of the already issued token.</div><div><br></div><div>Cryptographically it makes sense that timestamps in issued token can be trusted so long as one can trust:</div><div>1. the self-signed RootCA</div><div>2. that the hashing algorithm used for the digest in the token is still cryptographically secure</div><div>3. that the key-length and algorithm of the signatures in the trust chain are still cryptographically secure</div><div>4. that none of the private keys in the trust chain have been compromised</div><div>5. that the issuing certificate was valid at the time of timestamping</div><div><br></div><div>If these things can be trusted, then it's not possible that the token was forged.</div><div>Point 1 is an a-priori choice</div><div>Points 2 & 3 boil down to the mentioned cryptographic "lifetime" and depend on current policy at the time of evaluation.</div><div>Point 4 is a crucial one. If I have a copy of currently valid CRLs for all certificates in the chain and none of them shows that a key was compromised, then I can trust in this point. My question is whether there is any way of also trusting that no keys have been leaked if one doesn't have CRLs that are valid at the time of validation (for example, if one would have an older CRL that is not valid anymore but which shows that the certificate has been revoked for one of the accepted reasons, can one then also safely assume that the key hasn't been leaked at a later date? Is there for example a way one can establish trust that a private key has been properly destroyed in such a revocation scenario?).</div><div>For Point 5 one needs CRLs or OSCPs of the time of timestamping (or, as you point out correctly, maybe better of a day later - however AFAIK a rfc5280 CRL is not timestamped beyond the notBefore-notAfter validity period, so one couldn't say when these CRLs were obtained anyway other than by relying on the timestamp of the token that one wants to verify). Is it even possible to validate a token without having historic CRLs or OSCPs that were valid at the time of timestamping? (because any of the certificates in the chain may have been in "Hold" status (or can this be ignored since any "Hold" status that does not turn into a "Revoked" status can be ignored for token validity?)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
but the details I remember may be from Qualified Signature requirements, <br>
not<br>
the IETF standards<br>
<br>
I do know that the BSI has a different policy still, so you need to know <br>
under<br>
which policy you need to perform the verification<br>
<br>
> Chapter 4.3 DOES talk about key lifetime and renewing trust in issued<br>
> tokens by restamping, however the term "lifetime" used here is in relation<br>
> to key-length (longer key-length = longer lifetime, finite key-length =<br>
> finite lifetime), NOT validity period of TSA certificate:<br>
><br>
>       The TSA signing key MUST be of a sufficient length to allow for a<br>
>       sufficiently long lifetime.  Even if this is done, the key will<br>
>       have a finite lifetime.  Thus, any token signed by the TSA SHOULD<br>
>       be time-stamped again (if authentic copies of old CRLs are<br>
>       available) or notarized (if they aren't) at a later date to renew<br>
>       the trust that exists in the TSA's signature. time-stamp tokens<br>
>       could also be kept with an Evidence Recording Authority to<br>
>       maintain this trust.<br>
><br>
> It doesn't make sense that a token could retain its validity beyond the<br>
> validity of the TSA certificate in a revocation scenario (when key or CA<br>
> hasn't been compromised) but not in an expiration scenario.<br>
> All TSA certificates I encountered so far have very short lifetimes (1-3<br>
> years). If it was true that tokens would only remain valid within that<br>
> period without being restamped, the whole point of PAdES LTV would be moot.<br>
<br>
the whole problem is that if you trust the date in the timestamp as the <br>
date the timestamp was created, attacker can compromise the TSA key years <br>
after<br>
it was last used and then create timestamps that look like they have been<br>
created while the TSA key was still valid<br></blockquote><div><br></div><div>Correct, that's the problem and that's why I guess the CRLs (historic and current) are crucial. If I have CRLs that are currently valid for all the certificates in the trust chain that show that none of the keys has been compromised (either due to the certificates not being revoked or the revocationCode being one of the accepted ones of chapter 4.1), then I should be able to consider the token being valid since it's not possible that it was forged.</div><div><br></div><div>The question then is whether there's a way to show a token could not have been forged if no currently valid CRLs are available (maybe because they're not issued anymore). For example, if a historic CRL is available, which was valid after the timestamp has been issued but is however not valid anymore at the time of validation, but which shows that the certificate was revoked for one of the accepted revocation reasons, can the token then be considered valid.</div><div><br></div><div>Are there any standardized policy definitions specific to RFC3161 (or RFC5816) validation?</div></div></div>