This is an automated email from the ASF dual-hosted git repository.
eiri pushed a commit to branch prototype/fdb-encryption
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/prototype/fdb-encryption by
this push:
new 9b60149 Fix cipher tag
9b60149 is described below
commit 9b60149ba04adc343f67321f2d663613af14536d
Author: Eric Avdey <[email protected]>
AuthorDate: Fri Mar 6 11:59:41 2020 -0400
Fix cipher tag
---
src/fabric/src/fabric2_encryption.erl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/fabric/src/fabric2_encryption.erl
b/src/fabric/src/fabric2_encryption.erl
index 43813d9..52a9889 100644
--- a/src/fabric/src/fabric2_encryption.erl
+++ b/src/fabric/src/fabric2_encryption.erl
@@ -226,12 +226,12 @@ unwrap_kek(Cache, WrappedKEK) ->
get_kek() ->
KEK = crypto:strong_rand_bytes(32),
% WrappedKEK = crypto:crypto_one_time(aes_256_ctr, ?MEK, ?IV, KEK, true),
- WrappedKEK = crypto:block_encrypt(aes_256_ctr, ?MEK, ?IV, KEK),
+ WrappedKEK = crypto:block_encrypt(aes_ctr, ?MEK, ?IV, KEK),
{ok, KEK, WrappedKEK}.
%% this mocks a call to an expernal system to unwrap KEK
unwrap_kek(WrappedKEK) ->
% KEK = crypto:crypto_one_time(aes_256_ctr, ?MEK, ?IV, WrappedKEK, true),
- KEK = crypto:block_decrypt(aes_256_ctr, ?MEK, ?IV, WrappedKEK),
+ KEK = crypto:block_decrypt(aes_ctr, ?MEK, ?IV, WrappedKEK),
{ok, KEK, WrappedKEK}.