Commit graph

15 commits

Author SHA1 Message Date
Sergei Golubchik
61fd38a1de update plugin maturities 2016-09-05 17:11:14 +02:00
Sergei Golubchik
3fdc6140a3 update plugins' maturity levels 2016-03-18 22:05:23 +01:00
Sergei Golubchik
c4e336e01e fix the encryption.filekeys_nofile test
and move the error reporting where it belongs
2015-10-10 14:19:02 +02:00
Monty
602c803bd9 Don't enable file_key_management_plugin by default (as this gives warnings in the log)
Better warning from file_key_management plugin if filename is not given
2015-10-09 13:02:55 +03:00
Sergei Golubchik
66b9a9409c New encryption API. Piece-wise encryption.
Instead of encrypt(src, dst, key, iv) that encrypts all
data in one go, now we have encrypt_init(key,iv),
encrypt_update(src,dst), and encrypt_finish(dst).

This also causes collateral changes in the internal my_crypt.cc
encryption functions and in the encryption service.

There are wrappers to provide the old all-at-once encryption
functionality. But binlog events are often written piecewise,
they'll need the new api.
2015-09-04 10:33:50 +02:00
Sergei Golubchik
51d67633ef AES-GCM support in file_key_management plugin 2015-06-02 19:00:23 +02:00
Sergei Golubchik
487e5f4590 file_key_management plugin: complain if key id 1 is not found
and don't recommend aes_ctr if it's unavailable
2015-06-02 19:00:23 +02:00
Sergei Golubchik
acd992d4b7 MDEV-8022 Assertion `rc == 0' failed in ma_encrypt on dropping an encrypted Aria table
fix encryption of the last partial block

* now really encrypt it, using key and iv
* support the case of very short plaintext (less than one block)
* recommend aes_ctr over aes_cbc, because the former
  doesn't have problems with partial blocks
2015-05-13 14:27:17 +02:00
Sergei Golubchik
97d5de4ccf Add encryption key id to the API as a distinct concept
which is separate from the encryption key version
2015-04-09 19:35:40 +02:00
Sergei Golubchik
65e7826070 renames to follow single consistent naming style
with namespace prefixes
2015-04-09 18:42:44 +02:00
Sergei Golubchik
bb1b61b312 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
2015-04-09 18:42:43 +02:00
Sergei Golubchik
9ccafffc29 rename "encryption key management plugin" to "encryption plugin"
because it's going to do more than just key management
2015-04-09 18:42:43 +02:00
Sergei Golubchik
ef5b4889c2 optimize encryption api
only one encryption key lookup in most cases instead of three
(has_key, get_key_size, get_key).
2015-04-08 10:58:50 +02:00
Sergei Golubchik
e02749aaf5 completely rewrote file_key_management plugin
numerous issues fixed:
* buffer overflows
* error conditions aren't checked (crash if file doesn't exist)
* accessing random unallocated memory
* hard-coded password
* arbitrary hard-coded key id limit
* incomprehensible error messages (for key_id == 0 it reported
  "The key could not be initialized", for syntax errors the message was
  "Wrong match of the keyID, see the template", for a key id
  larger than hard-coded limit the message was "No asked key", and there
  was an error "Is comment" for a comment).
* tons of small mallocs, many are freed few lines down in the code
* malloc(N) and new char[N] are used both, even in the same function
* redundant memory copies
* pcre - "I can solve it with regular expressions" - with incorrect regexes
* parser context stored in a singleton
* keys are stored as strings and are strlen-ed and hex2bin-ed on every
  get_key() request
* lots of useless code (e.g. sprintf instead of a pointer assignment,
  checking of the file length to read a part of it in a fixed buffer,
  multiplying by sizeof(char) in many places, etc)
* this list is not exhaustive
2015-04-08 10:58:50 +02:00
Sergei Golubchik
88632726e8 rename plugins to remove "_plugin" from the plugin name 2015-04-08 10:58:48 +02:00
Renamed from plugin/file_key_management_plugin/file_key_management_plugin.cc (Browse further)