AESGCM::decryptContent() and AESGCMKW::unwrapKey() handed the tag taken
from the token to openssl_decrypt() without checking its length. OpenSSL
compares only as many bytes as it is given, so a tag truncated to a single
byte was verified on 8 bits. GCM being a counter mode, the holder of one
valid JWE could flip ciphertext bits and find an accepted one-byte tag
within 256 attempts, getting a modified plaintext accepted as authentic.
Both methods now reject a tag that is not 16 bytes long before calling
OpenSSL, with the same exception as any other authentication failure.
RFC 7518 fixes the tag at 128 bits for A128GCM, A192GCM and A256GCM
(section 5.3) and for the "tag" header parameter of A128GCMKW, A192GCMKW
and A256GCMKW (section 4.7.1.2), so tokens from conforming producers are
not affected.