fix: MarshalRegistryEntry should optionally take pk so it can work both for marshall and signing

This commit is contained in:
Derrick Hammer 2024-03-03 12:52:59 -05:00
parent ad7880edbe
commit 4023d99838
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 1 deletions

View File

@ -123,7 +123,10 @@ func MarshalSignedRegistryEntry(sre SignedRegistryEntry) []byte {
func MarshalRegistryEntry(pk []byte, data []byte, revision uint64) []byte {
var buffer []byte
buffer = append(buffer, byte(types.RecordTypeRegistryEntry))
buffer = append(buffer, pk...)
if pk != nil {
buffer = append(buffer, pk...)
}
revBytes := utils.EncodeEndian(revision, 8)
buffer = append(buffer, revBytes...)