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

Add sm4 encryption (#295) #299

Merged
merged 5 commits into from
Jul 12, 2022

Conversation

jiayang-zheng
Copy link

Origin PR #295

Signed-off-by: Jarvis Zheng <jiayang@hust.edu.cn>
Signed-off-by: Jarvis Zheng <jiayang@hust.edu.cn>
Signed-off-by: Jarvis Zheng <jiayang@hust.edu.cn>
Signed-off-by: Jarvis Zheng <jiayang@hust.edu.cn>
@tabokie tabokie changed the title Cherry pick adding sm4 encryption to 6.29.tikv Add sm4 encryption (#295) Jul 11, 2022
Signed-off-by: Jarvis Zheng <jiayang@hust.edu.cn>
@jiayang-zheng jiayang-zheng force-pushed the add_sm4_encryption_6_29 branch from fd405dc to e6e7b40 Compare July 11, 2022 09:37
@jiayang-zheng jiayang-zheng mentioned this pull request Jul 11, 2022
@tabokie tabokie requested a review from Connor1996 July 11, 2022 10:07
Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tabokie tabokie merged commit 4cebfc1 into tikv:6.29.tikv Jul 12, 2022
@ethercflow
Copy link
Member

Hi @jiayang-zheng , I compiled under Centos 8 stream, met a compile problem:

encryption/encryption.cc: In function 'rocksdb::Status rocksdb::encryption::NewAESCTRCipherStream(rocksdb::encryption::EncryptionMethod, const string&, const string&, std::unique_ptr<rocksdb::encryption::AESCTRCipherStream>*)':
encryption/encryption.cc:224:16: error: 'EVP_sm4_ctr' was not declared in this scope
       cipher = EVP_sm4_ctr();
                ^~~~~~~~~~~
encryption/encryption.cc:224:16: note: suggested alternative: 'NID_sm4_ctr'
       cipher = EVP_sm4_ctr();
                ^~~~~~~~~~~
                NID_sm4_ctr

The openssl and openssl-level have been installed, with version is 1.1.1k.

Would you please to see why?

@jiayang-zheng
Copy link
Author

The yum install openssl 1.1.1k should be with the OPENSSL_NO_SM4 flag set.

# ifndef OPENSSL_NO_SM4
const EVP_CIPHER *EVP_sm4_ecb(void);
const EVP_CIPHER *EVP_sm4_cbc(void);
const EVP_CIPHER *EVP_sm4_cfb128(void);
#  define EVP_sm4_cfb EVP_sm4_cfb128
const EVP_CIPHER *EVP_sm4_ofb(void);
const EVP_CIPHER *EVP_sm4_ctr(void);
# endif

Fixed this issue in PR #302 #303
Thanks. @ethercflow

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.

4 participants