1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-22 19:08:00 +01:00

Move finalization of signatures into own method

This commit is contained in:
Paul Schaub 2022-09-07 13:48:59 +02:00
parent bed18dc0ad
commit 31c4570d10
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -67,9 +67,7 @@ public abstract class SignatureInputStream extends FilterInputStream {
final int data = super.read();
final boolean endOfStream = data == -1;
if (endOfStream) {
parseAndCombineSignatures();
verifyOnePassSignatures();
verifyDetachedSignatures();
finalizeSignatures();
} else {
byte b = (byte) data;
updateOnePassSignatures(b);
@ -84,9 +82,7 @@ public abstract class SignatureInputStream extends FilterInputStream {
final boolean endOfStream = read == -1;
if (endOfStream) {
parseAndCombineSignatures();
verifyOnePassSignatures();
verifyDetachedSignatures();
finalizeSignatures();
} else {
updateOnePassSignatures(b, off, read);
updateDetachedSignatures(b, off, read);
@ -94,6 +90,12 @@ public abstract class SignatureInputStream extends FilterInputStream {
return read;
}
private void finalizeSignatures() {
parseAndCombineSignatures();
verifyOnePassSignatures();
verifyDetachedSignatures();
}
public void parseAndCombineSignatures() {
if (objectFactory == null) {
return;