From 07dc008a3197f03486d428e385dacab6e51b6ad3 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Thu, 1 Jan 2026 00:59:20 -0600 Subject: [PATCH] refactor: update Identity methods to use common package for Msgpack serialization --- pkg/identity/identity.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/identity/identity.go b/pkg/identity/identity.go index fa87cfb..c0903c1 100644 --- a/pkg/identity/identity.go +++ b/pkg/identity/identity.go @@ -20,7 +20,6 @@ import ( "git.quad4.io/Networks/Reticulum-Go/pkg/common" "git.quad4.io/Networks/Reticulum-Go/pkg/cryptography" "git.quad4.io/Networks/Reticulum-Go/pkg/debug" - "github.com/vmihailenco/msgpack/v5" "golang.org/x/crypto/curve25519" "golang.org/x/crypto/hkdf" ) @@ -672,7 +671,7 @@ func (i *Identity) saveRatchets(path string) error { } // Pack ratchets using msgpack - packedRatchets, err := msgpack.Marshal(ratchetList) + packedRatchets, err := common.MsgpackMarshal(ratchetList) if err != nil { return fmt.Errorf("failed to pack ratchets: %w", err) } @@ -687,7 +686,7 @@ func (i *Identity) saveRatchets(path string) error { } // Pack the entire structure - finalData, err := msgpack.Marshal(persistedData) + finalData, err := common.MsgpackMarshal(persistedData) if err != nil { return fmt.Errorf("failed to pack ratchet data: %w", err) } @@ -800,7 +799,7 @@ func (i *Identity) loadRatchets(path string) error { // Unpack outer structure: {"signature": ..., "ratchets": ...} var persistedData map[string][]byte - if err := msgpack.Unmarshal(fileData, &persistedData); err != nil { + if err := common.MsgpackUnmarshal(fileData, &persistedData); err != nil { return fmt.Errorf("failed to unpack ratchet data: %w", err) } @@ -818,7 +817,7 @@ func (i *Identity) loadRatchets(path string) error { // Unpack ratchet list var ratchetList [][]byte - if err := msgpack.Unmarshal(packedRatchets, &ratchetList); err != nil { + if err := common.MsgpackUnmarshal(packedRatchets, &ratchetList); err != nil { return fmt.Errorf("failed to unpack ratchet list: %w", err) }