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

Return folder with verified certificates #96

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jannejy
Copy link

@jannejy jannejy commented Oct 30, 2024

Describe your changes

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@jannejy
Copy link
Author

jannejy commented Oct 31, 2024

PR in libocpp: EVerest/libocpp#852

@AssemblyJohn
Copy link
Collaborator

This doesn't look good to me. The behavior has been changed to only return the directory in which the bundle of roots is located. This will break all existing usage that depend on the file that contains the latest valid root, since not everyone is using directories.

If one requires the directory in which the bundle is located, it can be extracted from the returned path, for example:
std::filesystem::path directory_of_bundle = std::filesystem::path(certificate_single).parent_path();

Modifying code from existing functionality is never advised.

However, if a separate function that is clear and returns the location instead the bundle file is required, then it's better to create a new one in order to preserve backwards compatibility.

@jannejy
Copy link
Author

jannejy commented Nov 18, 2024

This doesn't look good to me. The behavior has been changed to only return the directory in which the bundle of roots is located. This will break all existing usage that depend on the file that contains the latest valid root, since not everyone is using directories.

Actually, not only directory, that is also checked in the tests here.

Modifying code from existing functionality is never advised.

However, if a separate function that is clear and returns the location instead the bundle file is required, then it's better to create a new one in order to preserve backwards compatibility.

Anyway, I agree, that the changing of the interface is anot good idea. I'll add the implementaion for the location (as well as files as directories).

@jannejy jannejy force-pushed the support_folder_of_root_certificates branch from e202fa3 to cf7e810 Compare November 18, 2024 16:28
@jannejy jannejy force-pushed the support_folder_of_root_certificates branch from cf7e810 to d8d064a Compare November 18, 2024 16:31
@AssemblyJohn
Copy link
Collaborator

Now it looks good, however make sure that in libocpp code, you are handling both the case of a directory and of a bundle file.

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

Successfully merging this pull request may close these issues.

2 participants