Skip to content

Commit

Permalink
additional fix on the serialization of SignedProtoMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Leitao committed Mar 6, 2023
1 parent 7761287 commit 7f86a70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void serialize(T msg, ByteBuf out) throws IOException {
ByteBuf serial = Unpooled.buffer();
serial.writeShort(msg.getId());
this.serializeBody(msg, serial);
msg.serializedMessage = ByteBufUtil.getBytes(serial);
msg.serializedMessage = ByteBufUtil.getBytes(serial.slice());
}

out.writeInt(msg.serializedMessage.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public final void signMessage(PrivateKey key) throws NoSuchAlgorithmException, I
"\nVerify that the serializer exists and is returned by the method getSerializer()");
} else {
ByteBuf b = Unpooled.buffer();
b.writeShort(this.getId());
serializer.serializeBody(this, b);
this.serializedMessage = ByteBufUtil.getBytes(b.slice());
}
Expand Down

0 comments on commit 7f86a70

Please sign in to comment.