From f5efa9b7f3766cd8d3d128208d3ab560bb89e6b5 Mon Sep 17 00:00:00 2001 From: Pawel Jalocha Date: Sat, 12 Feb 2022 10:33:49 +0000 Subject: [PATCH] Add digital signature as the G-record in IGC files --- main/sdlog.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/sdlog.cpp b/main/sdlog.cpp index 2364866..79389ba 100644 --- a/main/sdlog.cpp +++ b/main/sdlog.cpp @@ -273,10 +273,14 @@ static void IGC_Check(void) // check if { IGC_Log(GPS_Pos[PosIdx]); // log position if(!inFlight) // if no longer in flight { IGC_SHA256.Finish(IGC_Digest); + uint8_t *Sig = (uint8_t *)Line+256; + int SigLen = IGC_SignKey.Sign_MD5_SHA256(Sig, IGC_Digest, IGC_Digest_Size); int Len=0; Line[Len++]='G'; // produce G-record with SH256 - for(int Idx=0; Idx