[CP] support load the soft module to encrypt data

This commit is contained in:
obdev
2023-02-10 08:11:16 +00:00
committed by ob-robot
parent 6525b0514a
commit 63440bd16e
7 changed files with 182 additions and 2 deletions

View File

@ -171,6 +171,32 @@ private:
static const EVP_MD* get_hash_evp_md(const ObHashAlgorithm algo);
};
class ObTdeEncryptEngineLoader {
public:
enum ObEncryptEngineType {
OB_NONE_ENGINE = 0,
OB_INVALID_ENGINE = 1,
OB_AES_ENGINE = 2,
OB_SM4_ENGINE = 3,
OB_MAX_ENGINE
};
static ObTdeEncryptEngineLoader &get_instance();
ObTdeEncryptEngineLoader() {
ssl_init();
MEMSET(tde_engine_, 0, sizeof(ENGINE*)*OB_MAX_ENGINE);
}
~ObTdeEncryptEngineLoader() { destroy(); }
void ssl_init();
void destroy();
int load(const common::ObString& engine);
ObEncryptEngineType get_engine_type(const common::ObString& engine);
ENGINE* get_tde_engine(ObAesOpMode &mode) const;
int reload_config();
private:
bool is_inited_;
ENGINE* tde_engine_[OB_MAX_ENGINE];
};
}//end share
} //end oceanbase
#endif