File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,18 @@ func IsInitialized() bool {
5959// we use a notInitializedCipher to always return error.
6060type notInitializedCipher struct {}
6161
62+ const secretKeyNotInitializedError = `secret key not initialized. To enable encryption:
63+ 1. Create a file containing a 32-byte (64-character) hexadecimal AES-256 secret key.
64+ 2. Set 'secret-key-path' in DM-master's configuration file to point to this key file.
65+ 3. Restart DM-master to apply the configuration.
66+ For details, see: https://docs.pingcap.com/tidb/stable/dm-customized-secret-key`
67+
6268func (n * notInitializedCipher ) Encrypt ([]byte ) ([]byte , error ) {
63- return nil , errors .New ("secret key is not initialized" )
69+ return nil , errors .New (secretKeyNotInitializedError )
6470}
6571
6672func (n * notInitializedCipher ) Decrypt ([]byte ) ([]byte , error ) {
67- return nil , errors .New ("secret key is not initialized" )
73+ return nil , errors .New (secretKeyNotInitializedError )
6874}
6975
7076type aesCipher struct {
Original file line number Diff line number Diff line change @@ -503,7 +503,7 @@ function run() {
503503 check_rpc_alive $cur /../bin/check_master_online 127.0.0.1:$MASTER_PORT
504504 run_dm_ctl_cmd_mode $WORK_DIR " 127.0.0.1:$MASTER_PORT " \
505505 " encrypt a" \
506- " secret key is not initialized" 1
506+ " secret key not initialized" 1
507507}
508508
509509cleanup_data dmctl
You can’t perform that action at this time.
0 commit comments