diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-03-31 19:32:35 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-04-09 18:42:43 +0200 |
commit | bb1b61b312088ba9f5f2cb606594b6f33c284402 (patch) | |
tree | c5b433d19434e194fb82d2407adbbfee759dfd31 /include/my_aes.h | |
parent | 9ccafffc29526ea30151eb3e62901bfdb77aaf84 (diff) | |
download | mariadb-git-bb1b61b312088ba9f5f2cb606594b6f33c284402.tar.gz |
encryption plugin controls the encryption
* no --encryption-algorithm option anymore
* encrypt/decrypt methods in the encryption plugin
* ecnrypt/decrypt methods in the encryption_km service
* file_km plugin has --file-key-management-encryption-algorithm
* debug_km always uses aes_cbc
* example_km changes between aes_cbc and aes_ecb for different key versions
Diffstat (limited to 'include/my_aes.h')
-rw-r--r-- | include/my_aes.h | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/include/my_aes.h b/include/my_aes.h index 824fa5540ef..b5df86fb5ab 100644 --- a/include/my_aes.h +++ b/include/my_aes.h @@ -24,8 +24,6 @@ #include <my_global.h> -typedef int Crypt_result; - #define AES_OK 0 #define AES_BAD_DATA -1 #define AES_BAD_IV -2 @@ -49,84 +47,6 @@ typedef int Crypt_result; C_MODE_START -/** - Crypt buffer with AES dynamic (defined at startup) encryption algorithm. - - SYNOPSIS - my_aes_encrypt_dynamic() - @param source [in] Pointer to data for encryption - @param source_length [in] Size of encryption data - @param dest [out] Buffer to place encrypted data (must be large enough) - @param dest_length [out] Pointer to size of encrypted data - @param key [in] Key to be used for encryption - @param key_length [in] Length of the key. 16, 24 or 32 - @param iv [in] Iv to be used for encryption - @param iv_length [in] Length of the iv. should be 16. - @param noPadding [in] if set, algorithm specific padding behaviour is used - - Method used defined by calling my_aes_init_dynamic_encrypt() at startup. - - @return - != 0 error - 0 no error -*/ - -typedef int (*my_aes_encrypt_dynamic_type)(const uchar* source, uint32 source_length, - uchar* dest, uint32* dest_length, - const uchar* key, uint8 key_length, - const uchar* iv, uint8 iv_length, - uint noPadding); - -extern MYSQL_PLUGIN_IMPORT my_aes_encrypt_dynamic_type my_aes_encrypt_dynamic; - -/** - AES decryption AES dynamic (defined at startup) encryption algorithm. - - SYNOPSIS - my_aes_decrypt_dynamic() - @param source [in] Pointer to data to decrypt - @param source_length [in] Size of data - @param dest [out] Buffer to place decrypted data (must be large enough) - @param dest_length [out] Pointer to size of decrypted data - @param key [in] Key to be used for decryption - @param key_length [in] Length of the key. 16, 24 or 32 - @param iv [in] Iv to be used for encryption - @param iv_length [in] Length of the iv. should be 16. - @param noPadding [in] if set, algorithm specific padding behaviour is used - - @return - != 0 error - 0 no error - - Method used defined by calling my_aes_init_dynamic_encrypt() at startup. -*/ - -typedef int (*my_aes_decrypt_dynamic_type)(const uchar *source, - uint32 source_length, - uchar *dest, uint32 *dest_length, - const uchar *key, uint8 key_length, - const uchar *iv, uint8 iv_length, - uint noPadding); -extern MYSQL_PLUGIN_IMPORT my_aes_decrypt_dynamic_type my_aes_decrypt_dynamic; - -/** - Initialize dynamic crypt functions -*/ - -enum enum_my_aes_encryption_algorithm -{ - MY_AES_ALGORITHM_NONE, MY_AES_ALGORITHM_ECB, MY_AES_ALGORITHM_CBC, - MY_AES_ALGORITHM_CTR -}; - -my_aes_decrypt_dynamic_type get_aes_decrypt_func(enum enum_my_aes_encryption_algorithm method); -my_aes_encrypt_dynamic_type get_aes_encrypt_func(enum enum_my_aes_encryption_algorithm method); - - -my_bool my_aes_init_dynamic_encrypt(enum enum_my_aes_encryption_algorithm method); - -extern MYSQL_PLUGIN_IMPORT enum enum_my_aes_encryption_algorithm current_aes_dynamic_method; - int my_aes_get_size(int source_length); C_MODE_END |