rnp
rnp copied to clipboard
Make one-pass signature reading more relaxed.
Description
Currently if we have multiple one-pass signatures we stop on the first one with nested=1
. This results in the following messages in the log:
[signed_read_single_signature() /Users/nickolay/Ribose/rnp/src/librepgp/stream-parse.cpp:956] failed to read signature packet header
[signed_read_signatures() /Users/nickolay/Ribose/rnp/src/librepgp/stream-parse.cpp:1027] Warning: premature end of signatures
[signed_src_finish() /Users/nickolay/Ribose/rnp/src/librepgp/stream-parse.cpp:1057] warning: unexpected data on the stream end
However, GnuPG allows such case, so we should also change our behaviour (maybe issuing just a single warning). The main usecase for this is multiple-user signing of the document/re-signing of the documents.
Additionally, we may check whether document is already signed (includes one-pass signature packets at the beginning), and update their nested field (one-pass signature packet is not hashed).