BUG/MEDIUM: jwt: Use only JWT cert tree for jwt_verify
The jwt_verify converter can either used a public key that was already
stored in a dedicated tree built during init that did not require any
lock, or use a certificate loaded in the ckch_store tree. The main issue
in this second case is that we needed to take the ckch_lock during
runtime but this spinlock is also taken during all CLI commands that
modify the certificates (and can last a long time when a lot of chck
instances are rebuilt for instance).
We now store the public keys used by jwt_verify in the JWT certificate
tree for all code paths instead of looking them up in the CKCH tree. We
keep the tree entry in sync when certificates are loaded, replaced,
removed, or when the "jwt" option is toggled through the CLI. In those
cases, the lock on the JWT tree in only taken while the tree gets
updated, during the ckch_store_replace call.
A keyless entry is also created for certificates whose "jwt" option is
disabled so that jwt_verify can still report JWT_VRFY_UNAVAIL_CERT (-7)
instead of JWT_VRFY_UNKNOWN_CERT (-5).
This patch relies on "MINOR: jwt: Add rwlock to jwt_cert_tree". It
fixes the issue described in GitHub #3526 (and raised by some IA models
as well).