Skip to content

Commit 11ece1d

Browse files
thebenternCopilot
andauthored
Update Meshtastic/Crypto/PKIEncryption.cs
Co-authored-by: Copilot <[email protected]>
1 parent ea9761b commit 11ece1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Meshtastic/Crypto/PKIEncryption.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ private static byte[] GenerateNonce(uint packetId, uint senderNodeId, uint extra
2929
0
3030
];
3131

32-
public static void Decrypt(byte[] recipientPrivateKey, byte[] senderPublicKey, MeshPacket meshPacket)
32+
public static bool Decrypt(byte[] recipientPrivateKey, byte[] senderPublicKey, MeshPacket meshPacket)
3333
{
34-
if (meshPacket.Encrypted == null || meshPacket.Encrypted.Length == 0) return;
34+
if (meshPacket.Encrypted == null || meshPacket.Encrypted.Length == 0) return false;
3535
var encryptedData = meshPacket.Encrypted.ToByteArray();
3636
var decrypted = Decrypt(recipientPrivateKey, senderPublicKey, encryptedData, meshPacket.Id, meshPacket.From);
3737
var data = Protobufs.Data.Parser.ParseFrom(decrypted);
3838
meshPacket.Decoded = data;
39+
return true;
3940
}
4041

4142
public static byte[] Decrypt(byte[] recipientPrivateKey, byte[] senderPublicKey, byte[] encryptedData, uint packetId, uint senderNodeId)

0 commit comments

Comments
 (0)