Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,18 @@ private static SerializedBiscuit deserialize(Schema.Biscuit data)
throw new Error.FormatError.DeserializationError("invalid proof");
}

final Proof proof =
data.getProof().hasFinalSignature()
? new Proof.FinalSignature(data.getProof().getFinalSignature().toByteArray())
: new Proof.NextSecret(
KeyPair.generate(
authority.getKey().getAlgorithm(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, thanks

data.getProof().getNextSecret().toByteArray()));
final Proof proof;
if (data.getProof().hasFinalSignature()) {
proof = new Proof.FinalSignature(data.getProof().getFinalSignature().toByteArray());
} else {
final Schema.PublicKey.Algorithm proofAlgorithm =
blocks.isEmpty()
? authority.getKey().getAlgorithm()
: blocks.get(blocks.size() - 1).getKey().getAlgorithm();
proof =
new Proof.NextSecret(
KeyPair.generate(proofAlgorithm, data.getProof().getNextSecret().toByteArray()));
}

Option<Integer> rootKeyId =
data.hasRootKeyId() ? Option.some(data.getRootKeyId()) : Option.none();
Expand Down