-
Notifications
You must be signed in to change notification settings - Fork 143
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
Move public Themis headers to "include" directory #759
Commits on Nov 27, 2020
-
Use new trait order in generated code
Recent release of bindgen 0.56.0 resulted in a change in the order of the derived traits in the generated code. The changelog does not say anything about that, but I doubt this is considered a notable change. However, it breaks our build system which meticulously checks for any changes in the generated code compared to checked in version. It does this so that we don't miss any changes. Well, the CI is going to be using bindgen 0.56.0 from now on, let's use the new trait order as well, whatever it is.
Configuration menu - View commit details
-
Copy full SHA for ce811bc - Browse repository at this point
Copy the full SHA ce811bcView commit details
Commits on Nov 28, 2020
-
Move public Themis headers to "include" directory
As the subject line says, let's move all public Themis and Soter headers into the new top-level directory "include". This is a common structure for C projects to keep public headers separate. That way public API is much more cleanly delineated. Currently, Themis technically exports some private headers with private API which might change in the future. With this new structure it will be more obvious which files you can change without risking to introduce API or ABI incompatibility.
Configuration menu - View commit details
-
Copy full SHA for 60092eb - Browse repository at this point
Copy the full SHA 60092ebView commit details -
Add "include" directory to header search paths
Update Themis Core, AndroidThemis, and Carthage build files to include the new "include" directory into the header search path. Since its structure is the same as the previous "src" directory, no other changes are necessary for compiler to be able to resolve "<themis/themis.h>".
Configuration menu - View commit details
-
Copy full SHA for 51a2d6e - Browse repository at this point
Copy the full SHA 51a2d6eView commit details -
Update CocoaPods spec with header changes
Since CocoaPods is special needs package manager, a separate commit takes care of it. First, just like with other build systems, add the new "include" directory into header search paths. Instruct CocoaPods to tell Xcode. Then add new headers to the "source_files" list so that CocoaPods knows that there are some new project headers and does not delete them (because it deletes everything not explicitly mentioned there). Also add the new headers to the "private_header_files" so that they won't get treated as public headers by default. We don't need to export THemis Core headers in ObjCThemis, but we do need them in the project. With this directory split we don't really need the "header_dir" setting, but we very much do need the "header_mappings_dir" so that CocoaPods does not flatten the header structure. It's vitally important for include path resolution since it's <soter/foo.h> and <themis/bar.h> everywhere in the source code. Note that "header_mappings_dir" must be a common directory of all headers. Well, with the "include" directory being on the top-level, the only common directory we have left is the repository root. So use it. Repeat this for all three subspecs that we have. Reformat as necessary. Don't forget that BoringSSL uses its own source set.
Configuration menu - View commit details
-
Copy full SHA for 0db7ea2 - Browse repository at this point
Copy the full SHA 0db7ea2View commit details -
Update the installation rules to use public headers from "include", not the ones from "src". However, include both in the header lists used by code formatting and static analysis rules.
Configuration menu - View commit details
-
Copy full SHA for 749d64c - Browse repository at this point
Copy the full SHA 749d64cView commit details -
Avoid using private headers in public API
EC keygen interface does not export EC key structure. RSA code should do the same. The header structure for EC and RSA is a bit different due to historical reasons, but both implementation details should be hidden. The <soter/soter_rsa_key.h> header is a private one, it should not be used in public headers. Remove it from <soter/soter_rsa_key_pair_gen.h> and then manually add it in places which expected this header to be transitively included.
Configuration menu - View commit details
-
Copy full SHA for 674f653 - Browse repository at this point
Copy the full SHA 674f653View commit details -
Move Secure Session details to private headers
The TODO says to "probably move this to private headers" and this is exactly what we're doing here. All of these definitions are implementation details of Secure Session and do not belong to the public Themis API. Move them to appropriate internal headers. Also, drop all the swathes of commented unused code from there.
Configuration menu - View commit details
-
Copy full SHA for fdd4daf - Browse repository at this point
Copy the full SHA fdd4dafView commit details -
Update "libthemis-sys" definitions
We need to tell bindgen about new header location in "include". After that, regenerate FFI bindings to clean up all the private API which got finally hidden from public headers.
Configuration menu - View commit details
-
Copy full SHA for 394d45d - Browse repository at this point
Copy the full SHA 394d45dView commit details -
Merge branch 'new-bindgen' into public-headers-2
Pull in this bingden update so that the build gets green.
Configuration menu - View commit details
-
Copy full SHA for 533cf96 - Browse repository at this point
Copy the full SHA 533cf96View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d18b0c - Browse repository at this point
Copy the full SHA 1d18b0cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c6ab232 - Browse repository at this point
Copy the full SHA c6ab232View commit details