cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Maintain Borrow compatibility in between different version of client applications

Maintain Borrow compatibility in between different version of client applications

There is a dedicated chapter under "Programming Reference for License File - Based Licensing", Chapter-20 : Mobile Licensing, Topic Name : "Security Issues for License Borrowing", which explains why there is a disconnect in between different version of client applications for borrow cache and how to overcome this.

Brief Detail about the Implementation:

To decrease the likelihood that the local secured borrow data is counterfeited, each time a new version of an application is built, link the application with a newly generated version of lm_new.o (UNIX) or lm_new.obj (Windows) object files. Refer to the Development Environment Guide for suggested methods of generating the object file.


The borrowed license state persists in a borrow-data cache managed by the license server. In the event a license server is stopped and restarted while licenses are borrowed, the restarted license server is refreshed with the contents of the borrow-data cache. This mechanism prevents reuse of currently borrowed licenses. The borrowed license state persists only on the license server from which borrowing is initiated. The persistent state does not transfer to other license servers configured for three-server redundancy.


When a license is borrowed from a license server, the borrow information is recorded in a file/registry on the client side, to be used for subsequent checkouts. This borrow information is encrypted using keys which are automatically generated each time lmnewgen is run when you build the FlexNet Publisher Licensing Toolkit. Each run of lmnewgen generates keys that are different from the previous run for security purposes. However, this means that a borrow record created by one FlexNet Publisher version of the FlexEnabled client will not be readable by another FlexNet version of the same
FlexEnabled client.


For example, if version 1 of your FlexEnabled client is built using FlexNet Publisher v11.15, and version 2 of your product is built using FlexNet Publisher v11.16, then version 2 of your product may not be able to use the borrowed license checked out by version 1 of your product.


This is the default behavior of FlexNet Publisher, which can be overridden by specifying the ‐bfixed option to lmnewgen during the toolkit build. Note that this may make the borrow cache encryption more vulnerable, since a single version of the borrow cache can enable multiple versions of your product.

Important • For -bfixed to work, the LM_A_BORROW_RETURN_BY_VERSION value must be the same across old and new clients. 
For clients in the version range 11.14.0 to 11.15.0, the effective LM_A_BORROW_RETURN_BY_VERSION value was 1, whereas
for clients older than 11.14.0 the effective LM_A_BORROW_RETURN_BY_VERSION value was 0.

Changes to be made in makefile to enable "-bfixed" option: Be advised this has to be done in older as well as the later version of application.

Using the makefile available with the default toolkit, add -bfixed after the lmnewgen.exe target as follows:

lmnewgen.exe $(VENDORNAME) -bfixed -o lm_new.c

That block would now look like the following:

$(LMNEW_OBJ): $(SRCDIR)\lsvendor.c $(SRCDIR)\lm_code.h

lmrand1 -i $(SRCDIR)\lsvendor.c

$(CC) /c $(LMNEW_CFLAGS) -I../h lmcode.c

$(LD) /subsystem:CONSOLE lmnewgen$(SUFFIX).obj lmcode.obj $(ACTSTUB) \

lmgr$(SUFFIX).lib libcrvs$(SUFFIX).lib libsb$(SUFFIX).lib $(XTRALIB1) $(CRT_LIB) /out:lmnewgen.exe

if exist lm_new.c del lm_new.c

lmnewgen.exe $(VENDORNAME) -bfixed -o lm_new.c

$(CC) $(LMNEW_CFLAGS) /Fo$(LMNEW_OBJ) lm_new.c

Then after proceed with the build of both the clients and now, both version of clients should be able to checkout or return the licenses borrowed by each other.

Was this article helpful? Yes No
No ratings
Version history
Revision #:
3 of 3
Last update:
‎May 22, 2020 03:53 AM
Updated by:
 
Contributors