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

Manage file key by the file to encrypt itself - all changes #3

Closed
wants to merge 42 commits into from

Commits on Aug 1, 2023

  1. remove duplicate comments in EncryptedEnv (facebook#11549) (#1)

    Summary:
    There are some comments on subclasses in EncryptedEnv module which are
    duplicate to their parent classes, it would be nice to remove the
    duplication and keep the consistency if the comments on parent classes
    updated in someday.
    
    Pull Request resolved: facebook#11549
    
    Reviewed By: akankshamahajan15
    
    Differential Revision: D47007061
    
    Pulled By: ajkr
    
    fbshipit-source-id: 8bfdaf9f2418a24ca951c30bb88e90ac861d9016
    acelyc111 authored Aug 1, 2023
    Configuration menu
    Copy the full SHA
    e95d27f View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2023

  1. Add KeyManagedEncryptedEnv and AESBlockCipher (#4)

    apache/incubator-pegasus#1575
    
    Cherry-pick from
    tikv@113b363
    
    Summary:
    Introduce `KeyManagedEncryptedEnv` which wraps around `EncryptedEnv` but
    provides an `KeyManager` API to enable key management per file. Also
    implements `AESBlockCipher` with OpenSSL.
    
    Test Plan:
    not tested yet. will update.
    
    Signed-off-by: Yi Wu <[email protected]>
    Signed-off-by: tabokie <[email protected]>
    acelyc111 authored Aug 7, 2023
    Configuration menu
    Copy the full SHA
    7941b8f View commit details
    Browse the repository at this point in the history
  2. encryption: change to use openssl EVP API (#5)

    apache/incubator-pegasus#1575
    
    Cherry-pick from
    tikv@3d44a33
    
    Summary:
    Instead of using openssl's raw `AES_encrypt` and `AES_decrypt` API,
    which is a low level call to encrypt or decrypt exact one block (16
    bytes), we change to use the `EVP_*` API. The former is deprecated, and
    will use the default C implementation without AES-NI support. Also the
    EVP API is capable of handing CTR mode on its own.
    
    Test Plan:
    will add tests
    
    Signed-off-by: Yi Wu <[email protected]>
    
    ---------
    
    Signed-off-by: Yi Wu <[email protected]>
    Co-authored-by: yiwu-arbug <[email protected]>
    acelyc111 and yiwu-arbug authored Aug 7, 2023
    Configuration menu
    Copy the full SHA
    bcb12d2 View commit details
    Browse the repository at this point in the history
  3. Fix NewRandomRWFile and ReuseWritableFile in KeyManagedEncryptedEnv (#6)

    apache/incubator-pegasus#1575
    
    Cherry-pick from
    tikv@2360562
    
    Summary:
    Fix NewRandomRWFile and ReuseWritableFile misuse of `GetFile()` and
    `NewFile()`. See inline comments.
    
    Test Plan:
    manual test with tikv
    
    Signed-off-by: Yi Wu <[email protected]>
    
    Co-authored-by: yiwu-arbug <[email protected]>
    acelyc111 and yiwu-arbug authored Aug 7, 2023
    Configuration menu
    Copy the full SHA
    0470a0b View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2023

  1. Atomize RenameFile in KeyManagedEncryptedEnv (facebook#7)

    apache/incubator-pegasus#1575
    
    Cherry-pick from
    tikv@93e89a5
    
    fix bug: tikv/tikv#9115
    
    Summary: we need to update encryption metadata via
    encryption::DataKeyManager, which cannot combine with the actual file
    operation into one atomic operation. In RenameFile, when the src_file
    has been removed, power is off, then we may lost the file info of
    src_file next restart.
    
    Signed-off-by: Xintao [[email protected]](mailto:[email protected])
    
    Signed-off-by: Xintao <[email protected]>
    Co-authored-by: Xintao <[email protected]>
    acelyc111 and hunterlxt authored Aug 8, 2023
    Configuration menu
    Copy the full SHA
    243004c View commit details
    Browse the repository at this point in the history
  2. Atomize Rename operation when encryption is enabled (facebook#8)

    apache/incubator-pegasus#1575
    
    Cherry-pick from
    tikv@bbd27cf
    
    used LinkFile instead of RenameFile api of key manager. But LinkFile
    needs check the dst file information, in RenameFile logic, we don't care
    about that. So just skip encryption for current file.
    
    Signed-off-by: Xintao [[email protected]](mailto:[email protected])
    acelyc111 authored Aug 8, 2023
    Configuration menu
    Copy the full SHA
    e84b0b2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    31abef3 View commit details
    Browse the repository at this point in the history
  4. Add sm4 encryption (facebook#10)

    apache/incubator-pegasus#1575
    
    Cherry-pick from
    tikv@4cebfc1
    
    * Add SM4-CTR encryption algorithm
    * Adjust block size for sm4 encryption
    * Add UT for SM4 encryption
    * Adjust macros indentation for sm4
    * Fix format for adding sm4
    
    Signed-off-by: Jarvis Zheng <[email protected]>
    acelyc111 authored Aug 8, 2023
    Configuration menu
    Copy the full SHA
    eff2f56 View commit details
    Browse the repository at this point in the history
  5. Check OPENSSL_NO_SM4 before using sm4 encryption (facebook#11)

    apache/incubator-pegasus#1575
    
    Cherry-pick from
    tikv@9464766
    
    In some env, user installed openssl by yum install, and the openssl
    software may compiled with OPENSSL_NO_SM4 flag, so although the version
    is >= 1.1.1, but we still could not use sm4 in that situation.
    
    Signed-off-by: Jarvis Zheng <[email protected]>
    acelyc111 authored Aug 8, 2023
    Configuration menu
    Copy the full SHA
    0f1574f View commit details
    Browse the repository at this point in the history
  6. hook delete dir in encrypted env (facebook#334) (facebook#12)

    apache/incubator-pegasus#1575
    
    Cherry-pick from
    tikv@acc624f
    
    * hook delete dir in encrypted env
    * add a comment
    
    Signed-off-by: tabokie <[email protected]>
    Co-authored-by: Xinye Tao <[email protected]>
    acelyc111 and tabokie authored Aug 8, 2023
    Configuration menu
    Copy the full SHA
    8ab89e1 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2023

  1. fix renaming encrypted directory (facebook#13)

    apache/incubator-pegasus#1575
    
    Cherry-pick from
    tikv@14f36f8
    (without compaction related code)
    
    * fix renaming encrypted directory
    
    Signed-off-by: tabokie <[email protected]>
    acelyc111 authored Aug 9, 2023
    Configuration menu
    Copy the full SHA
    1d09030 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2023

  1. Configuration menu
    Copy the full SHA
    52eeb27 View commit details
    Browse the repository at this point in the history
  2. 1

    acelyc111 committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    b3d3068 View commit details
    Browse the repository at this point in the history
  3. 2

    acelyc111 committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    5701095 View commit details
    Browse the repository at this point in the history
  4. 3

    acelyc111 committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    339e256 View commit details
    Browse the repository at this point in the history
  5. fmt

    acelyc111 committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    cc41e50 View commit details
    Browse the repository at this point in the history
  6. 5

    acelyc111 committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    54c29fa View commit details
    Browse the repository at this point in the history
  7. clean up

    acelyc111 committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    6dc4ed7 View commit details
    Browse the repository at this point in the history
  8. fix ut

    acelyc111 committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    1885171 View commit details
    Browse the repository at this point in the history
  9. fmt

    acelyc111 committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    ca5ab98 View commit details
    Browse the repository at this point in the history
  10. more

    acelyc111 committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    d8723d5 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2023

  1. 1

    acelyc111 committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    d231f58 View commit details
    Browse the repository at this point in the history
  2. 1

    acelyc111 committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    10e12a1 View commit details
    Browse the repository at this point in the history
  3. ut

    acelyc111 committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    f67739c View commit details
    Browse the repository at this point in the history
  4. 1

    acelyc111 committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    ee35f7b View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2023

  1. provider

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    4e41bb6 View commit details
    Browse the repository at this point in the history
  2. revert

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    3fdc497 View commit details
    Browse the repository at this point in the history
  3. 2

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    caebbee View commit details
    Browse the repository at this point in the history
  4. 3

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    ea2bb71 View commit details
    Browse the repository at this point in the history
  5. 4

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    6578331 View commit details
    Browse the repository at this point in the history
  6. 5

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    112a13d View commit details
    Browse the repository at this point in the history
  7. 6

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    c895d1c View commit details
    Browse the repository at this point in the history
  8. 6

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    3630a6d View commit details
    Browse the repository at this point in the history
  9. 7

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    4933ea4 View commit details
    Browse the repository at this point in the history
  10. 8

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    519e053 View commit details
    Browse the repository at this point in the history
  11. from string

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    496e3c1 View commit details
    Browse the repository at this point in the history
  12. 11

    acelyc111 committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    d1982e5 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2023

  1. env/env_basic_test.cc

    acelyc111 committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    623c4ba View commit details
    Browse the repository at this point in the history
  2. 12

    acelyc111 committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    c526ad4 View commit details
    Browse the repository at this point in the history
  3. encryption_test

    acelyc111 committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    6fe322d View commit details
    Browse the repository at this point in the history
  4. ut

    acelyc111 committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    510c34b View commit details
    Browse the repository at this point in the history
  5. add comments

    acelyc111 committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    629ff24 View commit details
    Browse the repository at this point in the history