- Revenera Community
- :
- FlexNet Embedded
- :
- FlexNet Embedded Forum
- :
- Re: I want to try out Flexera "Clock Windback Detection"
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
I want to try out Flexera "Clock Windback Detection"
Can someone point me to a good resource where I can get more/complete information about "Clock Windback Detection" and will be good to have some demo, if available.
Thanks in advance 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @anshul-barco ,
Please view the following KB, which should walk you through implementing clock-windback.
https://community.flexera.com/t5/FlexNet-Embedded-Internal/Clock-windback-detection-example/ta-p/827
Best Regards.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
not able to access this URL
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sorry, didn't notice it was not public. Will cut and paste below:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Summary
How can you test clock windback detection?Question
When trying to test the clock windback detection function using the Windows x64 XT FNE 2016.08.1 kit, getting a bit stuck on actually testing an implementation.Here is the setup, assuming today's date is 5-apr-2017:
1. Process a response containing an expiring feature (expiration date is 5-apr-2017)
2. Launch this code sample without changing the system time (system time is 29-march-2017). The feature is successfully acquired
if (FlcErrorCreate(&Error_h))
{
if (GetTrustedStoragePath(pTrustedStoragePath_c))
{
if (FlcLicensingCreate(&Licensing_h, identity_data, sizeof(identity_data), pTrustedStoragePath_c, NULL, Error_h))
{
if (FlcSetCustomHostId(Licensing_h, "HANDEHMDLLGPEHOBBIMOHLMMLPCOHJDPFEKPOMNE", Error_h))
{
if (FlcAddTrustedStorageLicenseSource(Licensing_h, Error_h))
{
FlcClockWindbackDetectionEnable(Licensing_h, 24 * 3600, 0, Error_h);
FlcBool ClockWindbackDetected;
FlcClockWindbackDetected(Licensing_h, &ClockWindbackDetected, Error_h); //forces trusted storage time stamp update
if (FlcAcquireLicense(Licensing_h, &License_h, "testProductA.core", "1.0", Error_h))
{
printf("License acquired");
}
else
{
printf("License not acquired. %s", FlcErrorCodeGetDescription(FlcErrorGetCode(Error_h)));
}
}
}
FlcLicensingDelete(&Licensing_h, NULL);
}
}
FlcErrorDelete(&Error_h);
}
3. Set the system time to a date after the expiration date (ie. 7-apr-2017). Launch the same sample code. The feature is not acquired.
4. Rollback the system time to a date before the expiration date (ie. 4-apr-2017). Launch the same sample code. The feature is surprisingly acquired. I was expecting to get a clock windback detection. Could you explain why the clock windback is not detected? It looks like the time stamp is not updated in the trusted storage during step 3. Is this expected? If so, how can this be successfully tested?
Answer
Is ClockWindback enabled? It is off by default and needs to be enabled:From C XT User Guide:
By default, clock-windback detection is disabled, and an implementer enables it using either the FlcClockWindbackDetectionEnable or the FlcClockWindbackDetectionSetEnabled API . (You can disable clockwindback detection using the FlcClockWindbackDetectionSetEnabled API.)
In the API syntax?
FlcClockWindbackDetectionEnable(FlcLicensingRef licensing,
FlcUInt32 tolerance,
FlcUInt32 frequency,
FlcErrRef error);
Perhaps you can add the call to report the Clock Windback status to confirm.
Additional Information
Assuming you've confirmed Clock Windback is enabled, when testing clock windback with our sample code in the XT kits, you need to try to acquire the license after setting the clock ahead. It does appear that this is the case in the sample here, BUT its also mixing in license expiration. The license had expired when you tried to acquire it in the future. The future timestamp does not get recorded in TS if the feature is not successfully acquired.The ?View? sample we provide in the XT kit explicitly has clock windback enabled, however it alone is not capable of detecting clock windback. If you use the Trials example to load a trial on Jan 1, view it using View on Jan 10th, then set your clock back to Jan 5th there is no windback reported using View. You have to try to acquire the license features in order to ?punch the Trusted Storage clock? with the current date.
So, in this example on Jan 10th you have to run ?Client? to try and acquire the trial license features in order to get the current date into the anchor. After doing so, the View App can detect a clock rollback on Jan 5th (if you add a line to print the status as shown below), however I believe it incorrectly states that the features are actually valid for acquisition.
Windback detected true
==============================================
Features found in trusted storage
*NONE*
==============================================
==============================================
Features found in trial storage
highres 1.0 Jan 31, 2017 20 Hostid=ANY VENDOR_STRING="Hello highres" START="Jan 1, 2017", Valid for acquisition
survey 1.0 Jan 31, 2017 10 Hostid=ANY VENDOR_STRING="Hello survey" START="Jan 1, 2017", Valid for acquisition
==============================================
==============================================
Features found in short-code storage
*NONE*
If you actually try to acquire the features using Client on Jan 5th you will get the expected results:
No license file specified.
Number of features loaded from trusted storage: 0.
Number of features loaded from trial storage: 2.
Unable to acquire survey: Clock windback has been detected
Unable to acquire highres: Clock windback has been detected
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
windback is not detected for me.
Code change I have done:
called method enableWindbackDetection(windbackTolerance, windbackFrequency)
with windbackTolerance=1800, windbackFrequency=0
Background:
I am using flexnetsdk.version 2017.11.0.218710 (Java)
Scenario:
license expiry date: 20 dec 2019
system date and today's date: 17 dec 2019
license processed today on license client (LC)
acquisition working fine, as expected
now if I set system date to 10 dec 2019 (windback), then also I am able to perform acquisition (unexpected)