ELC 3
This commit is contained in:
@@ -10,4 +10,4 @@ services:
|
|||||||
- ./lib:/app/lib
|
- ./lib:/app/lib
|
||||||
- ./output:/app/output
|
- ./output:/app/output
|
||||||
- ./src:/app/src
|
- ./src:/app/src
|
||||||
/bin
|
|
||||||
BIN
output/ezlic_drt0_aaaaaaaaaaa.lic
Normal file
BIN
output/ezlic_drt0_aaaaaaaaaaa.lic
Normal file
Binary file not shown.
BIN
output/licenceGenerator
Normal file
BIN
output/licenceGenerator
Normal file
Binary file not shown.
@@ -11,7 +11,7 @@
|
|||||||
/// @param argc
|
/// @param argc
|
||||||
/// @param argv parametry pro generování licence
|
/// @param argv parametry pro generování licence
|
||||||
/// @return
|
/// @return
|
||||||
int main8(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
unordered_map<string, string> arguments = getArguments(argc, argv);
|
unordered_map<string, string> arguments = getArguments(argc, argv);
|
||||||
try
|
try
|
||||||
@@ -26,7 +26,8 @@ int main8(int argc, char *argv[])
|
|||||||
initStructure.licenceType = (int)LicenceType::DRT;
|
initStructure.licenceType = (int)LicenceType::DRT;
|
||||||
initStructure.licenceVersion = 1;
|
initStructure.licenceVersion = 1;
|
||||||
initStructure.licenceIndex = 0;
|
initStructure.licenceIndex = 0;
|
||||||
initStructure.licenceFilePath = "c://_projects//sd_gen//output//"; // cesta k licenčnímu souboru
|
initStructure.licenceFilePath = ""; //c://_projects//sd_gen//output//"; // cesta k licenčnímu souboru
|
||||||
|
initStructure.compatibility = 1;
|
||||||
// initStructure.compatibility = 0; v případě kompatibility 0 či nezadané je výstup defaultní.
|
// initStructure.compatibility = 0; v případě kompatibility 0 či nezadané je výstup defaultní.
|
||||||
// pro ELC 1 LicenceELC1Info je to isValid, pro ELC 2 strukura { int protocolId = -1; int dataPointsCount = 0; }
|
// pro ELC 1 LicenceELC1Info je to isValid, pro ELC 2 strukura { int protocolId = -1; int dataPointsCount = 0; }
|
||||||
initStructure.cid_csd_filePath = ""; // cesta k cidu/csd pro načtení a kontrolu licence
|
initStructure.cid_csd_filePath = ""; // cesta k cidu/csd pro načtení a kontrolu licence
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
/// @param argc
|
/// @param argc
|
||||||
/// @param argv parametry pro generování licence
|
/// @param argv parametry pro generování licence
|
||||||
/// @return
|
/// @return
|
||||||
int main()
|
int main9()
|
||||||
{
|
{
|
||||||
// buffer,850client,104client, 104server, web
|
// buffer,850client,104client, 104server, web
|
||||||
// kouknout na unikatní klíc pro linux (native uid, i openssl neco má)
|
// kouknout na unikatní klíc pro linux (native uid, i openssl neco má)
|
||||||
@@ -20,7 +20,7 @@ int main()
|
|||||||
initStructure.licenceType = (int)LicenceType::DRT;
|
initStructure.licenceType = (int)LicenceType::DRT;
|
||||||
initStructure.licenceVersion = 1;
|
initStructure.licenceVersion = 1;
|
||||||
initStructure.licenceIndex = 0;
|
initStructure.licenceIndex = 0;
|
||||||
initStructure.licenceFilePath = "c://_projects//sd_gen//output//"; // cesta k licenčnímu souboru
|
initStructure.licenceFilePath = ""; //c://_projects//sd_gen//output//"; // cesta k licenčnímu souboru
|
||||||
// initStructure.compatibility = 0; v případě kompatibility 0 či nezadané je výstup defaultní.
|
// initStructure.compatibility = 0; v případě kompatibility 0 či nezadané je výstup defaultní.
|
||||||
// pro ELC 1 LicenceELC1Info je to isValid, pro ELC 2 strukura { int protocolId = -1; int dataPointsCount = 0; }
|
// pro ELC 1 LicenceELC1Info je to isValid, pro ELC 2 strukura { int protocolId = -1; int dataPointsCount = 0; }
|
||||||
initStructure.cid_csd_filePath = ""; // cesta k cidu/csd pro načtení a kontrolu licence
|
initStructure.cid_csd_filePath = ""; // cesta k cidu/csd pro načtení a kontrolu licence
|
||||||
@@ -34,7 +34,7 @@ int main()
|
|||||||
{
|
{
|
||||||
LicenceELC3Item info; // podle ELC a kompatibility určit strukuru (LicenceInfo1, LicenceInfo2, LicenceInfo3)
|
LicenceELC3Item info; // podle ELC a kompatibility určit strukuru (LicenceInfo1, LicenceInfo2, LicenceInfo3)
|
||||||
// if ()
|
// if ()
|
||||||
int protocolId = 4;
|
int protocolId = 7;
|
||||||
|
|
||||||
if (licenceReaderELC3.getLicenceItemInfo(protocolId, &info))
|
if (licenceReaderELC3.getLicenceItemInfo(protocolId, &info))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -468,7 +468,7 @@ std::vector<unsigned char> joinVectors(const std::vector<unsigned char> &vector1
|
|||||||
bool readFile(string fileName, vector<char> &output)
|
bool readFile(string fileName, vector<char> &output)
|
||||||
{
|
{
|
||||||
std::ifstream file(fileName, std::ios::in | std::ios::binary);
|
std::ifstream file(fileName, std::ios::in | std::ios::binary);
|
||||||
|
|
||||||
if (file.is_open() != 1)
|
if (file.is_open() != 1)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ bool LicenceReader::getLicenceItemInfo(int protocolId, void *returnItemStructure
|
|||||||
}
|
}
|
||||||
case ELCType::ELC2:
|
case ELCType::ELC2:
|
||||||
{
|
{
|
||||||
if (!this->licIdentification.licCompatibility) // defaultní kompatibilita
|
if (!this->licIdentification.licCompatibility || licIdentification.licCompatibility == 1) // defaultní kompatibilita
|
||||||
{
|
{
|
||||||
LicenceELC2Item *resultPtr = static_cast<LicenceELC2Item *>(returnItemStructure);
|
LicenceELC2Item *resultPtr = static_cast<LicenceELC2Item *>(returnItemStructure);
|
||||||
resultPtr->protocolId = protocolId;
|
resultPtr->protocolId = protocolId;
|
||||||
@@ -183,8 +183,10 @@ bool LicenceReader::getLicenceItemInfo(int protocolId, void *returnItemStructure
|
|||||||
switch (this->licIdentification.licCompatibility)
|
switch (this->licIdentification.licCompatibility)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
{
|
||||||
// kod pro kompatibilitu 1
|
// kod pro kompatibilitu 1
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
LicenceException((int)GeneralError::CompatibilityTypeNotImplemented, "Kompatibilita není implementována.");
|
LicenceException((int)GeneralError::CompatibilityTypeNotImplemented, "Kompatibilita není implementována.");
|
||||||
break;
|
break;
|
||||||
@@ -194,7 +196,8 @@ bool LicenceReader::getLicenceItemInfo(int protocolId, void *returnItemStructure
|
|||||||
}
|
}
|
||||||
case ELCType::ELC3:
|
case ELCType::ELC3:
|
||||||
{
|
{
|
||||||
if (!this->licIdentification.licCompatibility) // defaultní kompatibilita
|
cout << "komp: " << this->licIdentification.licCompatibility << "\n";
|
||||||
|
if (!this->licIdentification.licCompatibility || licIdentification.licCompatibility == 1) // defaultní kompatibilita
|
||||||
{
|
{
|
||||||
LicenceELC3Item *resultPtr = static_cast<LicenceELC3Item *>(returnItemStructure);
|
LicenceELC3Item *resultPtr = static_cast<LicenceELC3Item *>(returnItemStructure);
|
||||||
resultPtr->protocolId = protocolId;
|
resultPtr->protocolId = protocolId;
|
||||||
@@ -213,8 +216,10 @@ bool LicenceReader::getLicenceItemInfo(int protocolId, void *returnItemStructure
|
|||||||
switch (this->licIdentification.licCompatibility)
|
switch (this->licIdentification.licCompatibility)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
{
|
||||||
// kod pro kompatibilitu 1
|
// kod pro kompatibilitu 1
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
LicenceException((int)GeneralError::CompatibilityTypeNotImplemented, "Kompatibilita není implementována.");
|
LicenceException((int)GeneralError::CompatibilityTypeNotImplemented, "Kompatibilita není implementována.");
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user