Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not possible to specify whether binary or source code export is allowed. #15

Open
niklwors opened this issue Mar 1, 2024 · 4 comments

Comments

@niklwors
Copy link

niklwors commented Mar 1, 2024

SEMLA does not support the license annotation of 18.9.2 to define whether binary or source export is possible.

record License
   String licensee = "" " Optional string to show information about the licensee ";
   String id [:] " Unique machine identifications , e.g.\ MAC addresses ";
   String features [:] = fill ("", 0) " Activated library license features ";
   String startDate = "" " Optional start date in UTCformat YYYY -MM -DD";
   String expirationDate = "" " Optional expiration date in UTCformat YYYY -MM -DD";
   String operations [:] = fill ("", 0) " Library usage conditions ";
end License ;
@axelmartenssonmodelon
Copy link
Contributor

You wrote:

SEMLA does not support the license annotation of 18.9.2 to define whether binary or source export is possible.

If I understand you correctly, what you want to do is to add support in SEMLA for interpreting a license file.
Specifically, the operations annotation: String operations[:] = fill("", 0) "Library usage conditions";
to define whether binary or source export is possible.

A design decision for the default SEMLA implementation is that it does not require the license manager to interpret anything in the Modelica code. It is expected that the Protection annotation is processed by the tool.

For context, here is the relevant section of the spec (https://specification.modelica.org/maint/3.6/annotations.html#licensing).

SEMLA already supports protecting classes using a tool specific license manager.
I do not think it is necessary to also add support in SEMLA for interpreting a license file, assuming that the tool interprets the Protection annotation and license file.

The Library Vendor trusts the tool, and the tool needs to do certain checks to ensure that classess are protected.

@niklwors
Copy link
Author

niklwors commented Mar 7, 2024

But this does not explain how the Modelica tool can know whether it is allowed to export code for a Model in an encrypted library, e.g. a source code FMU. Or how do you think this could be solved?

@niklwors
Copy link
Author

niklwors commented Mar 7, 2024

@axelmartenssonmodelon this is the part of the specification that I meant

The format of the strings used for libraryKey and id are not specified (they are vendor specific). The libraryKey is a secret of the library developer. 
The operations define the usage conditions and the following are default names:
-    "ExportBinary" Binary code generated from the Modelica code of the library can be included in binaries produced by a simulation tool.
-    "ExportSource" Source code generated from the Modelica code of the library can be included in sources produced by a simulation tool.

@axelmartenssonmodelon
Copy link
Contributor

To know whether binary or source code export is allowed, a tool could ask the LVE for the license file.
It is the responsibility of the tool to interpret the license file, from the SEMLA perspective, it is encrypted/decrypted like any other Modelica file.

If this license file is to be used in SEMLA it must have the extension ".mo" (not ".mo_lic" which the example in the Modelica spec has), because it is only files with the ".mo" extension that get encrypted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants