V6 key test vector with S2K usage octet 255 contains S2K length counter
The test vector "V6 key encrypted with MalleableCFB Key derived using Iterated and Salted S2K" from the test suites "Encrypted keys" section (https://tests.sequoia-pgp.org/#Encrypted_keys) appears to be malformed.
RFC9580 states that
Only for a version 6 packet, and if the S2K usage octet was 253 or 254, a 1-octet count of the size of the one field following this octet.
However, in the test vector, the s2k usage octet was 255, yet still an s2k length octet (0x0b) is included.
Imho, the length octet should be removed from the test vector, as otherwise a parser error might obfuscate misbehaviour of the implementation. E.g. PGPainless/Bouncycastle errored out on an "invalid S2K type 11" while interpreting the length octet as S2K type.
Edited by vanitasvitae