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

Feature/e2ee use hardware token secure storage #5877

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Commits on Oct 2, 2024

  1. add support to use PKCS#11 harware token to store certifice for e2ee

    Close #5685
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    71550bf View commit details
    Browse the repository at this point in the history
  2. add support to use PKCS#11 harware token to store certifice for e2ee

    Close #5685
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    386efd0 View commit details
    Browse the repository at this point in the history
  3. temporarily do not check for the certificate fingerprints

    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    7e3f8c9 View commit details
    Browse the repository at this point in the history
  4. libp11 dependency for USB token is really mandatory

    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    99c29d3 View commit details
    Browse the repository at this point in the history
  5. fix compilation by exporting a newly needed function

    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    54ae4ce View commit details
    Browse the repository at this point in the history
  6. improve logs when build with NEXTCLOUD_DEV enabled

    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    8e9d1d0 View commit details
    Browse the repository at this point in the history
  7. better memory management and better logs for end-to-end encryption

    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    4fe61ea View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d8adad6 View commit details
    Browse the repository at this point in the history
  9. ensure sane error handling when trying to setup encryption

    if we cannot encrypt because that is not working or because we lack keys
    and certificate needed to enable the feature makes no difference
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    753456a View commit details
    Browse the repository at this point in the history
  10. clearly indicate in logs which is the selected certificate

    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    8c13f92 View commit details
    Browse the repository at this point in the history
  11. do not claim a certificate migration is needed when it is not the case

    ensure we do not emit a "certificate migration is needed" signal when
    this is not the case
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    2044b7d View commit details
    Browse the repository at this point in the history
  12. clean public API that could be misused in ClientSideEncryptionTokenSe…

    …lector
    
    will prevent access to internal objects not meant for reuse outside
    internal code
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    e7ac22e View commit details
    Browse the repository at this point in the history
  13. improve logs when checking that encryption is working reliably

    better check that PKCS11 keys can be converted to use them
    
    improve logs to be able to get a better insight on crypto operations
    during testing of crypto
    
    improve some API method names
    
    fix some log output that were using teh worng category
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    6eb2eb0 View commit details
    Browse the repository at this point in the history
  14. instead of using PKCS#11 API to get public key, read it from certificate

    should avoid calling a crash prone libp11 API to get public key from
    hardware token
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    1827b07 View commit details
    Browse the repository at this point in the history
  15. upload user certificate after end-to-end init with token storage

    even if the certificate already exists abnd is stored on USB token
    hardware, we need to upload the certificate to allow sharing between
    users
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    cd9a6c3 View commit details
    Browse the repository at this point in the history
  16. remove duplicated confusing encryption helper methods

    should make it clearer what is the code and encryption keys and settings
    in use
    
    should make the code simpler to read and follow
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    c560170 View commit details
    Browse the repository at this point in the history
  17. use the proper certificate when encrypting metadata when sharing

    this used to rely on a QSslKey object to convey the receiving user of a
    shared folder encryption material
    
    because we added CertificateInformation that is more generic and can
    work with USB token hardware stored private keys or pure software keys,
    we want to use that instead of a simple QSslKey
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    11282b2 View commit details
    Browse the repository at this point in the history
  18. fix issues reported by clazy with default configuration

    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    8aecba4 View commit details
    Browse the repository at this point in the history
  19. prevent stack overflow when creating the systray via singleton access

    will fix some automated tests failing due to stack overflow when
    creating `ActivityListModel` instances
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    e4cb2ec View commit details
    Browse the repository at this point in the history
  20. allow to start with an expired certificate: migration will be needed

    I may need to ensure other parts behave as expected in case we can only
    decrypt but not encrypt
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    b51d36d View commit details
    Browse the repository at this point in the history
  21. when discovering certificates: forget previously known ones

    the previous certificates were linked to a now invalid libp11 context
    
    using any of them will lead to troubles
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    1084fe1 View commit details
    Browse the repository at this point in the history
  22. allow on the fly migration of encryption certificate

    if you use a new certificate and access metadata of an older one, we
    pick up this previous certificate to access the metadata
    
    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    b773583 View commit details
    Browse the repository at this point in the history
  23. fix live migration between certificates and improve logs

    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    3c5ab68 View commit details
    Browse the repository at this point in the history
  24. for now remove this assert until we better understand

    Signed-off-by: Matthieu Gallien <[email protected]>
    mgallien committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    8b9f325 View commit details
    Browse the repository at this point in the history