Skip to content

Commit b3154dd

Browse files
committed
Move parts of SEMLA.md to other files
1 parent 28a5e71 commit b3154dd

File tree

4 files changed

+304
-311
lines changed

4 files changed

+304
-311
lines changed

Diff for: RationaleMCP/0039/ReadMe.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ different platforms.
2828

2929
## Revisions
3030

31-
| Date | Description |
32-
| --- | --- |
33-
| April 9 – May 4, 2021 | Hubertus Tummescheit, Henrik Tidefelt. 1<sup>st</sup> MCP version converted from Modelon internal documentation to MCP format |
31+
| Version/Date | Changes/Comments | Author |
32+
|--------------------------------|----------------------------------------------------------------------------------------------|--------------------------------------------|
33+
| 0.1, 2015 | Initial version | Jesper Mattsson |
34+
| 0.2, April 9<sup>th</sup> 2021 | Restructuring to separate out requirements and examples as appendices, minor wording updates | Hubertus Tummescheit |
3435

3536

3637
## Contributor License Agreement
@@ -44,6 +45,8 @@ The [rationale](rationale.md) presents the rationale with use cases.
4445

4546
The design, called _SEMLA_ is developed in a [separate document](SEMLA.md), for later incorporation as changesets for the Modelica Specification document.
4647

48+
A [manifest.xml example](manifest-example.md) is also provided.
49+
4750

4851
## Backwards Compatibility
4952

@@ -81,6 +84,7 @@ implementation of this proposal.
8184
## References
8285

8386
- <https://www.openssl.org/>
87+
- TLS 1.2 official specification: <https://tools.ietf.org/html/rfc5246>
8488
- <https://github.com/modelon-community/SEMLA>
8589
- <https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/encryption.html>
8690
- <https://www.modelon.com/leverage-standardized-encryption-and-licensing-for-modelica-libraries/>

Diff for: RationaleMCP/0039/SEMLA.md

-308
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
# SEMLA:<br/>Tool-independent Licensing and Code Encryption of Modelica Libraries
22

3-
## Revision history
4-
5-
| Version | Changes/Comments | Author/Date |
6-
|---------|----------------------------------------------------------------------------------------------|-------------------------------------------------|
7-
| 0.1 | Initial version | Jesper Mattsson, 2015 |
8-
| 0.2 | Restructuring to separate out requirements and examples as appendices, minor wording updates | Hubertus Tummescheit, April 9<sup>th</sup> 2021 |
9-
103
This specification describes a container for distributing Modelica
114
libraries and a protocol for how a Modelica tool should communicate with
125
an executable for licensing and decryption of the library. The following
@@ -437,304 +430,3 @@ and fourth form below:
437430
decimal integer – must fit in a 32-bit signed integer
438431

439432
- &lt;data&gt; = the data, as raw bytes
440-
441-
# References
442-
443-
\[1\] TLS 1.2 official specification:
444-
<https://tools.ietf.org/html/rfc5246>
445-
446-
# Appendix A: Example “manifest.xml” file
447-
448-
This is an example of what the “manifest.xml” file could look like for
449-
an example encrypted library:
450-
451-
&lt;?xml version=*"1.0"* encoding=*"utf-8"*?&gt;
452-
453-
&lt;archive&gt;
454-
455-
&lt;!-- All paths in the file are interpreted as relative to the
456-
directory of the top-level
457-
458-
package (e.g., the path to this file would be ".library/manifest.xml"),
459-
and allows
460-
461-
only forward slashes as directory separators. --&gt;
462-
463-
&lt;manifest version=*"1.0"*/&gt;
464-
465-
&lt;!-- The id attribute is the actual Modelica identifier of the
466-
library. The file attribute
467-
468-
from SMA is no longer needed, as it will always be "package.mo" or
469-
"package.moc"
470-
471-
(and the tool will need the logic of checking for both .mo and .moc
472-
anyway).
473-
474-
The enabled attribute (optional, default value is true) indicates
475-
whether the library
476-
477-
should be enabled/loaded by default. --&gt;
478-
479-
&lt;library id=*"ExampleLib"* enabled=*"true"*&gt;
480-
481-
&lt;!-- Official title of the library (optional) --&gt;
482-
483-
&lt;title&gt;Example Encrypted Library&lt;/title&gt;
484-
485-
&lt;!-- Description (optional) --&gt;
486-
487-
&lt;description&gt;
488-
489-
Dummy library showing directory structure for an encrypted library (with
490-
empty files)
491-
492-
&lt;/description&gt;
493-
494-
&lt;!-- The version of the library. Version information is formatted
495-
according to the
496-
497-
Modelica language specification. The build and date attributes are
498-
optional. --&gt;
499-
500-
&lt;version number=*"1.0"* build=*"1"* date=*"2013-08-04"*/&gt;
501-
502-
&lt;!-- Version of the Modelica language that is used in this library.
503-
--&gt;
504-
505-
&lt;language version=*"3.2"* /&gt;
506-
507-
&lt;!-- Copyright notice (optional)--&gt;
508-
509-
&lt;copyright&gt;
510-
511-
Copyright © 2014, Modelon AB.
512-
513-
&lt;/copyright&gt;
514-
515-
&lt;!-- License information (optional) --&gt;
516-
517-
&lt;license&gt;
518-
519-
Some license information.
520-
521-
&lt;/license&gt;
522-
523-
&lt;!-- Encryption/license check information (only for proprietary
524-
libraries).
525-
526-
If this is present, then the library is encrypted. --&gt;
527-
528-
&lt;encryption&gt;
529-
530-
&lt;!-- Library vendor executable. May be repeated - one for each
531-
supported platform.
532-
533-
path: the path to the executable
534-
535-
platform: the OS/platform to use this executable on, must be unique
536-
among
537-
538-
executable nodes
539-
540-
licensing: if this executable handles licensing (optional, default is
541-
true)
542-
543-
The executable shall be placed under the vendor-specific directory
544-
545-
(i.e. .library/VENDORNAME/). The normal case is that licensing has the
546-
same
547-
548-
value for each executable node, but it is allowed to have different
549-
values
550-
551-
for different platforms. --&gt;
552-
553-
&lt;executable path=*".library/Modelon/vendor.exe"* platform=*"win32"*
554-
licensing=*"true"* /&gt;
555-
556-
&lt;executable path=*".library/Modelon/vendor32"* platform=*"linux32"*
557-
licensing=*"true"* /&gt;
558-
559-
&lt;executable path=*".library/Modelon/vendor64"* platform=*"linux64"*
560-
licensing=*"true"* /&gt;
561-
562-
&lt;/encryption&gt;
563-
564-
&lt;!-- Icon for the library (PNG format) (optional) --&gt;
565-
566-
&lt;icon file=*"Resources/Images/el.png"* /&gt;
567-
568-
&lt;/library&gt;
569-
570-
&lt;!-- Leaving out optional compatibility and dependencies in this
571-
example. --&gt;
572-
573-
&lt;/archive&gt;
574-
575-
# Appendix B: Discussion of Weaknesses
576-
577-
There are several cryptographic keys involved. If someone were to
578-
extract a key from an executable or alter the executable to change the
579-
key, then that would have different consequences depending on what key
580-
it is:
581-
582-
- The private key of the tool
583-
584-
- Finding this key would allow decryption of all libraries that
585-
trust that key. It would be possible to replace the key, but
586-
that would require new releases (or at least new distributable)
587-
of all libraries that trust that tool.
588-
589-
- Altering this key would not be useful for an attacker.
590-
591-
- The private key of the LVE
592-
593-
- It might be possible to eavesdrop on the communication between
594-
tool and LVE with this key. Requires additional study of chosen
595-
crypto scheme to determine. With private key of tool as well, it
596-
is definitely possible (but uninteresting if you have that key).
597-
598-
- The session key
599-
600-
- Generated for each communication session, but could be extracted
601-
for a specific communication by debugging the tool or LVE.
602-
603-
- Finding this would allow eavesdropping on the communication.
604-
605-
- Altering this key is not possible.
606-
607-
- List of public keys that the LVE trusts
608-
609-
- Finding this list would not be useful for an attacker.
610-
611-
- Altering this list would allow adding your own and thus allow
612-
decryption of the library.
613-
614-
- The key/keys used by the LVE to decrypt the library
615-
616-
- Finding this key would allow decrypting the library.
617-
618-
- Altering this key would not be useful for an attacker.
619-
620-
Note that both the public/private key pair in the LVE and the key used
621-
to decrypt the library could be newly generated for each build of the
622-
library distributable.
623-
624-
All of these keys should be protected with some sort of obfuscation of
625-
the object code to make them harder to extract. It would, however, be
626-
impossible to completely protect against such attacks.
627-
628-
In conclusion, the most serious breach would be if an attacker obtained
629-
the private key of the tool, allowing decryption of any library released
630-
for that tool. The current situation is that the same vulnerability
631-
necessarily exists in any tool that supports encrypted libraries.
632-
633-
Since Modelica tools need access to the Modelica source code by the
634-
nature of the language specification, theses weaknesses have been
635-
considered acceptable by all commercial parties that so far have made
636-
use of this feature. The weaknesses are identical to those of
637-
tool-specific encryption schemes.
638-
639-
# Appendix C: Requirements considered for the design of SEMLA
640-
641-
The following requirements for commercial libraries were considered in
642-
the design of this proposal:
643-
644-
## Library Vendor
645-
646-
- Library vendor needs to be able to define which libraries that
647-
should be available on which tools, i.e. explicit encoding of
648-
supported tools. *Yes, through list of trusted keys.*
649-
650-
<!-- -->
651-
652-
- Library vendor needs to be able to enable/disable parts (features)
653-
in any given library based on standardized annotations. *Not
654-
hindered, standard license annotations are used.*
655-
656-
- Library vendor needs to be able to specify visibility of components
657-
based on the standardized annotations. *Not hindered, standard
658-
license annotations are used.*
659-
660-
- The solution should offer a means to check the license for the
661-
library as a whole without parsing the Modelica code. *Yes, optional
662-
alternate licensing mechanism can be used for tools that do not
663-
understand license annotations.*
664-
665-
- Library vendor needs to be able to license/protect external
666-
libraries written in e.g. C and Fortran 77 independently of the
667-
licensing mechanism for the library. *Not affected by this
668-
specification, such checks can be added to the external libraries
669-
themselves.*
670-
671-
- Library vendor needs to be able to make new releases of existing
672-
libraries and release new libraries without any action from the tool
673-
vendor. *Yes, when licensing is supplied by library vendor.*
674-
675-
- Encryption mechanism shall be possible to use with or without the
676-
licensing mechanism of the protocol. *Yes.*
677-
678-
- Encryption mechanism shall ensure protection of library vendor IP.
679-
(In this case, this is defined only as Modelica source code.) *In
680-
part. It is not possible to fulfill this completely, since
681-
everything necessary to decrypt the code must be available to the
682-
client computer. Protection is also limited by what the tool does or
683-
does not expose to the user. Extracting any IP that is not shown by
684-
the tool requires using decompilation and/or debugging tools to
685-
extract cryptographic keys from either the tool or the LVE (see
686-
Weaknesses below). This is similar to the current situation.*
687-
688-
- The solution shall be not be limited to a specific licensing
689-
mechanism. *Yes, license mechanism is not specified. It is required
690-
that feature names are used, but this is also assumed by the
691-
description of licensing annotations in the Modelica language
692-
specification.*
693-
694-
- The protocol shall offer means to with reasonable effort replace
695-
encryption keys, or equivalent, in cases of security breaches. *All
696-
involved keys belonging to library vendors can be switched for any
697-
library release. Changing the key pair used by the tool could be
698-
done by adding a second key pair during a transition period. Library
699-
vendors could then replace the compromised key with the new one in
700-
their list of trusted tools. A tool may have more than one key pair.
701-
For tools that have more than one key pair, the LVE needs to be
702-
restarted in between trying different key pairs.*
703-
704-
## Tool Vendor
705-
706-
- A tool may store all files except Modelica source code on disc in
707-
unencrypted form, e.g., in order to support linking with library
708-
files during compilation. *Yes.*
709-
710-
- The solution shall support standardized mechanisms for
711-
enabling/disabling parts of a library, by means of annotations
712-
defined in the Modelica specification. *Not hindered, standard
713-
license annotations are used.*
714-
715-
- Well documented low-level API for licensing and encryption for easy
716-
integration in applications. *Documented above.*
717-
718-
- Solution shall enable customizations and tailored functionality on
719-
top of the low-level API. *API is fairly generic and uses
720-
file-system model, this enables customizations through special files
721-
or folders.*
722-
723-
- Error messages must be supported by the API. *Yes, error messages
724-
can be passed back to tool.*
725-
726-
- Alternative, tool specific, licensing mechanisms shall not be
727-
prevented by the API. *Yes, license checking is controlled by tool.*
728-
729-
- It shall be possible to store/ship several libraries/top-level
730-
packages in a single file. *Yes.*
731-
732-
## User
733-
734-
- The API shall enable convenient to installation procedures for
735-
libraries. *Possible with tool support, library is distributed as a
736-
single file with a well-defined file extension.*
737-
738-
- Error messages should enable users and support personnel to isolate
739-
errors related to licensing and encryption. *Yes, error messages can
740-
be passed back to tool.*

0 commit comments

Comments
 (0)