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

Cherry-pick key managed encryption patches #279

Merged
merged 7 commits into from
May 12, 2022

Conversation

tabokie
Copy link
Member

@tabokie tabokie commented May 10, 2022

Ref #277

Cherry-pick the following commits:

Adapted for the following changes:

  • NewEncryptedEnv now accepts shared pointer
  • New abstract interface AddCipher
  • Modified abstract interfaces Name and GetPrefixLength
  • New class method ToString hides global function
  • RandomHumanReadableString is replaced with HumanReadableString
  • NormalizingEnvWrapper is removed
  • CI now runs db_test, and SnapshotFiles is failing due to 5d559f0, some other tests are failing because TestKeyManager is not thread-safe

Signed-off-by: tabokie xy.tao@outlook.com

@tabokie tabokie force-pushed the pick-encryption branch 4 times, most recently from 792a417 to 324a3fd Compare May 10, 2022 09:13
@tabokie tabokie mentioned this pull request May 10, 2022
39 tasks
@tabokie tabokie force-pushed the pick-encryption branch 4 times, most recently from 368f8cf to 8df44f2 Compare May 10, 2022 16:15
@tabokie
Copy link
Member Author

tabokie commented May 11, 2022

/test

@tabokie
Copy link
Member Author

tabokie commented May 11, 2022

/run-test

yiwu-arbug and others added 6 commits May 12, 2022 15:55
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 <yiwu@pingcap.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Summary:
Fix missing check for openssl in db_bench.

Test Plan:
build without openssl

Signed-off-by: Yi Wu <yiwu@pingcap.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
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 <yiwu@pingcap.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
…ikv#167)

Summary:
Fix NewRandomRWFile and ReuseWritableFile misuse of `GetFile()` and `NewFile()`. See inline comments.

Test Plan:
manual test with tikv

Signed-off-by: Yi Wu <yiwu@pingcap.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
* adjust logic in KeyManagedEncryptedEnv::RenameFile to avoid poweroff

Signed-off-by: Xintao <hunterlxt@live.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: Xintao <hunterlxt@live.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
@tabokie tabokie force-pushed the pick-encryption branch from 8df44f2 to f9370a3 Compare May 12, 2022 07:58
…kv#227)

Signed-off-by: Xintao <hunterlxt@live.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
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