From 2f1fc5ad2030d6e404509a09247b5eeba333b13b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 28 Dec 2020 18:55:24 +0000 Subject: [PATCH] EgtLock : - modifiche per gestire versione VVmm con prime due cifre versione e seconde due mese (esempio 2301). --- KeyProc.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/KeyProc.cpp b/KeyProc.cpp index bd29b9c..d76f675 100644 --- a/KeyProc.cpp +++ b/KeyProc.cpp @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- // EgalTech 2014-2020 //---------------------------------------------------------------------------- -// File : KeyProc.cpp Data : 03.08.20 Versione : 2.2h1 +// File : KeyProc.cpp Data : 26.12.20 Versione : 2.2l1 // Contenuto : Funzioni per la gestione della chiave. // // @@ -9,6 +9,7 @@ // Modifiche : 10.09.14 DS Creazione modulo. // 29.02.16 DS Controllo prodotti con & (and bit a bit). // 12.07.16 DS In recupero opzioni, se chiave ko azzero risultati. +// 26.12.20 DS Gestione versione MMmm (vecchie chiavi convertite). // //---------------------------------------------------------------------------- @@ -27,7 +28,7 @@ using namespace std ; //---------------------------------------------------------------------------- -static const int MIN_DAYS = 18477 ; // giorni al 03/08/2020 dal 1/1/1970 +static const int MIN_DAYS = 18621 ; // giorni al 25/12/2020 dal 1/1/1970 static const int N_STEP = 7 ; //---------------------------------------------------------------------------- @@ -123,11 +124,16 @@ VerifyKey( const string& sKey, int nProd, int nVer, int nLev, if ( ! ReadKey( sKey, sScramKey, nKProd, nKVer, nKLev, nKExpDays, nKOpt1, nKOpt2, nKOptExpDays)) - return KEY_ERR_KEYDECODE ; + return KEY_ERR_KEYDECODE ; + // aggiusto i dati di versione + if ( nVer < 100) + nVer = nVer * 100 + 7 ; + if ( nKVer < 100) + nKVer = nKVer * 100 + 7 ; // verifico dati prodotto if ( ( nProd & nKProd) != nProd) return KEY_ERR_PROD ; - if ( nVer > nKVer) + if ( nVer > nKVer + 100) return KEY_ERR_VER ; if ( nLev > nKLev) return KEY_ERR_LEV ;