New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove crypto module deprecations #17

Merged
merged 1 commit into from Oct 21, 2013

Conversation

Projects
None yet
2 participants
@mbbx6spp
Contributor

mbbx6spp commented Oct 13, 2013

When compiling with R16B02 the following deprecation warnings were
encountered:

src/prf_crypto.erl:36: Warning: crypto:des_cbc_encrypt/3 is deprecated and will be removed in in a future release; use crypto:block_encrypt/4
src/prf_crypto.erl:43: Warning: crypto:des_cbc_decrypt/3 is deprecated and will be removed in in a future release; use crypto:block_decrypt/4
src/prf_crypto.erl:46: Warning: crypto:md5/1 is deprecated and will be removed in in a future release; use crypto:hash/2

Since I use warnings_as_errors erlc option I needed to work around these
deprecation warnings for newer versions of Erlang (R16B+, I believe). I did
this using a rebar.config.script and the Erlang preprocessor's -ifdef
construct. Therefore, it should work for previous versions as well as newer
versions of Erlang.

This does make one assumption, an assumption I believe to be "safe", but
worth noting anyway. It assumes that if crypto:block_encrypt/4 is exported
from the crypto module that crypto:block_decrypt/4 will also be exported.

Happy to amend that shortcut if necessary.

Remove crypto module deprecations
When compiling with R16B02 the following deprecation warnings were
encountered:

```
src/prf_crypto.erl:36: Warning: crypto:des_cbc_encrypt/3 is deprecated and will be removed in in a future release; use crypto:block_encrypt/4
src/prf_crypto.erl:43: Warning: crypto:des_cbc_decrypt/3 is deprecated and will be removed in in a future release; use crypto:block_decrypt/4
src/prf_crypto.erl:46: Warning: crypto:md5/1 is deprecated and will be removed in in a future release; use crypto:hash/2
```

Since I use `warnings_as_errors` erlc option I needed to work around these
deprecation warnings for newer versions of Erlang (R16B+). I did this using
a `rebar.config.script` and the Erlang preprocessor's `-ifdef` construct.
Therefore, it should work for previous versions as well as newer versions of
Erlang.

This does make one assumption, an assumption I believe to be "safe", but
worth noting anyway. It assumes that if `crypto:block_encrypt/4` is exported
from the `crypto` module that `crypto:block_decrypt/4` will also be exported.

Happy to amend that shortcut if necessary.

@massemanet massemanet merged commit 9365442 into massemanet:master Oct 21, 2013

@mbbx6spp mbbx6spp deleted the mbbx6spp:fix-crypto-deprecations branch Oct 21, 2013

@massemanet

This comment has been minimized.

Show comment
Hide comment
@massemanet

massemanet Oct 22, 2013

Owner

merged. thanks!

Owner

massemanet commented Oct 22, 2013

merged. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment