aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-05-16 12:20:36 +0200
committerIngela Anderton Andin <[email protected]>2013-05-20 08:41:52 +0200
commitf706e003a2f6cb3f1f31b9d1294b379c2ab3affe (patch)
tree4e51c75e9a1c4615cbfc8864b3171621d25539f7 /lib/crypto
parentb7c3c6f3548b77edd3e43bf5e9dde3e94111960a (diff)
downloadotp-f706e003a2f6cb3f1f31b9d1294b379c2ab3affe.tar.gz
otp-f706e003a2f6cb3f1f31b9d1294b379c2ab3affe.tar.bz2
otp-f706e003a2f6cb3f1f31b9d1294b379c2ab3affe.zip
ssh & crypto: Remove use of deprecated crypto functions from ssh
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/doc/src/crypto.xml16
-rw-r--r--lib/crypto/src/crypto.erl6
2 files changed, 19 insertions, 3 deletions
diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml
index df765ade87..cac8f6ef28 100644
--- a/lib/crypto/doc/src/crypto.xml
+++ b/lib/crypto/doc/src/crypto.xml
@@ -186,6 +186,20 @@
</p>
</desc>
</func>
+
+ <func>
+ <name>binary_to_integer(Bin) -> Integer </name>
+ <fsummary>Convert binary representation, of an integer, to an Erlang integer.</fsummary>
+ <type>
+ <v>Bin = binary() - as returned by crypto functions</v>
+
+ <v>Integer = integer() </v>
+ </type>
+ <desc>
+ <p>Convert binary representation, of an integer, to an Erlang integer.
+ </p>
+ </desc>
+ </func>
<func>
<name>compute_key(Type, OthersPublicKey, MyPrivateKey, Params) -> SharedSecret</name>
@@ -410,7 +424,7 @@
<name>next_iv(Type, Data) -> </name>
<fsummary></fsummary>
<type>
- <v>Type = des_cbc | aes_cbc</v>
+ <v>Type = des_cbc | des3_cbc |aes_cbc | des_cfb</v>
<v>Data = iodata()</v>
</type>
<desc>
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index f4e157198c..dde53b1217 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -21,7 +21,7 @@
-module(crypto).
--export([start/0, stop/0, info_lib/0, algorithms/0, version/0]).
+-export([start/0, stop/0, info_lib/0, algorithms/0, version/0, binary_to_integer/1]).
-export([hash/2, hash_init/1, hash_update/2, hash_final/1]).
-export([sign/4, verify/5]).
-export([generate_key/2, generate_key/3, compute_key/4]).
@@ -33,9 +33,9 @@
-export([stream_init/2, stream_init/3, stream_encrypt/2, stream_decrypt/2]).
-export([public_encrypt/4, private_decrypt/4]).
-export([private_encrypt/4, public_decrypt/4]).
-
-export([dh_generate_parameters/2, dh_check/1]). %% Testing see
+
%% DEPRECATED
%% Replaced by hash_*
-export([md4/1, md4_init/0, md4_update/2, md4_final/1]).
@@ -1598,6 +1598,8 @@ int_to_bin_neg(-1, Ds=[MSB|_]) when MSB >= 16#80 ->
int_to_bin_neg(X,Ds) ->
int_to_bin_neg(X bsr 8, [(X band 255)|Ds]).
+binary_to_integer(Bin) ->
+ bin_to_int(Bin).
bin_to_int(Bin) when is_binary(Bin) ->
Bits = bit_size(Bin),