erlangbureau/jamdb_oracle

Some crypt functions removed in OTP 24

marocchino opened this issue · 2 comments

Login fails when testing after below compilation warnings:

src/jamdb_oracle_crypt.erl:23:10: Warning: crypto:block_encrypt/4 is removed; use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto_(dyn_iv)?_init + crypto:crypto_(dyn_iv)?_update + crypto:crypto_final instead
%   23|     B1 = crypto:block_encrypt(des_cbc, hexstr2bin("0123456789ABCDEF"), IVec, CliPass),
%     |          ^

src/jamdb_oracle_crypt.erl:24:10: Warning: crypto:block_encrypt/4 is removed; use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto_(dyn_iv)?_init + crypto:crypto_(dyn_iv)?_update + crypto:crypto_final instead
%   24|     B2 = crypto:block_encrypt(des_cbc, binary:part(B1,byte_size(B1),-8), IVec, CliPass),
%     |          ^

src/jamdb_oracle_crypt.erl:39:15: Warning: crypto:block_decrypt/4 is removed; use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto_(dyn_iv)?_init + crypto:crypto_(dyn_iv)?_update + crypto:crypto_final instead
%   39|     SrvSess = crypto:block_decrypt(aes_cbc, KeySess, IVec, Sess),
%     |               ^

src/jamdb_oracle_crypt.erl:45:16: Warning: crypto:block_encrypt/4 is removed; use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto_(dyn_iv)?_init + crypto:crypto_(dyn_iv)?_update + crypto:crypto_final instead
%   45|     AuthSess = crypto:block_encrypt(aes_cbc, KeySess, IVec, CliSess),
%     |                ^

src/jamdb_oracle_crypt.erl:48:16: Warning: crypto:block_encrypt/4 is removed; use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto_(dyn_iv)?_init + crypto:crypto_(dyn_iv)?_update + crypto:crypto_final instead
%   48|     AuthPass = crypto:block_encrypt(aes_cbc, KeyConn, IVec, pad(Pass)),
%     |                ^

src/jamdb_oracle_crypt.erl:52:14: Warning: crypto:block_encrypt/4 is removed; use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto_(dyn_iv)?_init + crypto:crypto_(dyn_iv)?_update + crypto:crypto_final instead
%   52|         _ -> crypto:block_encrypt(aes_cbc, KeyConn, IVec, DerivedKey)
%     |              ^

src/jamdb_oracle_crypt.erl:67:12: Warning: crypto:block_decrypt/4 is removed; use crypto:crypto_one_time/5, crypto:crypto_one_time_aead/6,7 or crypto:crypto_(dyn_iv)?_init + crypto:crypto_(dyn_iv)?_update + crypto:crypto_final instead
%   67|     Data = crypto:block_decrypt(aes_cbc, KeyConn, IVec, hexstr2bin(Resp)),
%     |            ^

src/jamdb_oracle_crypt.erl:139:29: Warning: crypto:hmac/3 is removed; use crypto:mac/4 instead
%  139|     Mac = fun(Key, Data) -> crypto:hmac(Type, Key, Data) end,
%     |                             ^

crypto:hmac( can simply be replaced with crypto:mac(:hmac, , but the substitution from block_encrypt to crypto_one_time doesn't seem simple to me.

refs

https://erlang.org/doc/apps/crypto/new_api.html
erlef/rebar3_hex#189
highmobility/hmkit-crypto-elixir#11

Please test commit

I test with a206afa and The test was successful.

Thank You. 👍🏽

compile
==> jamdb_oracle
Compiling 5 files (.erl)
Compiling 3 files (.ex)
warning: module attribute @impl was not set for function update_all/1 callback (specified in Ecto.Adapters.SQL.Connection). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
lib/jamdb_oracle_ecto.ex:265: Ecto.Adapters.Jamdb.Oracle.Connection (module)

warning: module attribute @impl was not set for function update/5 callback (specified in Ecto.Adapters.SQL.Connection). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
lib/jamdb_oracle_ecto.ex:269: Ecto.Adapters.Jamdb.Oracle.Connection (module)

warning: module attribute @impl was not set for function to_constraints/2 callback (specified in Ecto.Adapters.SQL.Connection). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
lib/jamdb_oracle_ecto.ex:274: Ecto.Adapters.Jamdb.Oracle.Connection (module)

warning: module attribute @impl was not set for function table_exists_query/1 callback (specified in Ecto.Adapters.SQL.Connection). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
lib/jamdb_oracle_ecto.ex:271: Ecto.Adapters.Jamdb.Oracle.Connection (module)

warning: module attribute @impl was not set for function insert/7 callback (specified in Ecto.Adapters.SQL.Connection). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
lib/jamdb_oracle_ecto.ex:268: Ecto.Adapters.Jamdb.Oracle.Connection (module)

warning: module attribute @impl was not set for function execute_ddl/1 callback (specified in Ecto.Adapters.SQL.Connection). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
lib/jamdb_oracle_ecto.ex:272: Ecto.Adapters.Jamdb.Oracle.Connection (module)

warning: module attribute @impl was not set for function delete_all/1 callback (specified in Ecto.Adapters.SQL.Connection). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
lib/jamdb_oracle_ecto.ex:266: Ecto.Adapters.Jamdb.Oracle.Connection (module)

warning: module attribute @impl was not set for function delete/4 callback (specified in Ecto.Adapters.SQL.Connection). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
lib/jamdb_oracle_ecto.ex:270: Ecto.Adapters.Jamdb.Oracle.Connection (module)

warning: module attribute @impl was not set for function ddl_logs/1 callback (specified in Ecto.Adapters.SQL.Connection). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
lib/jamdb_oracle_ecto.ex:273: Ecto.Adapters.Jamdb.Oracle.Connection (module)

warning: module attribute @impl was not set for function all/1 callback (specified in Ecto.Adapters.SQL.Connection). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
lib/jamdb_oracle_ecto.ex:264: Ecto.Adapters.Jamdb.Oracle.Connection (module)

Generated jamdb_oracle app